[CPS] Fix postgres init job dependency
[oom.git] / kubernetes / cps / components / cps-core / values.yaml
1 # Copyright (C) 2021 Pantheon.tech, Orange, Bell Canada.
2 # Modifications Copyright (C) 2022 Bell Canada
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 #       http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15
16 #################################################################
17 # Secrets.
18 #################################################################
19 secrets:
20   - uid: pg-root-pass
21     name: &pgRootPassSecretName '{{ include "common.release" . }}-cps-core-pg-root-pass'
22     type: password
23     externalSecret: '{{ ternary "" (tpl (default "" .Values.postgres.config.pgRootPasswordExternalSecret) .) (hasSuffix "cps-core-pg-root-pass" .Values.postgres.config.pgRootPasswordExternalSecret) }}'
24     password: '{{ .Values.postgres.config.pgRootpassword }}'
25     policy: generate
26   - uid: pg-user-creds
27     name: &pgUserCredsSecretName '{{ include "common.release" . }}-cps-core-pg-user-creds'
28     type: basicAuth
29     externalSecret: '{{ ternary "" (tpl (default "" .Values.postgres.config.pgUserExternalSecret) .) (hasSuffix "cps-core-pg-user-creds" .Values.postgres.config.pgUserExternalSecret) }}'
30     login: '{{ .Values.postgres.config.pgUserName }}'
31     password: '{{ .Values.postgres.config.pgUserPassword }}'
32     passwordPolicy: generate
33   - uid: app-user-creds
34     type: basicAuth
35     externalSecret: '{{ tpl (default "" .Values.config.appUserExternalSecret) . }}'
36     login: '{{ .Values.config.appUserName }}'
37     password: '{{ .Values.config.appUserPassword }}'
38     passwordPolicy: generate
39   - uid: dmi-plugin-user-creds
40     type: basicAuth
41     externalSecret: '{{ tpl (default "" .Values.config.dmiPluginUserExternalSecret) . }}'
42     login: '{{ .Values.config.dmiPluginUserName }}'
43     password: '{{ .Values.config.dmiPluginUserPassword }}'
44     passwordPolicy: generate
45
46 #################################################################
47 # Global configuration defaults.
48 #################################################################
49
50 # bitnami image doesn't support well single quote in password
51 passwordStrengthOverride: basic
52 global:
53   ingress:
54     virtualhost:
55       baseurl: "simpledemo.onap.org"
56   #Service Names of the postgres db to connect to.
57   #Override it to cps-postgres if localCluster is enabled.
58   postgres:
59     localCluster: false
60     service:
61       name: pgset
62       name2: tcp-pgset-primary
63       name3: tcp-pgset-replica
64     container:
65       name: postgres
66
67 image: onap/cps-and-ncmp:2.0.4
68 containerPort: &svc_port 8080
69 managementPort: &mgt_port 8081
70
71 service:
72   type: ClusterIP
73   name: cps-core
74   ports:
75     - name: &port http
76       port: *svc_port
77     - name: http-management
78       port: *mgt_port
79       targetPort: *mgt_port
80
81 prometheus:
82   enabled: false
83
84 metrics:
85   serviceMonitor:
86     port: http-management
87       ## specify target port if name is not given to the port in the service definition
88       ##
89     # targetPort: 8080
90     path: /manage/prometheus
91     interval: 60s
92     basicAuth:
93       enabled: false
94
95 pullPolicy: Always
96 # flag to enable debugging - application support required
97 debugEnabled: false
98 nodeSelector: {}
99 affinity: {}
100 # Resource Limit flavor -By Default using small
101 flavor: small
102 # default number of instances
103 replicaCount: 1
104 # Segregation for Different environment (Small and Large)
105 resources:
106   small:
107     limits:
108       cpu: 2
109       memory: 2Gi
110     requests:
111       cpu: 1
112       memory: 1Gi
113   large:
114     limits:
115       cpu: 4
116       memory: 4Gi
117     requests:
118       cpu: 2
119       memory: 2Gi
120   unlimited: {}
121 # probe configuration parameters
122 liveness:
123   initialDelaySeconds: 20
124   periodSeconds: 20
125   # necessary to disable liveness probe when setting breakpoints
126   # in debugger so K8s doesn't restart unresponsive container
127   enabled: true
128   path: /manage/health
129   port: *mgt_port
130
131 readiness:
132   initialDelaySeconds: 15
133   periodSeconds: 15
134   path: /manage/health
135   port: *mgt_port
136
137 ingress:
138   enabled: true
139   service:
140     - baseaddr: "cps-core"
141       path: "/"
142       name: "cps-core"
143       port: *svc_port
144
145 serviceAccount:
146   nameOverride: cps-core
147   roles:
148     - read
149
150 securityContext:
151   user_id: 100
152   group_id: 655533
153
154 #################################################################
155 # Application configuration defaults.
156 #################################################################
157
158 config:
159
160   # Set it for pre loading xnfdata, else set to null
161   liquibaseLabels: xnf-data-preload
162
163   # REST API basic authentication credentials (passsword is generated if not provided)
164   appUserName: cpsuser
165   spring:
166     profile: helm
167   #appUserPassword:
168   dmiPluginUserName: dmiuser
169 # Any new property can be added in the env by setting in overrides in the format mentioned below
170 # All the added properties must be in "key: value" format insead of yaml.
171 #  additional:
172 #    spring.config.max-size: 200
173 #    spring.config.min-size: 10
174
175   eventPublisher:
176     spring.kafka.bootstrap-servers: message-router-kafka:9092
177     spring.kafka.security.protocol: SASL_PLAINTEXT
178     spring.kafka.properties.sasl.mechanism: PLAIN
179     spring.kafka.properties.sasl.jaas.config: org.apache.kafka.common.security.plain.PlainLoginModule required username=admin password=admin_secret;
180     spring.kafka.producer.client-id: cps-core
181
182   additional:
183     notification.data-updated.enabled: true
184     notification.data-updated.topic: cps.data-updated-events
185     notification.data-updated.filters.enabled-dataspaces: ""
186     notification.async.enabled: false
187     notification.async.executor.core-pool-size: 2
188     notification.async.executor.max-pool-size: 1
189     notification.async.executor.queue-capacity: 500
190     notification.async.executor.wait-for-tasks-to-complete-on-shutdown: true
191     notification.async.executor.thread-name-prefix: Async-
192
193 logging:
194   level: INFO
195   path: /tmp
196
197 #################################################################
198 # Postgres overriding defaults in the postgres
199 #################################################################
200 postgres:
201   postgresInit: true
202   nameOverride: &postgresName cps-core-postgres
203   service:
204     name: *postgresName
205     name2: cps-core-pg-primary
206     name3: cps-core-pg-replica
207   container:
208     name:
209       primary: cps-core-pg-primary
210       replica: cps-core-pg-replica
211   persistence:
212     mountSubPath: cps-core/data
213     mountInitPath: cps-core
214   config:
215     pgUserName: cps
216     pgDatabase: cpsdb
217     pgUserExternalSecret: *pgUserCredsSecretName
218     pgRootPasswordExternalSecret: *pgRootPassSecretName
219
220 postgres-init:
221   nameOverride: cps-postgres-init
222   config:
223     pgUserName: cps
224     pgDatabase: cpsdb
225     pgDataPath: data
226     pgUserExternalSecret: *pgUserCredsSecretName
227
228     # pgPrimaryPassword: password
229     # pgUserPassword: password
230     # pgRootPassword: password
231
232 readinessCheck:
233   wait_for:
234     - '{{ ternary .Values.postgres.service.name "postgres" .Values.global.postgres.localCluster }}'
235
236 minReadySeconds: 10
237 updateStrategy:
238   type: RollingUpdate
239   maxUnavailable: 0
240   maxSurge: 1