Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions charts/substrate/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ See `values.yaml` for the full set; the important keys:
| `atelet.imageCredentialProviderConfig` | `""` | Host path to the kubelet credential provider config; set together with the bin directory |
| `atelet.imageCredentialProviderConfigYAML` | `""` | Credential provider config as text, rendered into a ConfigMap, for nodes where that file cannot be authored or must differ from the kubelet's; mutually exclusive with the host path |
| `atelet.imageCredentialProviderBinDir` | `""` | Host path to the kubelet credential provider binaries; both paths are mounted read-only |
| `atelet.imageCredentialProviderPlugins` | `[]` | Credential provider plugins delivered from images instead of a node directory (set this or the bin directory): each `{name, image[, command, args]}` becomes an init container that installs its binary (default args `install /run/image-credential-provider/bin`) into an emptyDir atelet loads plugins from — no host path, so it works on any cluster |
| `atelet.imageCredentialProviderSecrets` | `[]` | Secrets mounted read-only at `/run/image-credential-provider/secrets/<name>` for the plugins, each `{name[, secretName, optional, items]}` — e.g. a `kubernetes.io/dockerconfigjson` Secret a docker-config plugin answers from (point the provider's `env` `DOCKER_CONFIG` at that directory) |
| `credentialProvider.namespacePolicies` | `[]` | Default-deny atespace-to-namespace grants; the chart includes get-only Secret RBAC for the provider |
| `ateApi.actorJWTIssuer` | `https://<idp-service>.<namespace>.svc` | Issuer placed in actor JWTs; set a stable URL reachable by relying parties |
| `objectStorePlugin.extraEnv` | `[]` | Object storage credentials/settings shared by both object-store plugins |
Expand Down
48 changes: 46 additions & 2 deletions charts/substrate/templates/atelet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,15 @@ limitations under the License.
{{- fail "set only one of atelet.imageCredentialProviderConfig and atelet.imageCredentialProviderConfigYAML" }}
{{- end }}
{{- $credentialProviderConfig := or .Values.atelet.imageCredentialProviderConfig .Values.atelet.imageCredentialProviderConfigYAML }}
{{- if ne (empty $credentialProviderConfig) (empty .Values.atelet.imageCredentialProviderBinDir) }}
{{- fail "atelet.imageCredentialProviderConfig (or atelet.imageCredentialProviderConfigYAML) and atelet.imageCredentialProviderBinDir must be set together" }}
{{- $credentialProviderPlugins := .Values.atelet.imageCredentialProviderPlugins }}
{{- if and $credentialProviderPlugins .Values.atelet.imageCredentialProviderBinDir }}
{{- fail "set only one of atelet.imageCredentialProviderPlugins (plugins from images, emptyDir) and atelet.imageCredentialProviderBinDir (a node directory)" }}
{{- end }}
{{- if ne (empty $credentialProviderConfig) (and (empty .Values.atelet.imageCredentialProviderBinDir) (empty $credentialProviderPlugins)) }}
{{- fail "atelet.imageCredentialProviderConfig (or atelet.imageCredentialProviderConfigYAML) needs atelet.imageCredentialProviderBinDir or atelet.imageCredentialProviderPlugins, and they need it" }}
{{- end }}
{{- if and .Values.atelet.imageCredentialProviderSecrets (not $credentialProviderConfig) }}
{{- fail "atelet.imageCredentialProviderSecrets needs a credential provider config (atelet.imageCredentialProviderConfigYAML)" }}
{{- end }}

# atelet
Expand Down Expand Up @@ -139,6 +146,25 @@ spec:
effect: NoSchedule
{{- with include "substrate.imagePullSecrets" . }}{{- . | nindent 6 }}{{- end }}
initContainers:
{{- range $credentialProviderPlugins }}
# Installs a credential-provider plugin binary from its image into the shared emptyDir.
- name: {{ printf "credential-provider-%s" .name | trunc 63 | trimSuffix "-" }}
image: {{ .image | quote }}
{{- with .command }}
command: {{ toJson . }}
{{- end }}
args: {{ toJson (default (list "install" "/run/image-credential-provider/bin") .args) }}
securityContext:
runAsNonRoot: true
runAsUser: 65532
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
drop: ["ALL"]
volumeMounts:
- name: image-credential-provider-bin
mountPath: /run/image-credential-provider/bin
{{- end }}
- name: objectstore-plugin
image: {{ include "substrate.componentImage" (list "objectstore-plugin" .) }}
restartPolicy: Always
Expand Down Expand Up @@ -277,6 +303,11 @@ spec:
subPath: config.yaml
{{- end }}
readOnly: true
{{- range .Values.atelet.imageCredentialProviderSecrets }}
- name: {{ printf "image-credential-%s" .name | trunc 63 | trimSuffix "-" }}
mountPath: {{ printf "/run/image-credential-provider/secrets/%s" .name }}
readOnly: true
{{- end }}
{{- end }}
volumes:
- name: objectstore-plugin
Expand All @@ -303,9 +334,22 @@ spec:
type: Directory
{{- if $credentialProviderConfig }}
- name: image-credential-provider-bin
{{- if $credentialProviderPlugins }}
emptyDir: {}
{{- else }}
hostPath:
path: {{ .Values.atelet.imageCredentialProviderBinDir | quote }}
type: Directory
{{- end }}
{{- range .Values.atelet.imageCredentialProviderSecrets }}
- name: {{ printf "image-credential-%s" .name | trunc 63 | trimSuffix "-" }}
secret:
secretName: {{ default .name .secretName | quote }}
optional: {{ default false .optional }}
{{- with .items }}
items: {{ toJson . }}
{{- end }}
{{- end }}
- name: image-credential-provider-config
{{- if .Values.atelet.imageCredentialProviderConfigYAML }}
configMap:
Expand Down
69 changes: 69 additions & 0 deletions charts/substrate/tests/atelet_credential_provider_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Copyright 2026 The Agent Substrate Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

suite: atelet credential-provider plugins from images
templates:
- atelet.yaml
release:
name: substrate
namespace: ate-system
values:
- ./values/credential-provider-plugins.yaml
tests:
- it: installs each plugin from its image into an emptyDir and passes both flags
documentSelector:
path: kind
value: DaemonSet
asserts:
- equal:
path: spec.template.spec.initContainers[0].name
value: credential-provider-dockerconfig-credential-provider
- equal:
path: spec.template.spec.initContainers[0].args
value: ["install", "/run/image-credential-provider/bin"]
- contains:
path: spec.template.spec.containers[0].args
content: --image-credential-provider-bin-dir=/run/image-credential-provider/bin
- contains:
path: spec.template.spec.volumes
content:
name: image-credential-provider-bin
emptyDir: {}
- it: mounts the plugin Secrets read-only
documentSelector:
path: kind
value: DaemonSet
asserts:
- contains:
path: spec.template.spec.containers[0].volumeMounts
content:
name: image-credential-registry
mountPath: /run/image-credential-provider/secrets/registry
readOnly: true
- contains:
path: spec.template.spec.volumes
content:
name: image-credential-registry
secret:
secretName: atelet-registry-auth
optional: true
items:
- key: .dockerconfigjson
path: config.json
- it: refuses plugins together with a node bin directory
set:
atelet.imageCredentialProviderBinDir: /home/kubernetes/bin
asserts:
- failedTemplate:
errorPattern: set only one of atelet.imageCredentialProviderPlugins
32 changes: 32 additions & 0 deletions charts/substrate/tests/values/credential-provider-plugins.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Copyright 2026 The Agent Substrate Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

atelet:
imageCredentialProviderPlugins:
- name: dockerconfig-credential-provider
image: ghcr.io/planeodev/google-substrate/dockerconfig-credential-provider@sha256:0000000000000000000000000000000000000000000000000000000000000000
imageCredentialProviderSecrets:
- name: registry
secretName: atelet-registry-auth
optional: true
items: [{key: .dockerconfigjson, path: config.json}]
imageCredentialProviderConfigYAML: |
apiVersion: kubelet.config.k8s.io/v1
kind: CredentialProviderConfig
providers:
- name: dockerconfig-credential-provider
apiVersion: credentialprovider.kubelet.k8s.io/v1
matchImages: ["ghcr.io"]
defaultCacheDuration: 5m
env: [{name: DOCKER_CONFIG, value: /run/image-credential-provider/secrets/registry}]
16 changes: 16 additions & 0 deletions charts/substrate/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,22 @@ atelet:
# either one still needs the bin directory.
imageCredentialProviderConfigYAML: ""
imageCredentialProviderBinDir: ""
# Credential-provider plugins delivered from IMAGES instead of a node directory (set this OR
# imageCredentialProviderBinDir): each entry becomes an init container that installs its binary into an
# emptyDir atelet loads plugins from — no host path, any cluster. The image's entrypoint is run with
# args (default ["install", "/run/image-credential-provider/bin"]); the binary's name must match the
# provider `name` in the CredentialProviderConfig.
# - name: dockerconfig-credential-provider
# image: ghcr.io/<org>/<repo>/dockerconfig-credential-provider@sha256:<digest>
imageCredentialProviderPlugins: []
# Secrets mounted read-only at /run/image-credential-provider/secrets/<name> for the plugins (e.g. a
# kubernetes.io/dockerconfigjson Secret a docker-config plugin answers from; point the provider's `env`
# DOCKER_CONFIG at the directory and map `.dockerconfigjson` to `config.json` with items).
# - name: registry
# secretName: atelet-registry-auth
# optional: true
# items: [{key: .dockerconfigjson, path: config.json}]
imageCredentialProviderSecrets: []
storageBackend: s3
extraArgs: []
extraEnv: []
Expand Down
Loading