Skip to content
Open
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
6 changes: 5 additions & 1 deletion charts/substrate-atelet/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,11 @@ substrate release references.
{{- $name := index . 0 -}}
{{- $ctx := index . 1 -}}
{{- $registry := default $ctx.Values.image.registry (($ctx.Values.global).imageRegistry) -}}
{{- printf "%s/%s/%s:%s" $registry $ctx.Values.image.repository $name ($ctx.Values.image.tag | default $ctx.Chart.AppVersion) -}}
{{- $ref := printf "%s/%s/%s:%s" $registry $ctx.Values.image.repository $name ($ctx.Values.image.tag | default $ctx.Chart.AppVersion) -}}
{{- with index ($ctx.Values.image.digests | default dict) $name -}}
{{- $ref = printf "%s@%s" $ref . -}}
{{- end -}}
{{- $ref -}}
{{- end -}}

{{/* imagePullSecrets for a pod spec. Copied from the substrate chart. */}}
Expand Down
3 changes: 3 additions & 0 deletions charts/substrate-atelet/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,6 @@ image:
# Image path prefix under the registry, ahead of each component name.
repository: kagent-dev/substrate
tag: ""
# Optional digest per component image, keyed by component name (atelet,
# objectstore-plugin), appended to its reference after the tag.
digests: {}
2 changes: 1 addition & 1 deletion charts/substrate-podcert/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ PostgreSQL login identities. Entries use
`namespace/service-account=username[,username]` form.

Configure the controller image through `image.registry`, `image.repository`,
and `image.tag`. `global.imageRegistry` overrides the registry, and
`image.tag` and, to pin it by digest, `image.digests.podcertcontroller`. `global.imageRegistry` overrides the registry, and
`imagePullSecrets` and `global.imagePullSecrets` are merged for the controller pod.

For an existing installation, the controller resources must be transferred out
Expand Down
11 changes: 7 additions & 4 deletions charts/substrate-podcert/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,14 @@ limitations under the License.
{{- end -}}
{{- $registry := default $ctx.Values.image.registry $ctx.Values.global.imageRegistry -}}
{{- $tag := default $ctx.Chart.AppVersion $ctx.Values.image.tag -}}
{{- if eq $tag "<none>" -}}
{{- printf "%s/%s/%s" $registry $ctx.Values.image.repository $name -}}
{{- else -}}
{{- printf "%s/%s/%s:%s" $registry $ctx.Values.image.repository $name $tag -}}
{{- $ref := printf "%s/%s/%s" $registry $ctx.Values.image.repository $name -}}
{{- if ne $tag "<none>" -}}
{{- $ref = printf "%s:%s" $ref $tag -}}
{{- end -}}
{{- with index ($ctx.Values.image.digests | default dict) $name -}}
{{- $ref = printf "%s@%s" $ref . -}}
{{- end -}}
{{- $ref -}}
{{- end -}}

{{- define "podcert.imagePullSecrets" -}}
Expand Down
3 changes: 3 additions & 0 deletions charts/substrate-podcert/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,6 @@ image:
registry: ghcr.io
repository: kagent-dev/substrate
tag: ""
# Optional digest per component image, keyed by component name
# (podcertcontroller), appended to its reference after the tag.
digests: {}
3 changes: 2 additions & 1 deletion charts/substrate/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ atelet before ate-api-server.

By default, component images are pulled from `ghcr.io/kagent-dev/substrate`
using the chart `appVersion` as the tag. Override `image.registry` and
`image.tag` to install from a different image repository or tag.
`image.tag` to install from a different image repository or tag. Set `image.digests` to pin
component images by digest, keyed by component name.

The chart installs the Kubernetes credential provider and enables HTTPS egress
interception. Create the `egress-mitm-ca-pool` Secret and configure actor trust
Expand Down
11 changes: 8 additions & 3 deletions charts/substrate/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ Produces {image.registry}/{name}:{tag} where tag is resolved as:
2. .Chart.AppVersion, if image.tag is empty
3. no tag (no colon) when image.tag is the sentinel "<none>"

followed by @{digest} when image.digests has an entry for {name}.

The "<none>" sentinel is used by hack/render-manifests.sh so that ko:// refs
are emitted without a tag, letting `ko resolve` supply the digest at build time.
*/}}
Expand All @@ -184,11 +186,14 @@ are emitted without a tag, letting `ko resolve` supply the digest at build time.
{{- end -}}
{{- $registry := printf "%s/%s" (default $ctx.Values.image.registry (($ctx.Values.global).imageRegistry)) $ctx.Values.image.repository -}}
{{- $tag := $ctx.Values.image.tag | default $ctx.Chart.AppVersion -}}
{{- $ref := printf "%s/%s" $registry $name -}}
{{- if ne $tag "<none>" -}}
{{- printf "%s/%s:%s" $registry $name $tag -}}
{{- else -}}
{{- printf "%s/%s" $registry $name -}}
{{- $ref = printf "%s:%s" $ref $tag -}}
{{- end -}}
{{- with index ($ctx.Values.image.digests | default dict) $name -}}
{{- $ref = printf "%s@%s" $ref . -}}
{{- end -}}
{{- $ref -}}
{{- end -}}

{{/*
Expand Down
17 changes: 17 additions & 0 deletions charts/substrate/tests/control_plane_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -600,3 +600,20 @@ tests:
asserts:
- failedTemplate:
errorMessage: "atenetEgress.extraCredentialProviders: vault.example.com needs an address as host:port"

- it: pins a component image by digest when image.digests names the component
template: ate-api-server.yaml
documentSelector:
path: kind
value: Deployment
set:
image.tag: v9.9.9
image.digests:
ateapi: sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
asserts:
- equal:
path: spec.template.spec.containers[0].image
value: ghcr.io/kagent-dev/substrate/ateapi:v9.9.9@sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
- equal:
path: spec.template.spec.initContainers[0].image
value: ghcr.io/kagent-dev/substrate/objectstore-plugin:v9.9.9
6 changes: 6 additions & 0 deletions charts/substrate/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,12 @@ image:
# images under this same path.
repository: kagent-dev/substrate
tag: ""
# Optional digest per component image, keyed by component name (ateapi,
# atecontroller, ate-idp-server, atelet, objectstore-plugin,
# kubernetes-secrets), appended to that image's reference after the tag:
# digests:
# ateapi: sha256:...
digests: {}

images:
rustfs: rustfs/rustfs:1.0.3@sha256:9ca9559533b537d10482fe923288b676ad08f92a7069d9a17327fbae3cab688b
Expand Down