File tree 5 files changed +106
-1
lines changed
deployments/kubernetes-helm
5 files changed +106
-1
lines changed Original file line number Diff line number Diff line change @@ -48,3 +48,13 @@ app.kubernetes.io/name: {{ include "csp-collector.name" . }}
48
48
app.kubernetes.io/instance: { { .Release.Name } }
49
49
{ {- end -} }
50
50
51
+ { {/*
52
+ Create the name of the service account to use
53
+ */} }
54
+ { {- define " csp-collector.serviceAccountName" -} }
55
+ { {- if .Values.serviceAccount.create } }
56
+ { {- default (include " csp-collector.fullname" .) .Values.serviceAccount.name } }
57
+ { {- else } }
58
+ { {- default " default" .Values.serviceAccount.name } }
59
+ { {- end } }
60
+ { {- end } }
Original file line number Diff line number Diff line change @@ -6,20 +6,35 @@ metadata:
6
6
{{- include "csp-collector.labels" . | nindent 4 }}
7
7
checksum/config : {{ include (print $.Template.BasePath "/configMap.yaml") . | sha256sum | trunc 63 }}
8
8
spec :
9
+ {{- if not .Values.autoscaling.enabled }}
9
10
replicas : {{ .Values.replicaCount }}
11
+ {{- end }}
10
12
selector :
11
13
matchLabels :
12
14
{{- include "csp-collector.selectorLabels" . | nindent 6 }}
13
15
template :
14
16
metadata :
15
17
annotations :
18
+ {{- with .Values.podAnnotations }}
19
+ {{- toYaml . | nindent 8 }}
20
+ {{- end }}
16
21
checksum/config : {{ include (print $.Template.BasePath "/configMap.yaml") . | sha256sum | trunc 63 }}
17
22
labels :
18
23
{{- include "csp-collector.selectorLabels" . | nindent 8 }}
24
+ {{- with .Values.podLabels }}
25
+ {{- toYaml . | nindent 8 }}
26
+ {{- end }}
19
27
spec :
28
+ {{- with .Values.imagePullSecrets }}
29
+ imagePullSecrets :
30
+ {{- toYaml . | nindent 8 }}
31
+ {{- end }}
32
+ serviceAccountName : {{ include "csp-collector.serviceAccountName" . }}
20
33
containers :
21
34
- name : {{ .Chart.Name }}
22
- image : " {{ .Values.image.repository }}:{{ .Values.image.tag }}"
35
+ securityContext :
36
+ {{- toYaml .Values.containerSecurityContext | nindent 12 }}
37
+ image : " {{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
23
38
imagePullPolicy : {{ .Values.image.pullPolicy }}
24
39
volumeMounts :
25
40
- name : config-volume
Original file line number Diff line number Diff line change
1
+ {{- if .Values.autoscaling.enabled }}
2
+ apiVersion : autoscaling/v2
3
+ kind : HorizontalPodAutoscaler
4
+ metadata :
5
+ name : {{ include "csp-collector.fullname" . }}
6
+ labels :
7
+ {{- include "csp-collector.labels" . | nindent 4 }}
8
+ spec :
9
+ scaleTargetRef :
10
+ apiVersion : apps/v1
11
+ kind : Deployment
12
+ name : {{ include "csp-collector.fullname" . }}
13
+ minReplicas : {{ .Values.autoscaling.minReplicas }}
14
+ maxReplicas : {{ .Values.autoscaling.maxReplicas }}
15
+ metrics :
16
+ {{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
17
+ - type : Resource
18
+ resource :
19
+ name : cpu
20
+ target :
21
+ type : Utilization
22
+ averageUtilization : {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
23
+ {{- end }}
24
+ {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
25
+ - type : Resource
26
+ resource :
27
+ name : memory
28
+ target :
29
+ type : Utilization
30
+ averageUtilization : {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
31
+ {{- end }}
32
+ {{- end }}
Original file line number Diff line number Diff line change
1
+ {{- if .Values.serviceAccount.create -}}
2
+ apiVersion : v1
3
+ kind : ServiceAccount
4
+ metadata :
5
+ name : {{ include "csp-collector.serviceAccountName" . }}
6
+ labels :
7
+ {{- include "csp-collector.labels" . | nindent 4 }}
8
+ {{- with .Values.serviceAccount.annotations }}
9
+ annotations :
10
+ {{- toYaml . | nindent 4 }}
11
+ {{- end }}
12
+ automountServiceAccountToken : {{ .Values.serviceAccount.automount }}
13
+ {{- end }}
Original file line number Diff line number Diff line change 9
9
tag : latest
10
10
pullPolicy : Always
11
11
12
+ imagePullSecrets : []
13
+
12
14
service :
13
15
type : ClusterIP
14
16
port : 8080
@@ -36,6 +38,13 @@ ingress:
36
38
# hosts:
37
39
# - chart-example.local
38
40
41
+ autoscaling :
42
+ enabled : false
43
+ minReplicas : 1
44
+ maxReplicas : 100
45
+ targetCPUUtilizationPercentage : 80
46
+ # targetMemoryUtilizationPercentage: 80
47
+
39
48
resources : {}
40
49
# We usually recommend not to specify default resources and to leave this as a conscious
41
50
# choice for the user. This also increases chances charts run on environments with little
@@ -53,3 +62,29 @@ nodeSelector: {}
53
62
tolerations : []
54
63
55
64
affinity : {}
65
+
66
+ serviceAccount :
67
+ # Specifies whether a service account should be created
68
+ create : true
69
+ # Automatically mount a ServiceAccount's API credentials?
70
+ automount : true
71
+ # Annotations to add to the service account
72
+ annotations : {}
73
+ # The name of the service account to use.
74
+ # If not set and create is true, a name is generated using the fullname template
75
+ name : " "
76
+
77
+ podAnnotations : {}
78
+ podLabels : {}
79
+
80
+ containerSecurityContext : {}
81
+ # capabilities:
82
+ # drop:
83
+ # - ALL
84
+ # readOnlyRootFilesystem: true
85
+ # runAsNonRoot: true
86
+ # runAsUser: 1000
87
+
88
+
89
+ securityContext : {}
90
+ # fsGroup: 2000
You can’t perform that action at this time.
0 commit comments