Skip to content

Commit

Permalink
helm: Add a controllerImageVersion override (#11406)
Browse files Browse the repository at this point in the history
The linkerd-control-plane Helm chart currently always uses the `linkerdVersion` value
to populate the tag of a controller image. This does not allow for these values to diverge
and it prohibits the specification of sha values in the image.

To fix this, a new optional `controllerImageVersion` value is added to support overriding
the default version-based image tag.

Signed-off-by: Adam Shaw <[email protected]>
Signed-off-by: Dan Levin <[email protected]>
Co-authored-by: Adam Shaw <[email protected]>
  • Loading branch information
2 people authored and hawkw committed Nov 21, 2023
1 parent 41747e8 commit 9467bcc
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions charts/linkerd-control-plane/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ Kubernetes: `>=1.21.0-0`
| controlPlaneTracing | bool | `false` | enables control plane tracing |
| controlPlaneTracingNamespace | string | `"linkerd-jaeger"` | namespace to send control plane traces to |
| controllerImage | string | `"cr.l5d.io/linkerd/controller"` | Docker image for the destination and identity components |
| controllerImageVersion | string | `""` | Optionally allow a specific container image Tag (or SHA) to be specified for the controllerImage. |
| controllerLogFormat | string | `"plain"` | Log format for the control plane components |
| controllerLogLevel | string | `"info"` | Log level for the control plane components |
| controllerReplicas | int | `1` | Number of replicas for each control plane pod |
Expand Down
4 changes: 2 additions & 2 deletions charts/linkerd-control-plane/templates/destination.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ spec:
- -default-opaque-ports={{.Values.proxy.opaquePorts}}
- -enable-pprof={{.Values.enablePprof | default false}}
{{- include "partials.linkerd.trace" . | nindent 8 -}}
image: {{.Values.controllerImage}}:{{.Values.linkerdVersion}}
image: {{.Values.controllerImage}}:{{.Values.controllerImageVersion | default .Values.linkerdVersion}}
imagePullPolicy: {{.Values.imagePullPolicy}}
livenessProbe:
httpGet:
Expand Down Expand Up @@ -239,7 +239,7 @@ spec:
- -log-level={{.Values.controllerLogLevel}}
- -log-format={{.Values.controllerLogFormat}}
- -enable-pprof={{.Values.enablePprof | default false}}
image: {{.Values.controllerImage}}:{{.Values.linkerdVersion}}
image: {{.Values.controllerImage}}:{{.Values.controllerImageVersion | default .Values.linkerdVersion}}
imagePullPolicy: {{.Values.imagePullPolicy}}
livenessProbe:
httpGet:
Expand Down
2 changes: 1 addition & 1 deletion charts/linkerd-control-plane/templates/heartbeat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ spec:
restartPolicy: Never
containers:
- name: heartbeat
image: {{.Values.controllerImage}}:{{.Values.linkerdVersion}}
image: {{.Values.controllerImage}}:{{.Values.controllerImageVersion | default .Values.linkerdVersion}}
imagePullPolicy: {{.Values.imagePullPolicy}}
env:
- name: LINKERD_DISABLED
Expand Down
2 changes: 1 addition & 1 deletion charts/linkerd-control-plane/templates/identity.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ spec:
env:
- name: LINKERD_DISABLED
value: "linkerd-await cannot block the identity controller"
image: {{.Values.controllerImage}}:{{.Values.linkerdVersion}}
image: {{.Values.controllerImage}}:{{.Values.controllerImageVersion | default .Values.linkerdVersion}}
imagePullPolicy: {{.Values.imagePullPolicy}}
livenessProbe:
httpGet:
Expand Down
2 changes: 1 addition & 1 deletion charts/linkerd-control-plane/templates/proxy-injector.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ spec:
- -log-format={{.Values.controllerLogFormat}}
- -linkerd-namespace={{.Release.Namespace}}
- -enable-pprof={{.Values.enablePprof | default false}}
image: {{.Values.controllerImage}}:{{.Values.linkerdVersion}}
image: {{.Values.controllerImage}}:{{.Values.controllerImageVersion | default .Values.linkerdVersion}}
imagePullPolicy: {{.Values.imagePullPolicy}}
livenessProbe:
httpGet:
Expand Down
3 changes: 3 additions & 0 deletions charts/linkerd-control-plane/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,9 @@ webhookFailurePolicy: Ignore

# controllerImage -- Docker image for the destination and identity components
controllerImage: cr.l5d.io/linkerd/controller
# -- Optionally allow a specific container image Tag (or SHA) to be specified for the controllerImage.
controllerImageVersion: ""

# -- Number of replicas for each control plane pod
controllerReplicas: 1
# -- User ID for the control plane components
Expand Down

0 comments on commit 9467bcc

Please sign in to comment.