Skip to content

Commit 49c73fb

Browse files
committed
feat(hyades)!: unify labels/annotations fields across components
BREAKING CHANGE: apiServer.annotations and frontend.annotations were previously pod-level annotations. They are now resource-level annotations on the Deployment. Use podAnnotations for pod-level annotations. Signed-off-by: rseleven <73898556+rseleven@users.noreply.github.com>
1 parent 8ea405c commit 49c73fb

6 files changed

Lines changed: 121 additions & 33 deletions

File tree

charts/hyades/README.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ v2, or be ready to migrate when v2 is released.
3131
|-----|------|---------|-------------|
3232
| apiServer.additionalVolumeMounts | list | `[]` | |
3333
| apiServer.additionalVolumes | list | `[]` | |
34-
| apiServer.annotations | object | `{}` | |
34+
| apiServer.annotations | object | `{}` | Additional annotations to add to the API-server Deployment resource. |
3535
| apiServer.args | list | `[]` | |
3636
| apiServer.autoScaling | object | `{"annotations":{},"enabled":false,"maxReplicas":3,"minReplicas":1,"targetCPUUtilizationPercentage":70,"targetMemoryUtilizationPercentage":70}` | Enables horizontal pod autoscaling |
3737
| apiServer.command | list | `[]` | |
@@ -40,18 +40,20 @@ v2, or be ready to migrate when v2 is released.
4040
| apiServer.extraContainers | list | `[]` | Additional containers to deploy. Supports templating. |
4141
| apiServer.extraEnv | list | `[]` | |
4242
| apiServer.extraEnvFrom | list | `[]` | |
43-
| apiServer.extraLabels | object | `{}` | |
4443
| apiServer.image.pullPolicy | string | `"Always"` | |
4544
| apiServer.image.registry | string | `""` | Override common.image.registry for the API server. |
4645
| apiServer.image.repository | string | `"dependencytrack/apiserver"` | |
4746
| apiServer.image.tag | string | `""` | Can be a tag name such as "latest", or an image digest prefixed with "sha256:". |
4847
| apiServer.initContainers | list | `[]` | Additional init containers to deploy. Supports templating. |
48+
| apiServer.labels | object | `{}` | Additional labels to add to the API-server Deployment resource. |
4949
| apiServer.nodeSelector | object | `{}` | |
5050
| apiServer.persistentVolume.accessModes | list | `[]` | Access modes for the PVC. When empty, access modes are determined automatically: - ReadWriteMany when autoScaling is enabled or replicaCount > 1 - ReadWriteOnce otherwise |
5151
| apiServer.persistentVolume.className | string | `""` | Storage class name. If empty, the default storage class will be used. |
5252
| apiServer.persistentVolume.enabled | bool | `false` | Whether to create a PersistentVolumeClaim for the API server. |
5353
| apiServer.persistentVolume.existingClaim | string | `""` | Use an existing PVC instead of creating a new one. When set, the PVC will not be created by the chart. |
5454
| apiServer.persistentVolume.size | string | `"5Gi"` | Size of the PVC. |
55+
| apiServer.podAnnotations | object | `{}` | Additional annotations to add to the API-server pods. |
56+
| apiServer.podLabels | object | `{}` | Additional labels to add to the API-server pods. |
5557
| apiServer.probes.liveness.failureThreshold | int | `3` | |
5658
| apiServer.probes.liveness.initialDelaySeconds | int | `10` | |
5759
| apiServer.probes.liveness.periodSeconds | int | `15` | |
@@ -97,7 +99,7 @@ v2, or be ready to migrate when v2 is released.
9799
| extraObjects | list | `[]` | |
98100
| frontend.additionalVolumeMounts | list | `[]` | |
99101
| frontend.additionalVolumes | list | `[]` | |
100-
| frontend.annotations | object | `{}` | |
102+
| frontend.annotations | object | `{}` | Additional annotations to add to the frontend Deployment resource. |
101103
| frontend.apiBaseUrl | string | `""` | |
102104
| frontend.args | list | `[]` | |
103105
| frontend.autoScaling | object | `{"annotations":{},"enabled":false,"maxReplicas":3,"minReplicas":1,"targetCPUUtilizationPercentage":70,"targetMemoryUtilizationPercentage":70}` | Enables horizontal pod autoscaling |
@@ -107,13 +109,15 @@ v2, or be ready to migrate when v2 is released.
107109
| frontend.extraContainers | list | `[]` | Additional containers to deploy. Supports templating. |
108110
| frontend.extraEnv | list | `[]` | |
109111
| frontend.extraEnvFrom | list | `[]` | |
110-
| frontend.extraLabels | object | `{}` | |
111112
| frontend.image.pullPolicy | string | `"Always"` | |
112113
| frontend.image.registry | string | `""` | Override common.image.registry for the API frontend. |
113114
| frontend.image.repository | string | `"dependencytrack/frontend"` | |
114115
| frontend.image.tag | string | `""` | Can be a tag name such as "latest", or an image digest prefixed with "sha256:". |
115116
| frontend.initContainers | list | `[]` | Additional init containers to deploy. Supports templating. |
117+
| frontend.labels | object | `{}` | Additional labels to add to the frontend Deployment resource. |
116118
| frontend.nodeSelector | object | `{}` | |
119+
| frontend.podAnnotations | object | `{}` | Additional annotations to add to the frontend pods. |
120+
| frontend.podLabels | object | `{}` | Additional labels to add to the frontend pods. |
117121
| frontend.probes.liveness.failureThreshold | int | `3` | |
118122
| frontend.probes.liveness.initialDelaySeconds | int | `5` | |
119123
| frontend.probes.liveness.periodSeconds | int | `15` | |
@@ -144,7 +148,7 @@ v2, or be ready to migrate when v2 is released.
144148
| ingress.hostname | string | `"example.com"` | |
145149
| ingress.ingressClassName | string | `""` | |
146150
| ingress.tls | list | `[]` | |
147-
| initializer.annotations | object | `{}` | |
151+
| initializer.annotations | object | `{}` | Additional annotations to add to the initializer Job resource. |
148152
| initializer.args | list | `[]` | |
149153
| initializer.command | list | `[]` | |
150154
| initializer.enabled | bool | `false` | Whether to enable the initializer Job. When enabled, an init container will be added to all deployments that require database access. The init container will wait for the initializer Job to complete. Requires the service account token to be mounted. |
@@ -154,8 +158,11 @@ v2, or be ready to migrate when v2 is released.
154158
| initializer.image.registry | string | `""` | Override common.image.registry for the API server. |
155159
| initializer.image.repository | string | `"dependencytrack/apiserver"` | |
156160
| initializer.image.tag | string | `""` | Can be a tag name such as "latest", or an image digest prefixed with "sha256:". |
161+
| initializer.labels | object | `{}` | Additional labels to add to the initializer Job resource. |
157162
| initializer.noHelmHook | bool | `false` | Whether to NOT deploy the initializer Job as `post-install` and `post-upgrade` Helm hook. Deploying as Helm hook can create deadlock situations when `helm install` and `helm upgrade` are executed with `--wait` flag. See <https://github.com/helm/helm/issues/10555>. Note that without hooks, `helm upgrade` may fail due to Job fields being immutable. |
158163
| initializer.nodeSelector | object | `{}` | |
164+
| initializer.podAnnotations | object | `{}` | Additional annotations to add to the initializer pods. |
165+
| initializer.podLabels | object | `{}` | Additional labels to add to the initializer pods. |
159166
| initializer.resources.limits.memory | string | `"256Mi"` | |
160167
| initializer.resources.requests.cpu | string | `"150m"` | |
161168
| initializer.resources.requests.memory | string | `"256Mi"` | |
@@ -167,3 +174,5 @@ v2, or be ready to migrate when v2 is released.
167174
| initializer.waiter.image.repository | string | `"bitnami/kubectl"` | |
168175
| initializer.waiter.image.tag | string | `"latest"` | |
169176

177+
----------------------------------------------
178+
Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2)

charts/hyades/templates/api-server/deployment.yaml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,15 @@ kind: Deployment
55
metadata:
66
name: {{ include "hyades.apiServerFullname" . }}
77
namespace: {{ .Release.Namespace }}
8-
labels: {{- include "hyades.apiServerLabels" . | nindent 4 }}
8+
{{- with .Values.apiServer.annotations }}
9+
annotations:
10+
{{- toYaml . | nindent 4 }}
11+
{{- end }}
12+
labels:
13+
{{- include "hyades.apiServerLabels" . | nindent 4 }}
14+
{{- with .Values.apiServer.labels }}
15+
{{- toYaml . | nindent 4 }}
16+
{{- end }}
917
spec:
1018
{{- if (not .Values.apiServer.autoScaling.enabled) }}
1119
replicas: {{ .Values.apiServer.replicaCount }}
@@ -16,16 +24,17 @@ spec:
1624
matchLabels: {{- include "hyades.apiServerSelectorLabels" . | nindent 6 }}
1725
template:
1826
metadata:
19-
labels: {{ include "hyades.apiServerSelectorLabels" . | nindent 8 }}
20-
{{- if .Values.apiServer.extraLabels }}
21-
{{- toYaml .Values.apiServer.extraLabels | nindent 8 }}
22-
{{- end }}
2327
annotations:
2428
prometheus.io/scrape: "true"
2529
prometheus.io/path: /metrics
26-
{{- with .Values.apiServer.annotations }}
30+
{{- with .Values.apiServer.podAnnotations }}
2731
{{ toYaml . | nindent 8 }}
2832
{{- end }}
33+
labels:
34+
{{- include "hyades.apiServerSelectorLabels" . | nindent 8 }}
35+
{{- with .Values.apiServer.podLabels }}
36+
{{- toYaml . | nindent 8 }}
37+
{{- end }}
2938
spec:
3039
{{- with .Values.common.image.pullSecrets }}
3140
imagePullSecrets: {{- toYaml . | nindent 6 }}

