mirror of
https://github.com/dsx-ai-factory/nvke.git
synced 2026-12-07 04:35:58 +08:00
apiAuth in nvke-controller-config becomes the only place the controller reads its API authentication configuration from. This is the breaking second step of phase 2. - The controller refuses to start when AUTH_CONFIG_PATH is set, naming apiAuth as the replacement, and passes authn.Setup only the apiAuth section. authn.Load and Options.ConfigPath stay for management-engine's --auth-config. - The chart no longer renders or mounts nvke-auth-config. It refuses apiAuth.configMap and an AUTH_CONFIG_PATH env entry by name, and a caBundlePath into the old mount, pointing at jwks.caBundle. - apiAuth.permissive requires apiAuth.enabled, in the chart and at startup. Tilt passes it only with authentication on. - controllerconfig, which decodes the apiAuth section, gets the decoder-strictness tests. - nvkectl and the token scripts keep their fallback to the authentication ConfigMap for controllers from before this change. - The e2e suite reads the enforcement mode from apiAuth alone. - The pod template carries a checksum of nvke-controller-config, so an upgrade that changes apiAuth rolls the controller without Reloader, which the NVKE stack does not install. - API authorization (#2125) counts authentication as on exactly when apiAuth.enabled is. BREAKING CHANGE: AUTH_CONFIG_PATH and apiAuth.configMap are removed. A site that managed its own authentication ConfigMap moves audiences and issuers into apiAuth.config, CA bundles into jwks.caBundle, and sets apiAuth.enabled. apiAuth.permissive without apiAuth.enabled is refused. nvkectl older than the previous step gets 401. Signed-off-by: Abhay Krishna Arunachalam <abhaykrishna@nvidia.com>
51 lines
2.3 KiB
YAML
51 lines
2.3 KiB
YAML
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
# The NVKE API authentication configuration Tilt deploys. The Tiltfile passes
|
|
# this file only when NKE_AUTH_ENABLED is true, and sets apiAuth.enabled and
|
|
# apiAuth.permissive itself. The chart renders it into apiAuth in
|
|
# nvke-controller-config, which the controller reads.
|
|
# deploy/k8s/nvke-auth-dev.yaml creates the identities it admits.
|
|
apiAuth:
|
|
config:
|
|
audiences: ["https://nke.tilt.local"]
|
|
issuers:
|
|
- name: local-kubernetes
|
|
issuer: "https://kubernetes.default.svc.cluster.local"
|
|
# Every issuer is fetched the same way, as a JWKS over HTTPS. The
|
|
# cluster's own endpoint is not anonymous, hence the bearer token and
|
|
# the issuer-discovery ClusterRole.
|
|
jwks:
|
|
uri: "https://kubernetes.default.svc/openid/v1/jwks"
|
|
caBundlePath: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
|
|
bearerTokenPath: /var/run/secrets/kubernetes.io/serviceaccount/token
|
|
algorithms: [RS256, ES256]
|
|
admit:
|
|
serviceAccounts:
|
|
# Omitting name would widen the rule to every service account in
|
|
# the namespace, nke-e2e included.
|
|
- namespace: nke-clients
|
|
name: nke-client
|
|
- namespace: management-engine-system
|
|
name: management-engine-controller-manager
|
|
# SPIRE is omitted because it is not reachable yet, and an unreachable
|
|
# issuer is a startup failure in enforcing mode. The discovery provider's
|
|
# serving certificate does not carry the in-cluster service name, which
|
|
# does not resolve from the pod network anyway. Its CA is the ca.crt of
|
|
# secret oidc-provider-upstream-ca in the spire-server namespace, pasted
|
|
# inline. Every other value below was read off this cluster:
|
|
#
|
|
# - name: spire
|
|
# issuer: "https://nke.site-controller.internal"
|
|
# jwks:
|
|
# uri: "https://nke.site-controller.internal:30443/keys"
|
|
# caBundle: |
|
|
# -----BEGIN CERTIFICATE-----
|
|
# ...
|
|
# -----END CERTIFICATE-----
|
|
# algorithms: [RS256]
|
|
# admit:
|
|
# spiffe:
|
|
# trustDomain: controller-capi.nvke.local
|
|
# pathPrefixes: ["/nke-e2e/"]
|