Skip to content

Commit 6cfff77

Browse files
Merge pull request #372 from chanakya-svt/feat/add-labels-and-annotations-to-deployment-and-pods
added labels and annotations to deployment and pod
2 parents b0af546 + 75d9fb2 commit 6cfff77

File tree

4 files changed

+86
-0
lines changed

4 files changed

+86
-0
lines changed

deploy/charts/istio-csr/README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,34 @@ Example: maistra.io/member-of=istio-system
423423
Allows you to disable the default Kubernetes client rate limiter if istio-csr is exceeding the default QPS (5) and Burst (10) limits. For example in large clusters with many Istio workloads, restarting the Pods may cause istio-csr to send bursts Kubernetes API requests that exceed the limits of the default Kubernetes client rate limiter and istio-csr will become slow to issue certificates for your workloads. Only disable client rate limiting if the Kubernetes API server supports
424424
[API Priority and Fairness](https://kubernetes.io/docs/concepts/cluster-administration/flow-control/),
425425
to avoid overloading the server.
426+
#### **deploymentLabels** ~ `object`
427+
> Default value:
428+
> ```yaml
429+
> {}
430+
> ```
431+
432+
Optional extra labels for deployment.
433+
#### **deploymentAnnotations** ~ `object`
434+
> Default value:
435+
> ```yaml
436+
> {}
437+
> ```
438+
439+
Optional extra annotations for deployment.
440+
#### **podLabels** ~ `object`
441+
> Default value:
442+
> ```yaml
443+
> {}
444+
> ```
445+
446+
Optional extra labels for pod.
447+
#### **podAnnotations** ~ `object`
448+
> Default value:
449+
> ```yaml
450+
> {}
451+
> ```
452+
453+
Optional extra annotations for pod.
426454
#### **volumes** ~ `array`
427455
> Default value:
428456
> ```yaml

deploy/charts/istio-csr/templates/deployment.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ metadata:
55
namespace: {{ .Release.Namespace }}
66
labels:
77
{{- include "cert-manager-istio-csr.labels" . | nindent 4 }}
8+
{{- with .Values.deploymentLabels }}
9+
{{- toYaml . | nindent 4 }}
10+
{{- end }}
11+
{{- with .Values.deploymentAnnotations }}
12+
annotations:
13+
{{- toYaml . | nindent 4 }}
14+
{{- end }}
815
spec:
916
replicas: {{ .Values.replicaCount }}
1017
selector:
@@ -15,6 +22,13 @@ spec:
1522
labels:
1623
app: {{ include "cert-manager-istio-csr.name" . }}
1724
{{- include "cert-manager-istio-csr.labels" . | nindent 8 }}
25+
{{- with .Values.podLabels }}
26+
{{- toYaml . | nindent 8 }}
27+
{{- end }}
28+
{{- with .Values.podAnnotations }}
29+
annotations:
30+
{{- toYaml . | nindent 8 }}
31+
{{- end }}
1832
spec:
1933
{{- with .Values.imagePullSecrets }}
2034
imagePullSecrets:

deploy/charts/istio-csr/values.schema.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@
1212
"commonLabels": {
1313
"$ref": "#/$defs/helm-values.commonLabels"
1414
},
15+
"deploymentAnnotations": {
16+
"$ref": "#/$defs/helm-values.deploymentAnnotations"
17+
},
18+
"deploymentLabels": {
19+
"$ref": "#/$defs/helm-values.deploymentLabels"
20+
},
1521
"extraObjects": {
1622
"$ref": "#/$defs/helm-values.extraObjects"
1723
},
@@ -30,6 +36,12 @@
3036
"nodeSelector": {
3137
"$ref": "#/$defs/helm-values.nodeSelector"
3238
},
39+
"podAnnotations": {
40+
"$ref": "#/$defs/helm-values.podAnnotations"
41+
},
42+
"podLabels": {
43+
"$ref": "#/$defs/helm-values.podLabels"
44+
},
3345
"replicaCount": {
3446
"$ref": "#/$defs/helm-values.replicaCount"
3547
},
@@ -590,6 +602,16 @@
590602
"description": "Labels to apply to all resources",
591603
"type": "object"
592604
},
605+
"helm-values.deploymentAnnotations": {
606+
"default": {},
607+
"description": "Optional extra annotations for deployment.",
608+
"type": "object"
609+
},
610+
"helm-values.deploymentLabels": {
611+
"default": {},
612+
"description": "Optional extra labels for deployment.",
613+
"type": "object"
614+
},
593615
"helm-values.extraObjects": {
594616
"default": [],
595617
"description": "Create resources alongside installing istio-csr, via Helm values. Can accept an array of YAML-formatted resources. Each array entry can include multiple YAML documents, separated by '---'\n\nFor example:\nextraObjects:\n - |\n apiVersion: v1\n kind: ConfigMap\n metadata:\n name: '{{ template \"cert-manager-istio-csr.fullname\" . }}-extra-configmap'",
@@ -659,6 +681,16 @@
659681
"description": "Kubernetes node selector: node labels for pod assignment.",
660682
"type": "object"
661683
},
684+
"helm-values.podAnnotations": {
685+
"default": {},
686+
"description": "Optional extra annotations for pod.",
687+
"type": "object"
688+
},
689+
"helm-values.podLabels": {
690+
"default": {},
691+
"description": "Optional extra labels for pod.",
692+
"type": "object"
693+
},
662694
"helm-values.replicaCount": {
663695
"default": 1,
664696
"description": "Number of replicas of istio-csr to run.",

deploy/charts/istio-csr/values.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,18 @@ app:
251251
# to avoid overloading the server.
252252
disableKubernetesClientRateLimiter: false
253253

254+
# Optional extra labels for deployment.
255+
deploymentLabels: {}
256+
257+
# Optional extra annotations for deployment.
258+
deploymentAnnotations: {}
259+
260+
# Optional extra labels for pod.
261+
podLabels: {}
262+
263+
# Optional extra annotations for pod.
264+
podAnnotations: {}
265+
254266
# Optional extra volumes. Useful for mounting custom root CAs
255267
#
256268
# For example:

0 commit comments

Comments
 (0)