charts/hyades/templates/frontend/deployment.yaml

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,15 @@ kind: Deployment
55
metadata:
66
name: {{ include "hyades.frontendFullname" . }}
77
namespace: {{ .Release.Namespace }}
8-
labels: {{- include "hyades.frontendLabels" . | nindent 4 }}
8+
{{- with .Values.frontend.annotations }}
9+
annotations:
10+
{{- toYaml . | nindent 4 }}
11+
{{- end }}
12+
labels:
13+
{{- include "hyades.frontendLabels" . | nindent 4 }}
14+
{{- with .Values.frontend.labels }}
15+
{{- toYaml . | nindent 4 }}
16+
{{- end }}
917
spec:
1018
{{- if (not .Values.frontend.autoScaling.enabled) }}
1119
replicas: {{ .Values.frontend.replicaCount }}
@@ -16,13 +24,15 @@ spec:
1624
matchLabels: {{- include "hyades.frontendSelectorLabels" . | nindent 6 }}
1725
template:
1826
metadata:
19-
labels: {{- include "hyades.frontendSelectorLabels" . | nindent 8 }}
20-
{{- if .Values.frontend.extraLabels }}
21-
{{- toYaml .Values.frontend.extraLabels | nindent 8 }}
22-
{{- end }}
23-
{{- with .Values.frontend.annotations }}
24-
annotations: {{- toYaml . | nindent 8 }}
27+
{{- with .Values.frontend.podAnnotations }}
28+
annotations:
29+
{{- toYaml . | nindent 8 }}
2530
{{- end }}
31+
labels:
32+
{{- include "hyades.frontendSelectorLabels" . | nindent 8 }}
33+
{{- with .Values.frontend.podLabels }}
34+
{{- toYaml . | nindent 8 }}
35+
{{- end }}
2636
spec:
2737
{{- with .Values.common.image.pullSecrets }}
2838
imagePullSecrets: {{- toYaml . | nindent 6 }}
@@ -100,4 +110,4 @@ spec:
100110
{{- with .Values.frontend.additionalVolumes }}
101111
{{- toYaml . | nindent 6 }}
102112
{{- end }}
103-
{{- end }}
113+
{{- end }}

charts/hyades/templates/initializer/job.yaml

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,36 @@ kind: Job
55
metadata:
66
name: {{ include "hyades.initializerFullname" . }}
77
namespace: {{ .Release.Namespace }}
8-
labels: {{- include "hyades.initializerLabels" . | nindent 4 }}
9-
{{- if not .Values.initializer.noHelmHook }}
8+
{{- if or (not .Values.initializer.noHelmHook) .Values.initializer.annotations }}
109
annotations:
10+
{{- if not .Values.initializer.noHelmHook }}
1111
"helm.sh/hook": "post-install, post-upgrade"
1212
"helm.sh/hook-delete-policy": "before-hook-creation"
13+
{{- end }}
14+
{{- with .Values.initializer.annotations }}
15+
{{- toYaml . | nindent 4 }}
16+
{{- end }}
17+
{{- end }}
18+
{{- if or (include "hyades.initializerLabels" . | trim) .Values.initializer.labels }}
19+
labels:
20+
{{- include "hyades.initializerLabels" . | nindent 4 }}
21+
{{- with .Values.initializer.labels }}
22+
{{- toYaml . | nindent 4 }}
23+
{{- end }}
1324
{{- end }}
1425
spec:
1526
template:
1627
metadata:
17-
labels: {{- include "hyades.initializerSelectorLabels" . | nindent 8 }}
18-
{{- with .Values.initializer.annotations }}
28+
{{- with .Values.initializer.podAnnotations }}
1929
annotations: {{- toYaml . | nindent 8 }}
2030
{{- end }}
31+
{{- if or (include "hyades.initializerSelectorLabels" . | trim) .Values.initializer.podLabels }}
32+
labels:
33+
{{- include "hyades.initializerSelectorLabels" . | nindent 8 }}
34+
{{- with .Values.initializer.podLabels }}
35+
{{- toYaml . | nindent 8 }}
36+
{{- end }}
37+
{{- end }}
2138
spec:
2239
restartPolicy: Never
2340
serviceAccountName: {{ include "hyades.serviceAccountName" . }}
@@ -79,4 +96,4 @@ spec:
7996
volumes:
8097
- name: tmp
8198
emptyDir: {}
82-
{{- end }}
99+
{{- end }}

