summaryrefslogtreecommitdiffstats
path: root/kubernetes/cps/components
diff options
context:
space:
mode:
Diffstat (limited to 'kubernetes/cps/components')
-rw-r--r--kubernetes/cps/components/cps-core/requirements.yaml6
-rw-r--r--kubernetes/cps/components/cps-core/resources/config/application-helm.yml5
-rw-r--r--kubernetes/cps/components/cps-core/values.yaml24
3 files changed, 34 insertions, 1 deletions
diff --git a/kubernetes/cps/components/cps-core/requirements.yaml b/kubernetes/cps/components/cps-core/requirements.yaml
index d6b6712852..c42e72a232 100644
--- a/kubernetes/cps/components/cps-core/requirements.yaml
+++ b/kubernetes/cps/components/cps-core/requirements.yaml
@@ -19,6 +19,12 @@ dependencies:
- name: postgres
version: ~8.x-0
repository: '@local'
+ condition: global.postgres.localCluster
+ - name: postgres-init
+ version: ~8.x-0
+ repository: '@local'
+ condition: not global.postgres.localCluster
+ #condition: global.postgres.postgresInit
- name: readinessCheck
version: ~8.x-0
repository: '@local'
diff --git a/kubernetes/cps/components/cps-core/resources/config/application-helm.yml b/kubernetes/cps/components/cps-core/resources/config/application-helm.yml
index 0bc7d5bccb..8f904efeae 100644
--- a/kubernetes/cps/components/cps-core/resources/config/application-helm.yml
+++ b/kubernetes/cps/components/cps-core/resources/config/application-helm.yml
@@ -2,6 +2,7 @@
# Copyright (C) 2021 Pantheon.tech
# Modifications Copyright (C) 2020 Bell Canada.
# Modifications Copyright (C) 2021 Nordix Foundation.
+# Modifications Copyright (C) 2021 Orange
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -18,7 +19,11 @@
spring:
datasource:
+{{- if .Values.global.postgres.localCluster }}
url: jdbc:postgresql://{{ .Values.postgres.service.name2 }}:5432/{{ .Values.postgres.config.pgDatabase }}
+{{- else }}
+ url: jdbc:postgresql://{{ .Values.global.postgres.service.name2 }}:5432/{{ .Values.postgres.config.pgDatabase }}
+{{- end }}
username: ${DB_USERNAME}
password: ${DB_PASSWORD}
driverClassName: org.postgresql.Driver
diff --git a/kubernetes/cps/components/cps-core/values.yaml b/kubernetes/cps/components/cps-core/values.yaml
index 4f788e7977..55d9fcde66 100644
--- a/kubernetes/cps/components/cps-core/values.yaml
+++ b/kubernetes/cps/components/cps-core/values.yaml
@@ -52,6 +52,16 @@ global:
ingress:
virtualhost:
baseurl: "simpledemo.onap.org"
+ #Service Names of the postgres db to connect to.
+ #Override it to cps-postgres if localCluster is enabled.
+ postgres:
+ localCluster: false
+ service:
+ name: pgset
+ name2: tcp-pgset-primary
+ name3: tcp-pgset-replica
+ container:
+ name: postgres
image: onap/cps-and-ncmp:2.0.0
containerPort: &svc_port 8080
@@ -206,9 +216,21 @@ postgres:
pgUserExternalSecret: *pgUserCredsSecretName
pgRootPasswordExternalSecret: *pgRootPassSecretName
+postgres-init:
+ nameOverride: cps-postgres-init
+ config:
+ pgUserName: cps
+ pgDatabase: cpsdb
+ pgDataPath: data
+ pgUserExternalSecret: *pgUserCredsSecretName
+
+ # pgPrimaryPassword: password
+ # pgUserPassword: password
+ # pgRootPassword: password
+
readinessCheck:
wait_for:
- - *postgresName
+ - '{{ ternary .Values.postgres.service.name "postgres" .Values.global.postgres.localCluster }}'
minReadySeconds: 10
updateStrategy: