2 #============LICENSE_START========================================================
3 # ================================================================================
4 # Copyright (c) 2021 ZTE Intellectual Property. All rights reserved.
5 # ================================================================================
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 # ============LICENSE_END=========================================================
22 metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
24 {{- range $path, $bytes := .Files.Glob "resources/rules/*"}}
25 {{- $sum = $.Files.Get $path | sha256sum | print $sum }}
28 checksum/rules: {{ $sum | sha256sum }}
31 selector: {{- include "common.selectors" . | nindent 4 }}
33 metadata: {{- include "common.templateMetadata" . | nindent 6 }}
35 initContainers: {{- include "common.certInitializer.initContainer" . | nindent 6 }}
36 - name: {{ include "common.name" . }}-env-config
37 image: {{ include "repositoryGenerator.image.envsubst" . }}
38 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
43 - "cd /hrmconfig && for PFILE in `find . -type f -not -name '*.json'`; do envsubst < ${PFILE} > /config/${PFILE##*/}; done"
46 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-user-creds" "key" "login") | indent 10 }}
48 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-user-creds" "key" "password") | indent 10 }}
50 value: {{ .Values.config.pgConfig.dbName }}
52 value: {{ .Values.config.pgConfig.dbHost }}
54 value: "{{ .Values.config.pgConfig.dbPort }}"
56 - mountPath: /hrmconfig
57 name: {{ include "common.fullname" . }}-general-config
59 name: {{ include "common.fullname" . }}-env-config
61 - name: {{ include "common.name" . }}
62 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
63 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
64 ports: {{ include "common.containerPorts" . | nindent 8 }}
65 volumeMounts: {{- include "common.certInitializer.volumeMount" . | nindent 8 }}
66 - name: {{ include "common.fullname" . }}-env-config
67 mountPath: /opt/hrmconfig
68 - name: {{ include "common.fullname" . }}-rule-config
69 mountPath: /opt/hrmrules
70 # disable liveness probe when breakpoints set in debugger
71 # so K8s doesn't restart unresponsive container
72 {{- if eq .Values.liveness.enabled true }}
75 path: {{ .Values.liveness.path }}
76 port: {{ .Values.liveness.port }}
77 scheme: {{ .Values.liveness.scheme }}
78 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
79 periodSeconds: {{ .Values.liveness.periodSeconds }}
83 path: {{ .Values.readiness.path }}
84 port: {{ .Values.readiness.port }}
85 scheme: {{ .Values.readiness.scheme }}
86 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
87 periodSeconds: {{ .Values.readiness.periodSeconds }}
93 value: consul-server.{{ include "common.namespace" . }}
94 - name: CONFIG_BINDING_SERVICE
95 value: config-binding-service
102 fieldPath: status.podIP
104 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-user-creds" "key" "password") | indent 10 }}
105 - name: JDBC_USERNAME
106 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-user-creds" "key" "login") | indent 10 }}
107 - name: JDBC_PASSWORD
108 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-user-creds" "key" "password") | indent 10 }}
110 value: {{ .Values.config.pgConfig.dbName }}
112 value: {{ .Values.config.pgConfig.dbHost }}
114 value: "{{ .Values.config.pgConfig.dbPort }}"
115 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
116 volumes: {{ include "common.certInitializer.volumes" . | nindent 6 }}
117 - name: {{ include "common.fullname" . }}-general-config
120 name: {{ include "common.fullname" . }}-general-config
121 - name: {{ include "common.fullname" . }}-rule-config
124 name: {{ include "common.fullname" . }}-rule-config
125 - name: {{ include "common.fullname" . }}-env-config
129 - name: "{{ include "common.namespace" . }}-docker-registry-key"