charts/hyades/values.schema.json

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,18 @@
7676
}
7777
}
7878
},
79+
"labels": {
80+
"type": "object"
81+
},
7982
"annotations": {
8083
"type": "object"
8184
},
85+
"podLabels": {
86+
"type": "object"
87+
},
88+
"podAnnotations": {
89+
"type": "object"
90+
},
8291
"image": {
8392
"$ref": "#/$defs/image"
8493
},
@@ -106,9 +115,6 @@
106115
"extraEnvFrom": {
107116
"$ref": "#/$defs/objectArray"
108117
},
109-
"extraLabels": {
110-
"type": "object"
111-
},
112118
"extraContainers": {
113119
"$ref": "#/$defs/objectArray"
114120
},
@@ -164,9 +170,21 @@
164170
"enabled": {
165171
"type": "boolean"
166172
},
173+
"noHelmHook": {
174+
"type": "boolean"
175+
},
176+
"labels": {
177+
"type": "object"
178+
},
167179
"annotations": {
168180
"type": "object"
169181
},
182+
"podLabels": {
183+
"type": "object"
184+
},
185+
"podAnnotations": {
186+
"type": "object"
187+
},
170188
"image": {
171189
"$ref": "#/$defs/image"
172190
},
@@ -230,9 +248,18 @@
230248
}
231249
}
232250
},
251+
"labels": {
252+
"type": "object"
253+
},
233254
"annotations": {
234255
"type": "object"
235256
},
257+
"podLabels": {
258+
"type": "object"
259+
},
260+
"podAnnotations": {
261+
"type": "object"
262+
},
236263
"image": {
237264
"$ref": "#/$defs/image"
238265
},
@@ -260,9 +287,6 @@
260287
"extraEnvFrom": {
261288
"$ref": "#/$defs/objectArray"
262289
},
263-
"extraLabels": {
264-
"type": "object"
265-
},
266290
"extraContainers": {
267291
"$ref": "#/$defs/objectArray"
268292
},
@@ -467,4 +491,4 @@
467491
}
468492
}
469493
}
470-
}
494+
}

charts/hyades/values.yaml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,14 @@ apiServer:
3434
# -- The deployment strategy to use.
3535
strategy:
3636
type: RollingUpdate
37+
# -- Additional labels to add to the API-server Deployment resource.
38+
labels: {}
39+
# -- Additional annotations to add to the API-server Deployment resource.
3740
annotations: {}
41+
# -- Additional labels to add to the API-server pods.
42+
podLabels: {}
43+
# -- Additional annotations to add to the API-server pods.
44+
podAnnotations: {}
3845
image: &apiServerImage
3946
# -- Override common.image.registry for the API server.
4047
registry: ""
@@ -63,7 +70,6 @@ apiServer:
6370
type: RuntimeDefault
6471
extraEnv: []
6572
extraEnvFrom: []
66-
extraLabels: {}
6773
probes:
6874
startup:
6975
failureThreshold: 30
@@ -154,7 +160,14 @@ initializer:
154160
# and `helm upgrade` are executed with `--wait` flag. See <https://github.com/helm/helm/issues/10555>.
155161
# Note that without hooks, `helm upgrade` may fail due to Job fields being immutable.
156162
noHelmHook: false
163+
# -- Additional labels to add to the initializer Job resource.
164+
labels: {}
165+
# -- Additional annotations to add to the initializer Job resource.
157166
annotations: {}
167+
# -- Additional labels to add to the initializer pods.
168+
podLabels: {}
169+
# -- Additional annotations to add to the initializer pods.
170+
podAnnotations: {}
158171
image: *apiServerImage
159172
command: []
160173
args: []
@@ -197,7 +210,14 @@ frontend:
197210
# -- The deployment strategy to use.
198211
strategy:
199212
type: RollingUpdate
213+
# -- Additional labels to add to the frontend Deployment resource.
214+
labels: {}
215+
# -- Additional annotations to add to the frontend Deployment resource.
200216
annotations: {}
217+
# -- Additional labels to add to the frontend pods.
218+
podLabels: {}
219+
# -- Additional annotations to add to the frontend pods.
220+
podAnnotations: {}
201221
image:
202222
# -- Override common.image.registry for the API frontend.
203223
registry: ""
@@ -227,7 +247,6 @@ frontend:
227247
type: RuntimeDefault
228248
extraEnv: []
229249
extraEnvFrom: []
230-
extraLabels: {}
231250
probes:
232251
liveness:
233252
failureThreshold: 3

0 commit comments

Comments
 (0)