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 }}
36 {{- if not .Values.global.postgres.localCluster }}
37 {{ include "common.readinessCheck.waitFor" . | indent 6 | trim }}
39 - name: {{ include "common.name" . }}-env-config
40 image: {{ include "repositoryGenerator.image.envsubst" . }}
41 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
46 - "cd /hrmconfig && for PFILE in `find . -type f -not -name '*.json'`; do envsubst < ${PFILE} > /config/${PFILE##*/}; done"
49 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-user-creds" "key" "login") | indent 10 }}
51 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-user-creds" "key" "password") | indent 10 }}
53 value: {{ .Values.config.pgConfig.dbName }}
55 value: {{ .Values.config.pgConfig.dbHost }}
57 value: "{{ .Values.config.pgConfig.dbPort }}"
59 - mountPath: /hrmconfig
60 name: {{ include "common.fullname" . }}-general-config
62 name: {{ include "common.fullname" . }}-env-config
64 - name: {{ include "common.name" . }}
65 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
66 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
67 ports: {{ include "common.containerPorts" . | nindent 8 }}
69 - name: {{ include "common.fullname" . }}-env-config
70 mountPath: /opt/hrmconfig
71 - name: {{ include "common.fullname" . }}-rule-config
72 mountPath: /opt/hrmrules
73 # disable liveness probe when breakpoints set in debugger
74 # so K8s doesn't restart unresponsive container
75 {{- if eq .Values.liveness.enabled true }}
78 path: {{ .Values.liveness.path }}
79 port: {{ .Values.liveness.port }}
80 scheme: {{ .Values.liveness.scheme }}
81 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
82 periodSeconds: {{ .Values.liveness.periodSeconds }}
86 path: {{ .Values.readiness.path }}
87 port: {{ .Values.readiness.port }}
88 scheme: {{ .Values.readiness.scheme }}
89 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
90 periodSeconds: {{ .Values.readiness.periodSeconds }}
96 value: consul-server.{{ include "common.namespace" . }}
97 - name: CONFIG_BINDING_SERVICE
98 value: config-binding-service
99 - name: MSB_IAG_SERVICE_PROTOCOL
100 value: {{ .Values.global.msbProtocol }}
101 - name: MSB_IAG_SERVICE_HOST
102 value: {{ .Values.global.msbServiceName }}.{{ include "common.namespace" . }}
103 - name: MSB_IAG_SERVICE_PORT
104 value: {{ .Values.global.msbPort | quote}}
109 fieldPath: status.podIP
111 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-user-creds" "key" "password") | indent 10 }}
112 - name: JDBC_USERNAME
113 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-user-creds" "key" "login") | indent 10 }}
114 - name: JDBC_PASSWORD
115 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-user-creds" "key" "password") | indent 10 }}
117 value: {{ .Values.config.pgConfig.dbName }}
119 value: {{ .Values.config.pgConfig.dbHost }}
121 value: "{{ .Values.config.pgConfig.dbPort }}"
122 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
124 - name: {{ include "common.fullname" . }}-general-config
127 name: {{ include "common.fullname" . }}-general-config
128 - name: {{ include "common.fullname" . }}-rule-config
131 name: {{ include "common.fullname" . }}-rule-config
132 - name: {{ include "common.fullname" . }}-env-config
136 - name: "{{ include "common.namespace" . }}-docker-registry-key"