Skip to content

Commit

Permalink
Add imagePullSecrets support
Browse files Browse the repository at this point in the history
... for pulling images for private docker registries
  • Loading branch information
alpeb committed Oct 18, 2023
1 parent 877772a commit 85329aa
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions charts/linkerd-smi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ Kubernetes: `>=1.16.0-0`
| adaptor.nodeSelector | object | `{}` | Node selector for the adaptor instance |
| adaptor.tolerations | list | `[]` | Tolerations for the adaptor instance |
| clusterDomain | string | `"cluster.local"` | Kubernetes DNS Domain name to use |
| imagePullSecrets | list | `[]` | imagePullSecrets to apply to all ServiceAccounts for pulling images from private registries |
| linkerdNamespace | string | `"linkerd"` | Namespace of the Linkerd core control-plane install |
| namespaceMetadata.image.name | string | `"extension-init"` | Docker image name for the namespace-metadata instance |
| namespaceMetadata.image.pullPolicy | string | `"IfNotPresent"` | Pull policy for the namespace-metadata instance |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
{{- define "partials.namespace" -}}
{{ if eq .Release.Service "CLI" }}namespace: {{.Release.Namespace}}{{ end }}
{{- end -}}

{{- define "partials.image-pull-secrets"}}
{{- if . }}
imagePullSecrets:
{{ toYaml . | indent 2 }}
{{- end }}
{{- end -}}
1 change: 1 addition & 0 deletions charts/linkerd-smi/templates/namespace-metadata-rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ metadata:
"helm.sh/hook-weight": "0"
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
name: namespace-metadata
{{- include "partials.image-pull-secrets" .Values.imagePullSecrets }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
Expand Down
1 change: 1 addition & 0 deletions charts/linkerd-smi/templates/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,4 @@ metadata:
labels:
linkerd.io/extension: smi
component: smi-adaptor
{{- include "partials.image-pull-secrets" .Values.imagePullSecrets }}
4 changes: 4 additions & 0 deletions charts/linkerd-smi/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ clusterDomain: cluster.local
# -- Namespace of the Linkerd core control-plane install
linkerdNamespace: linkerd

# -- imagePullSecrets to apply to all ServiceAccounts for pulling images from
# private registries
imagePullSecrets: []

# SMI Adaptor configuration
adaptor:
image:
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ var (
"templates/namespace.yaml",
"templates/adaptor.yaml",
"templates/rbac.yaml",
"templates/_metadata.tpl",
"templates/_partials.tpl",
"templates/trafficsplit-crd.yaml",
}
)
Expand Down

0 comments on commit 85329aa

Please sign in to comment.