@@ -982,13 +982,15 @@ spec:
982
982
{{- end }}
983
983
984
984
{{- range .Values.st2.packs.sensors }}
985
+ {{- $sensor := deepCopy $.st2sensorcontainer | mustMergeOverwrite . }}
986
+ {{- $name := print "st2sensorcontainer" (include "hyphenPrefix" $sensor.name) }}
985
987
---
986
988
apiVersion : apps/v1
987
989
kind : Deployment
988
990
metadata :
989
- name : {{ $.Release.Name }}-st2sensorcontainer {{ template "hyphenPrefix" . name }}
991
+ name : {{ $.Release.Name }}-{{ $ name }}
990
992
labels :
991
- app : st2sensorcontainer {{ template "hyphenPrefix" . name }}
993
+ app : {{ $ name }}
992
994
tier : backend
993
995
vendor : stackstorm
994
996
chart : {{ $.Chart.Name }}-{{ $.Chart.Version }}
@@ -997,7 +999,7 @@ metadata:
997
999
spec :
998
1000
selector :
999
1001
matchLabels :
1000
- app : st2sensorcontainer {{ template "hyphenPrefix" . name }}
1002
+ app : {{ $ name }}
1001
1003
release : {{ $.Release.Name }}
1002
1004
# https://docs.stackstorm.com/reference/ha.html#st2sensorcontainer
1003
1005
# 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:
1007
1009
template :
1008
1010
metadata :
1009
1011
labels :
1010
- app : st2sensorcontainer {{ template "hyphenPrefix" . name }}
1012
+ app : {{ $ name }}
1011
1013
tier : backend
1012
1014
vendor : stackstorm
1013
1015
chart : {{ $.Chart.Name }}-{{ $.Chart.Version }}
@@ -1020,8 +1022,8 @@ spec:
1020
1022
{{- if $.Values.st2sensorcontainer.postStartScript }}
1021
1023
checksum/post-start-script : {{ $.Values.st2sensorcontainer.postStartScript | sha256sum }}
1022
1024
{{- end }}
1023
- {{- if .annotations }}
1024
- {{- toYaml .annotations | nindent 8 }}
1025
+ {{- if $sensor .annotations }}
1026
+ {{- toYaml $sensor .annotations | nindent 8 }}
1025
1027
{{- end }}
1026
1028
spec :
1027
1029
imagePullSecrets :
@@ -1038,26 +1040,26 @@ spec:
1038
1040
{{- include "packs-initContainers" $ | nindent 6 }}
1039
1041
{{- end }}
1040
1042
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) $ }}'
1043
1045
imagePullPolicy : {{ $.Values.image.pullPolicy }}
1044
- {{- with .readinessProbe }}
1046
+ {{- with $sensor .readinessProbe }}
1045
1047
# Probe to check if app is running. Failure will lead to a pod restart.
1046
1048
readinessProbe :
1047
1049
{{- toYaml . | nindent 10 }}
1048
1050
{{- end }}
1049
- {{- with .livenessProbe }}
1051
+ {{- with $sensor .livenessProbe }}
1050
1052
livenessProbe :
1051
1053
{{- toYaml . | nindent 10 }}
1052
1054
{{- end }}
1053
- {{- if .ref }}
1055
+ {{- if $sensor .ref }}
1054
1056
command :
1055
1057
- /opt/stackstorm/st2/bin/st2sensorcontainer
1056
1058
- --config-file=/etc/st2/st2.conf
1057
1059
- --config-file=/etc/st2/st2.docker.conf
1058
1060
- --config-file=/etc/st2/st2.user.conf
1059
1061
- --single-sensor-mode
1060
- - --sensor-ref={{ .ref }}
1062
+ - --sensor-ref={{ $sensor .ref }}
1061
1063
{{- end }}
1062
1064
envFrom :
1063
1065
- configMapRef :
@@ -1087,8 +1089,8 @@ spec:
1087
1089
command : ["/bin/bash", "/post-start.sh"]
1088
1090
{{- end }}
1089
1091
resources :
1090
- {{- toYaml .resources | nindent 10 }}
1091
- {{- if .serviceAccount.attach }}
1092
+ {{- toYaml $sensor .resources | nindent 10 }}
1093
+ {{- if $sensor .serviceAccount.attach }}
1092
1094
serviceAccountName : {{ template "stackstorm-ha.serviceAccountName" $ }}
1093
1095
{{- end }}
1094
1096
volumes :
@@ -1115,13 +1117,13 @@ spec:
1115
1117
{{- with $.Values.dnsConfig }}
1116
1118
dnsConfig : {{- toYaml . | nindent 8 }}
1117
1119
{{- end }}
1118
- {{- with .nodeSelector }}
1120
+ {{- with $sensor .nodeSelector }}
1119
1121
nodeSelector : {{- toYaml . | nindent 8 }}
1120
1122
{{- end }}
1121
- {{- with .affinity }}
1123
+ {{- with $sensor .affinity }}
1122
1124
affinity : {{- toYaml . | nindent 8 }}
1123
1125
{{- end }}
1124
- {{- with .tolerations }}
1126
+ {{- with $sensor .tolerations }}
1125
1127
tolerations : {{- toYaml . | nindent 8 }}
1126
1128
{{- end }}
1127
1129
{{- end }}
0 commit comments