Skip to content

Commit 5fd75e1

Browse files
committed
feat!(helm): stable image tag defaults
* The Helm chart no longer defaults the image tag to `latest`, but now defaults to the chart's `appVersion` (which matches the latest SemVer image tag). * Simplify configuration overrides having eliminated the need for `kube-rbac-proxy`. The `deployment` values hierarchy has been renamed `manager`, and the values overrides previously managed under `deployment.containers.githubTokenManager` are now directly set on `manager`. Further, image `repository` and `tag` values are also directly set on `manager`. If `deployment.containers.githubTokenManager.image.tag` was set previously, then `manager.tag` should be set instead.
1 parent ba4f6a0 commit 5fd75e1

File tree

3 files changed

+42
-42
lines changed

3 files changed

+42
-42
lines changed

deploy/charts/github-token-manager/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ name: github-token-manager
44
description: A Helm chart for github-token-manager
55

66
type: application
7-
version: 0.1.5
7+
version: 0.2.0

deploy/charts/github-token-manager/templates/deployment.yaml

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
---
2-
{{- $deployment := .Values.deployment }}
2+
{{- $manager := .Values.manager }}
33
apiVersion: apps/v1
44
kind: Deployment
55
metadata:
66
name: {{ include "chart.fullname" . }}
7-
{{- with mergeOverwrite (default dict .Values.commonAnnotations) (default dict $deployment.annotations) }}
7+
{{- with mergeOverwrite (default dict .Values.commonAnnotations) (default dict $manager.annotations) }}
88
annotations:
99
{{- range $key, $value := . }}
1010
{{ $key }}: {{ tpl $value $ | quote }}
1111
{{- end }}
1212
{{- end }}
1313
labels:
14-
component: deployment
14+
component: manager
1515
{{- include "labels" . | nindent 4 }}
16-
{{- with $deployment.extraLabels -}}{{ toYaml . | nindent 4 }}{{- end }}
16+
{{- with $manager.extraLabels -}}{{ toYaml . | nindent 4 }}{{- end }}
1717
spec:
18-
replicas: {{ $deployment.replicas }}
18+
replicas: {{ $manager.replicas }}
1919
selector:
2020
matchLabels:
2121
{{- include "selectorLabels" . | nindent 6 }}
@@ -26,14 +26,6 @@ spec:
2626
labels:
2727
{{- include "selectorLabels" . | nindent 8 }}
2828
spec:
29-
{{- with $deployment.tolerations }}
30-
tolerations:
31-
{{- toYaml . | nindent 8 }}
32-
{{- end }}
33-
{{- with $deployment.nodeSelector }}
34-
nodeSelector:
35-
{{- toYaml . | nindent 8 }}
36-
{{- end }}
3729
affinity:
3830
nodeAffinity:
3931
requiredDuringSchedulingIgnoredDuringExecution:
@@ -49,18 +41,21 @@ spec:
4941
values:
5042
- linux
5143
containers:
52-
{{- $githubTokenManager := $deployment.containers.githubTokenManager }}
5344
- args:
5445
- --health-probe-bind-address=:8081
5546
- --metrics-bind-address=127.0.0.1:8080
5647
- --leader-elect
5748
command:
5849
- /ko-app/manager
59-
{{- with $githubTokenManager.env }}
50+
{{- with $manager.env }}
6051
env:
6152
{{- toYaml . | nindent 12 }}
6253
{{- end }}
63-
image: {{ $githubTokenManager.image.repository }}:{{ $githubTokenManager.image.tag }}
54+
image: {{ if (hasPrefix "sha256:" (default "" $manager.tag)) -}}
55+
{{- printf "%s@%s" $manager.repository $manager.tag -}}
56+
{{- else -}}
57+
{{- printf "%s:%s" $manager.repository (or $manager.tag $.Chart.AppVersion "latest") -}}
58+
{{- end }}
6459
livenessProbe:
6560
httpGet:
6661
path: /healthz
@@ -76,9 +71,9 @@ spec:
7671
periodSeconds: 10
7772
resources:
7873
limits:
79-
{{- $githubTokenManager.resources.limits | toYaml | nindent 14 }}
74+
{{- $manager.resources.limits | toYaml | nindent 14 }}
8075
requests:
81-
{{- $githubTokenManager.resources.requests | toYaml | nindent 14 }}
76+
{{- $manager.resources.requests | toYaml | nindent 14 }}
8277
securityContext:
8378
allowPrivilegeEscalation: false
8479
capabilities:
@@ -88,12 +83,20 @@ spec:
8883
- mountPath: /config
8984
name: config
9085
readOnly: true
86+
{{- with $manager.nodeSelector }}
87+
nodeSelector:
88+
{{- toYaml . | nindent 8 }}
89+
{{- end }}
9190
securityContext:
9291
runAsNonRoot: true
9392
seccompProfile:
9493
type: RuntimeDefault
9594
serviceAccountName: {{ .Values.rbac.serviceAccount.name | default (include "chart.fullname" . ) }}
9695
terminationGracePeriodSeconds: 10
96+
{{- with $manager.tolerations }}
97+
tolerations:
98+
{{- toYaml . | nindent 8 }}
99+
{{- end }}
97100
volumes:
98101
- name: config
99102
secret:

deploy/charts/github-token-manager/values.yaml

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -53,32 +53,29 @@ metrics:
5353
protocol: TCP
5454
targetPort: https
5555

56-
## deployment
56+
## manager
57+
## repository: image repository
58+
## tag: image tag
5759
## replicas: number of replicas
60+
## annotations: map of annotations (optional)
5861
## tolerations: list of tolerations (optional)
5962
## nodeSelector: node selector (optional)
60-
## containers: list of containers
61-
## githubTokenManager:
62-
## image:
63-
## repository: image repository
64-
## tag: image tag
65-
deployment:
66-
annotations: {}
63+
## env: list of additional environment variables to set on the manager container
64+
## resources: manager container resource requests and limits
65+
manager:
66+
repository: ghcr.io/isometry/github-token-manager
67+
tag: ~ # defaults to chart appVersion
6768
replicas: 1
69+
annotations: {}
6870
tolerations: ~
6971
nodeSelector: ~
70-
containers:
71-
githubTokenManager:
72-
image:
73-
repository: ghcr.io/isometry/github-token-manager
74-
tag: latest
75-
# additional environment variables to set on the controller container
76-
# e.g. `[{name: VAULT_ADDR, value: http://vault:8200}]`
77-
env: []
78-
resources:
79-
limits:
80-
cpu: 500m
81-
memory: 128Mi
82-
requests:
83-
cpu: 5m
84-
memory: 64Mi
72+
# additional environment variables to set on the controller container
73+
# e.g. `[{name: VAULT_ADDR, value: http://vault:8200}]`
74+
env: []
75+
resources:
76+
limits:
77+
cpu: 500m
78+
memory: 128Mi
79+
requests:
80+
cpu: 5m
81+
memory: 64Mi

0 commit comments

Comments
 (0)