@@ -982,13 +982,15 @@ spec:
982982 {{- end }}
983983
984984{{- range .Values.st2.packs.sensors }}
985+ {{- $sensor := deepCopy $.Values.st2sensorcontainer | mustMergeOverwrite . }}
986+ {{- $name := print "st2sensorcontainer" (include "hyphenPrefix" $sensor.name) }}
985987---
986988apiVersion : apps/v1
987989kind : Deployment
988990metadata :
989- name : {{ $.Release.Name }}-st2sensorcontainer {{ template "hyphenPrefix" . name }}
991+ name : {{ $.Release.Name }}-{{ $ name }}
990992 labels :
991- app : st2sensorcontainer {{ template "hyphenPrefix" . name }}
993+ app : {{ $ name }}
992994 tier : backend
993995 vendor : stackstorm
994996 chart : {{ $.Chart.Name }}-{{ $.Chart.Version }}
@@ -997,7 +999,7 @@ metadata:
997999spec :
9981000 selector :
9991001 matchLabels :
1000- app : st2sensorcontainer {{ template "hyphenPrefix" . name }}
1002+ app : {{ $ name }}
10011003 release : {{ $.Release.Name }}
10021004 # https://docs.stackstorm.com/reference/ha.html#st2sensorcontainer
10031005 # It is possible to run st2sensorcontainer in HA mode by running one process on each compute instance. Each sensor node needs to be
@@ -1007,7 +1009,7 @@ spec:
10071009 template :
10081010 metadata :
10091011 labels :
1010- app : st2sensorcontainer {{ template "hyphenPrefix" . name }}
1012+ app : {{ $ name }}
10111013 tier : backend
10121014 vendor : stackstorm
10131015 chart : {{ $.Chart.Name }}-{{ $.Chart.Version }}
@@ -1020,8 +1022,8 @@ spec:
10201022 {{- if $.Values.st2sensorcontainer.postStartScript }}
10211023 checksum/post-start-script : {{ $.Values.st2sensorcontainer.postStartScript | sha256sum }}
10221024 {{- end }}
1023- {{- if .annotations }}
1024- {{- toYaml .annotations | nindent 8 }}
1025+ {{- if $sensor .annotations }}
1026+ {{- toYaml $sensor .annotations | nindent 8 }}
10251027 {{- end }}
10261028 spec :
10271029 imagePullSecrets :
@@ -1038,26 +1040,26 @@ spec:
10381040 {{- include "packs-initContainers" $ | nindent 6 }}
10391041 {{- end }}
10401042 containers :
1041- - name : st2sensorcontainer {{ template "hyphenPrefix" . name }}
1042- image : ' {{ template "imageRepository" $ }}/st2sensorcontainer:{{ tpl (.image.tag | default $.Values.image.tag) $ }}'
1043+ - name : {{ $ name }}
1044+ image : ' {{ template "imageRepository" $ }}/st2sensorcontainer:{{ tpl ($sensor .image.tag | default $.Values.image.tag) $ }}'
10431045 imagePullPolicy : {{ $.Values.image.pullPolicy }}
1044- {{- with .readinessProbe }}
1046+ {{- with $sensor .readinessProbe }}
10451047 # Probe to check if app is running. Failure will lead to a pod restart.
10461048 readinessProbe :
10471049 {{- toYaml . | nindent 10 }}
10481050 {{- end }}
1049- {{- with .livenessProbe }}
1051+ {{- with $sensor .livenessProbe }}
10501052 livenessProbe :
10511053 {{- toYaml . | nindent 10 }}
10521054 {{- end }}
1053- {{- if .ref }}
1055+ {{- if $sensor .ref }}
10541056 command :
10551057 - /opt/stackstorm/st2/bin/st2sensorcontainer
10561058 - --config-file=/etc/st2/st2.conf
10571059 - --config-file=/etc/st2/st2.docker.conf
10581060 - --config-file=/etc/st2/st2.user.conf
10591061 - --single-sensor-mode
1060- - --sensor-ref={{ .ref }}
1062+ - --sensor-ref={{ $sensor .ref }}
10611063 {{- end }}
10621064 envFrom :
10631065 - configMapRef :
@@ -1087,8 +1089,8 @@ spec:
10871089 command : ["/bin/bash", "/post-start.sh"]
10881090 {{- end }}
10891091 resources :
1090- {{- toYaml .resources | nindent 10 }}
1091- {{- if .serviceAccount.attach }}
1092+ {{- toYaml $sensor .resources | nindent 10 }}
1093+ {{- if $sensor .serviceAccount.attach }}
10921094 serviceAccountName : {{ template "stackstorm-ha.serviceAccountName" $ }}
10931095 {{- end }}
10941096 volumes :
@@ -1115,13 +1117,13 @@ spec:
11151117 {{- with $.Values.dnsConfig }}
11161118 dnsConfig : {{- toYaml . | nindent 8 }}
11171119 {{- end }}
1118- {{- with .nodeSelector }}
1120+ {{- with $sensor .nodeSelector }}
11191121 nodeSelector : {{- toYaml . | nindent 8 }}
11201122 {{- end }}
1121- {{- with .affinity }}
1123+ {{- with $sensor .affinity }}
11221124 affinity : {{- toYaml . | nindent 8 }}
11231125 {{- end }}
1124- {{- with .tolerations }}
1126+ {{- with $sensor .tolerations }}
11251127 tolerations : {{- toYaml . | nindent 8 }}
11261128 {{- end }}
11271129{{- end }}
0 commit comments