From b35e2deb1580a13a435b039fdf8f8381a9873d36 Mon Sep 17 00:00:00 2001 From: "puthuparambil.aditya" Date: Fri, 23 Jul 2021 13:57:22 +0100 Subject: [CPS] Refactor CPS charts to include sub charts for other cps components Cps-core sub chart added in CPS. Issue-ID: CPS-513 Signed-off-by: puthuparambil.aditya Change-Id: Ifb049f33864b0608ce8d938158f33bd3c01f87f4 --- kubernetes/cps/.helmignore | 2 +- kubernetes/cps/Chart.yaml | 4 +- kubernetes/cps/Makefile | 54 +++++++ kubernetes/cps/README.md | 2 +- kubernetes/cps/components/Makefile | 67 ++++++++ kubernetes/cps/components/cps-core/.helmignore | 22 +++ kubernetes/cps/components/cps-core/Chart.yaml | 18 +++ .../cps/components/cps-core/requirements.yaml | 30 ++++ .../cps-core/resources/config/application-helm.yml | 87 +++++++++++ .../cps-core/resources/config/logback.xml | 36 +++++ .../cps/components/cps-core/templates/NOTES.txt | 35 +++++ .../components/cps-core/templates/configmap.yaml | 20 +++ .../components/cps-core/templates/deployment.yaml | 106 +++++++++++++ .../cps/components/cps-core/templates/ingress.yaml | 17 +++ .../cps/components/cps-core/templates/secrets.yaml | 17 +++ .../cps/components/cps-core/templates/service.yaml | 17 +++ kubernetes/cps/components/cps-core/values.yaml | 168 +++++++++++++++++++++ kubernetes/cps/requirements.yaml | 14 +- .../cps/resources/config/application-helm.yml | 87 ----------- kubernetes/cps/resources/config/logback.xml | 34 ----- kubernetes/cps/templates/NOTES.txt | 35 ----- kubernetes/cps/templates/configmap.yaml | 20 --- kubernetes/cps/templates/deployment.yaml | 106 ------------- kubernetes/cps/templates/ingress.yaml | 17 --- kubernetes/cps/templates/secrets.yaml | 17 --- kubernetes/cps/templates/service.yaml | 17 --- kubernetes/cps/values.yaml | 148 +----------------- 27 files changed, 705 insertions(+), 492 deletions(-) create mode 100644 kubernetes/cps/Makefile create mode 100644 kubernetes/cps/components/Makefile create mode 100644 kubernetes/cps/components/cps-core/.helmignore create mode 100644 kubernetes/cps/components/cps-core/Chart.yaml create mode 100644 kubernetes/cps/components/cps-core/requirements.yaml create mode 100644 kubernetes/cps/components/cps-core/resources/config/application-helm.yml create mode 100644 kubernetes/cps/components/cps-core/resources/config/logback.xml create mode 100644 kubernetes/cps/components/cps-core/templates/NOTES.txt create mode 100644 kubernetes/cps/components/cps-core/templates/configmap.yaml create mode 100644 kubernetes/cps/components/cps-core/templates/deployment.yaml create mode 100644 kubernetes/cps/components/cps-core/templates/ingress.yaml create mode 100644 kubernetes/cps/components/cps-core/templates/secrets.yaml create mode 100644 kubernetes/cps/components/cps-core/templates/service.yaml create mode 100644 kubernetes/cps/components/cps-core/values.yaml delete mode 100755 kubernetes/cps/resources/config/application-helm.yml delete mode 100644 kubernetes/cps/resources/config/logback.xml delete mode 100644 kubernetes/cps/templates/NOTES.txt delete mode 100644 kubernetes/cps/templates/configmap.yaml delete mode 100755 kubernetes/cps/templates/deployment.yaml delete mode 100644 kubernetes/cps/templates/ingress.yaml delete mode 100644 kubernetes/cps/templates/secrets.yaml delete mode 100644 kubernetes/cps/templates/service.yaml diff --git a/kubernetes/cps/.helmignore b/kubernetes/cps/.helmignore index 80b47d2723..7ddbad7ef4 100644 --- a/kubernetes/cps/.helmignore +++ b/kubernetes/cps/.helmignore @@ -19,4 +19,4 @@ .project .idea/ *.tmproj -components/ \ No newline at end of file +components/ diff --git a/kubernetes/cps/Chart.yaml b/kubernetes/cps/Chart.yaml index 325f26dc38..0837c72dd9 100644 --- a/kubernetes/cps/Chart.yaml +++ b/kubernetes/cps/Chart.yaml @@ -1,4 +1,4 @@ -# Copyright (C) 2021 Pantheon.tech +# Copyright (C) 2021 Bell Canada # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,6 +13,6 @@ # limitations under the License. apiVersion: v1 -description: Configuration Persistance Service (CPS) +description: ONAP Configuration Persistance Service (CPS) name: cps version: 8.0.0 diff --git a/kubernetes/cps/Makefile b/kubernetes/cps/Makefile new file mode 100644 index 0000000000..70bb031af3 --- /dev/null +++ b/kubernetes/cps/Makefile @@ -0,0 +1,54 @@ +# Copyright © 2020 Samsung Electronics +# Copyright (c) 2021 AT&T. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) +OUTPUT_DIR := $(ROOT_DIR)/../dist +PACKAGE_DIR := $(OUTPUT_DIR)/packages +SECRET_DIR := $(OUTPUT_DIR)/secrets + +HELM_REPO := local + +EXCLUDES := +HELM_BIN := helm +HELM_CHARTS := $(filter-out $(EXCLUDES), $(sort $(patsubst %/.,%,$(wildcard */.)))) + +.PHONY: $(EXCLUDES) $(HELM_CHARTS) + +all: $(HELM_CHARTS) + +$(HELM_CHARTS): + @echo "\n[$@]" + @make package-$@ + +make-%: + @if [ -f $*/Makefile ]; then make -C $*; fi + +dep-%: make-% + @if [ -f $*/requirements.yaml ]; then $(HELM_BIN) dep up $*; fi + +lint-%: dep-% + @if [ -f $*/Chart.yaml ]; then $(HELM_BIN) lint $*; fi + +package-%: lint-% + @mkdir -p $(PACKAGE_DIR) + @if [ -f $*/Chart.yaml ]; then PACKAGE_NAME=$$($(HELM_BIN) package -d $(PACKAGE_DIR) $* | cut -d":" -f2) && $(HELM_BIN) push -f $$PACKAGE_NAME $(HELM_REPO); fi + @sleep 3 + +clean: + @rm -f */requirements.lock + @rm -f *tgz */charts/*tgz + @rm -rf $(PACKAGE_DIR) +%: + @: diff --git a/kubernetes/cps/README.md b/kubernetes/cps/README.md index 4b578c41c2..876da2ca57 100644 --- a/kubernetes/cps/README.md +++ b/kubernetes/cps/README.md @@ -19,4 +19,4 @@ ONAP Configuration Persistence Service (CPS) includes the following Kubernetes services: -1) Cps and xNF - Configuration Persistence Service together with Nf Configuration Persistence Service \ No newline at end of file +1) cps-core - Configuration Persistence Service together with Nf Configuration Persistence Service \ No newline at end of file diff --git a/kubernetes/cps/components/Makefile b/kubernetes/cps/components/Makefile new file mode 100644 index 0000000000..db8704c2ca --- /dev/null +++ b/kubernetes/cps/components/Makefile @@ -0,0 +1,67 @@ +# Copyright © 2020 Samsung Electronics +# Copyright (c) 2021 AT&T. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) +OUTPUT_DIR := $(ROOT_DIR)/../../dist +PACKAGE_DIR := $(OUTPUT_DIR)/packages +SECRET_DIR := $(OUTPUT_DIR)/secrets + +HELM_REPO := local + +EXCLUDES := +HELM_BIN := helm +# Helm v2 and helm v3 uses different version format so we first try in helm v3 format +# and if it fails then we fallback to helm v2 one +HELM_VER := $(shell $(HELM_BIN) version --template "{{.Version}}" 2>/dev/null) +ifneq "$(findstring v3,$(HELM_VER))" "v3" + HELM_VER := $(shell $(HELM_BIN) version -c --template "{{.Client.SemVer}}") +endif + +HELM_CHARTS := $(filter-out $(EXCLUDES), $(sort $(patsubst %/.,%,$(wildcard */.)))) + +.PHONY: $(EXCLUDES) $(HELM_CHARTS) + +all: $(HELM_CHARTS) helm-repo-update + +$(HELM_CHARTS): + @echo "\n[$@]" + @make package-$@ + +make-%: + @if [ -f $*/Makefile ]; then make -C $*; fi + +dep-%: make-% + @if [ -f $*/requirements.yaml ]; then $(HELM_BIN) dep up $*; fi + +lint-%: dep-% + @if [ -f $*/Chart.yaml ]; then $(HELM_BIN) lint $*; fi + +package-%: lint-% + @mkdir -p $(PACKAGE_DIR) + @if [ -f $*/Chart.yaml ]; then PACKAGE_NAME=$$($(HELM_BIN) package -d $(PACKAGE_DIR) $* | cut -d":" -f2) && $(HELM_BIN) push -f $$PACKAGE_NAME $(HELM_REPO); fi + @sleep 3 + +clean: + @rm -f */requirements.lock + @rm -f *tgz */charts/*tgz + @rm -rf $(PACKAGE_DIR) + +helm-repo-update: +ifeq "$(findstring v3,$(HELM_VER))" "v3" + @$(HELM_BIN) repo update +endif + +%: + @: diff --git a/kubernetes/cps/components/cps-core/.helmignore b/kubernetes/cps/components/cps-core/.helmignore new file mode 100644 index 0000000000..80b47d2723 --- /dev/null +++ b/kubernetes/cps/components/cps-core/.helmignore @@ -0,0 +1,22 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*~ +# Various IDEs +.project +.idea/ +*.tmproj +components/ \ No newline at end of file diff --git a/kubernetes/cps/components/cps-core/Chart.yaml b/kubernetes/cps/components/cps-core/Chart.yaml new file mode 100644 index 0000000000..710032896e --- /dev/null +++ b/kubernetes/cps/components/cps-core/Chart.yaml @@ -0,0 +1,18 @@ +# Copyright (C) Pantheon.tech, Orange +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: v1 +description: ONAP Configuration Persistance Service (CPS) - Core +name: cps-core +version: 8.0.0 diff --git a/kubernetes/cps/components/cps-core/requirements.yaml b/kubernetes/cps/components/cps-core/requirements.yaml new file mode 100644 index 0000000000..d6b6712852 --- /dev/null +++ b/kubernetes/cps/components/cps-core/requirements.yaml @@ -0,0 +1,30 @@ +# Copyright (C) 2021 Pantheon.tech, Orange +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +dependencies: + - name: common + version: ~8.x-0 + repository: '@local' + - name: postgres + version: ~8.x-0 + repository: '@local' + - name: readinessCheck + version: ~8.x-0 + repository: '@local' + - name: repositoryGenerator + version: ~8.x-0 + repository: '@local' + - name: serviceAccount + 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 new file mode 100644 index 0000000000..f181b82fec --- /dev/null +++ b/kubernetes/cps/components/cps-core/resources/config/application-helm.yml @@ -0,0 +1,87 @@ +{{/* +# Copyright (C) 2021 Pantheon.tech +# Modifications Copyright (C) 2020 Bell Canada. +# Modifications Copyright (C) 2021 Nordix Foundation. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +*/}} + +server: + port: 8080 + +rest: + api: + cps-base-path: /cps/api + xnf-base-path: /cps-nf-proxy/api + +spring: + main: + banner-mode: "off" + jpa: + ddl-auto: create + open-in-view: false + properties: + hibernate: + enable_lazy_load_no_trans: true + dialect: org.hibernate.dialect.PostgreSQLDialect + + datasource: + url: jdbc:postgresql://{{ .Values.postgres.service.name2 }}:5432/{{ .Values.postgres.config.pgDatabase }} + username: ${DB_USERNAME} + password: ${DB_PASSWORD} + driverClassName: org.postgresql.Driver + initialization-mode: always + + cache: + type: caffeine + cache-names: yangSchema + caffeine: + spec: maximumSize=10000,expireAfterAccess=10m + + liquibase: + change-log: classpath:changelog/changelog-master.yaml + labels: {{ .Values.config.liquibaseLabels }} + +security: + # comma-separated uri patterns which do not require authorization + permit-uri: /manage/health/**,/manage/info,/swagger-ui/**,/swagger-resources/**,/v3/api-docs + auth: + username: ${CPS_USERNAME} + password: ${CPS_PASSWORD} + +# Actuator +management: + endpoints: + web: + base-path: /manage + exposure: + include: info,health,loggers + endpoint: + health: + show-details: always + # kubernetes probes: liveness and readiness + probes: + enabled: true + loggers: + enabled: true + +logging: + level: + org: + springframework: {{ .Values.logging.level }} + +{{- if .Values.config.additional }} +{{ toYaml .Values.config.additional | nindent 2 }} +{{- end }} + +# Last empty line is required otherwise the last property will be missing from application.yml file in the pod. diff --git a/kubernetes/cps/components/cps-core/resources/config/logback.xml b/kubernetes/cps/components/cps-core/resources/config/logback.xml new file mode 100644 index 0000000000..8256cfa18d --- /dev/null +++ b/kubernetes/cps/components/cps-core/resources/config/logback.xml @@ -0,0 +1,36 @@ + + + + + + + %d - %highlight(%-5level) [%-20.20thread] %cyan(%logger{36}) - %msg%n + + + + + + + + + + + + diff --git a/kubernetes/cps/components/cps-core/templates/NOTES.txt b/kubernetes/cps/components/cps-core/templates/NOTES.txt new file mode 100644 index 0000000000..09d22dfa7c --- /dev/null +++ b/kubernetes/cps/components/cps-core/templates/NOTES.txt @@ -0,0 +1,35 @@ +# Copyright © 2018 Amdocs, Bell Canada +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range .Values.ingress.hosts }} + http://{{ . }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ include "common.namespace" . }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "common.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ include "common.namespace" . }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get svc -w {{ include "common.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ include "common.namespace" . }} {{ include "common.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') + export SERVICE_PORT=$(kubectl get svc --namespace {{ include "common.namespace" . }} {{ include "common.fullname" . }} -o jsonpath='{.spec.ports[0].port}') + echo http://$SERVICE_IP:$SERVICE_PORT +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ include "common.namespace" . }} -l "app={{ template "common.name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + export POD_PORT=$(kubectl get pods --namespace {{ include "common.namespace" . }} -l "app={{ template "common.name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].spec.containers[0].ports[0].containerPort}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl port-forward $POD_NAME 8080:$POD_PORT +{{- end }} diff --git a/kubernetes/cps/components/cps-core/templates/configmap.yaml b/kubernetes/cps/components/cps-core/templates/configmap.yaml new file mode 100644 index 0000000000..eeb057cbd8 --- /dev/null +++ b/kubernetes/cps/components/cps-core/templates/configmap.yaml @@ -0,0 +1,20 @@ +{{/* +# Copyright (C) 2021 Pantheon.tech +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +*/}} + +apiVersion: v1 +kind: ConfigMap +metadata: {{- include "common.resourceMetadata" . | nindent 2 }} +data: {{ tpl (.Files.Glob "resources/config/*").AsConfig . | nindent 2 }} diff --git a/kubernetes/cps/components/cps-core/templates/deployment.yaml b/kubernetes/cps/components/cps-core/templates/deployment.yaml new file mode 100644 index 0000000000..2047a39497 --- /dev/null +++ b/kubernetes/cps/components/cps-core/templates/deployment.yaml @@ -0,0 +1,106 @@ +{{/* +# Copyright (C) 2021 Pantheon.tech, Orange +# Modifications Copyright (C) 2021 Bell Canada. +# Modifications Copyright (C) 2021 Nordix Foundation. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +*/}} + +apiVersion: apps/v1 +kind: Deployment +metadata: {{- include "common.resourceMetadata" . | nindent 2 }} +spec: + replicas: {{ .Values.replicaCount }} + selector: {{- include "common.selectors" . | nindent 4 }} + template: + metadata: {{- include "common.templateMetadata" . | nindent 6 }} + spec: + {{ include "common.podSecurityContext" . | indent 6 | trim}} + serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . ) }} + initContainers: {{ include "common.readinessCheck.waitFor" . | nindent 6 }} + - name: {{ include "common.name" . }}-update-config + image: {{ include "repositoryGenerator.image.envsubst" . }} + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + command: + - sh + args: + - -c + - "cd /config-input && for PFILE in `find . -not -type d | grep -v -F ..`; do envsubst <${PFILE} >/config/${PFILE}; done" + env: + - name: DB_USERNAME + {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-user-creds" "key" "login") | indent 12 }} + - name: DB_PASSWORD + {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-user-creds" "key" "password") | indent 12 }} + - name: LIQUIBASE_LABELS + value: {{ .Values.config.liquibaseLabels }} + - name: CPS_USERNAME + {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "app-user-creds" "key" "login") | indent 12 }} + - name: CPS_PASSWORD + {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "app-user-creds" "key" "password") | indent 12 }} + volumeMounts: + - mountPath: /config-input + name: init-data-input + - mountPath: /config + name: init-data + containers: + - name: {{ include "common.name" . }} + image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + ports: {{ include "common.containerPorts" . | nindent 10 }} + {{ include "common.containerSecurityContext" . | indent 8 | trim }} + # disable liveness probe when breakpoints set in debugger + # so K8s doesn't restart unresponsive container + {{- if eq .Values.liveness.enabled true }} + livenessProbe: + httpGet: + port: {{ .Values.liveness.port }} + path: {{ .Values.liveness.path }} + initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} + periodSeconds: {{ .Values.liveness.periodSeconds }} + {{ end -}} + readinessProbe: + httpGet: + port: {{ .Values.readiness.port }} + path: {{ .Values.readiness.path }} + initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} + periodSeconds: {{ .Values.readiness.periodSeconds }} + env: + - name: SPRING_PROFILES_ACTIVE + value: {{ .Values.config.spring.profile }} + resources: {{ include "common.resources" . | nindent 10 }} + {{- if .Values.nodeSelector }} + nodeSelector: {{ toYaml .Values.nodeSelector | nindent 12 }} + {{- end }} + {{- if .Values.affinity }} + affinity: {{ toYaml .Values.affinity | nindent 12 }} + {{- end }} + volumeMounts: + - mountPath: /app/resources/application-helm.yml + subPath: application-helm.yml + name: init-data + - mountPath: /app/resources/logback.xml + subPath: logback.xml + name: init-data + - mountPath: /tmp + name: init-temp + volumes: + - name: init-data-input + configMap: + name: {{ include "common.fullname" . }} + - name: init-data + emptyDir: + medium: Memory + - name: init-temp + emptyDir: {} + imagePullSecrets: + - name: "{{ include "common.namespace" . }}-docker-registry-key" diff --git a/kubernetes/cps/components/cps-core/templates/ingress.yaml b/kubernetes/cps/components/cps-core/templates/ingress.yaml new file mode 100644 index 0000000000..16f9440aba --- /dev/null +++ b/kubernetes/cps/components/cps-core/templates/ingress.yaml @@ -0,0 +1,17 @@ +{{/* +# Copyright (C) 2021 Pantheon.tech +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +*/}} + +{{ include "common.ingress" . }} diff --git a/kubernetes/cps/components/cps-core/templates/secrets.yaml b/kubernetes/cps/components/cps-core/templates/secrets.yaml new file mode 100644 index 0000000000..f25044d339 --- /dev/null +++ b/kubernetes/cps/components/cps-core/templates/secrets.yaml @@ -0,0 +1,17 @@ +{{/* +# Copyright (C) 2021 Pantheon.tech +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +*/}} + +{{ include "common.secretFast" . }} diff --git a/kubernetes/cps/components/cps-core/templates/service.yaml b/kubernetes/cps/components/cps-core/templates/service.yaml new file mode 100644 index 0000000000..97657bfc0b --- /dev/null +++ b/kubernetes/cps/components/cps-core/templates/service.yaml @@ -0,0 +1,17 @@ +{{/* +# Copyright (C) 2021 Pantheon.tech, Orange +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +*/}} + +{{ include "common.service" . }} diff --git a/kubernetes/cps/components/cps-core/values.yaml b/kubernetes/cps/components/cps-core/values.yaml new file mode 100644 index 0000000000..ae8bccd2a8 --- /dev/null +++ b/kubernetes/cps/components/cps-core/values.yaml @@ -0,0 +1,168 @@ +# Copyright (C) 2021 Pantheon.tech, Orange, Bell Canada. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +################################################################# +# Secrets. +################################################################# +secrets: + - uid: pg-root-pass + name: &pgRootPassSecretName '{{ include "common.release" . }}-cps-pg-root-pass' + type: password + externalSecret: '{{ ternary "" (tpl (default "" .Values.postgres.config.pgRootPasswordExternalSecret) .) (hasSuffix "cps-pg-root-pass" .Values.postgres.config.pgRootPasswordExternalSecret) }}' + password: '{{ .Values.postgres.config.pgRootpassword }}' + policy: generate + - uid: pg-user-creds + name: &pgUserCredsSecretName '{{ include "common.release" . }}-cps-pg-user-creds' + type: basicAuth + externalSecret: '{{ ternary "" (tpl (default "" .Values.postgres.config.pgUserExternalSecret) .) (hasSuffix "cps-pg-user-creds" .Values.postgres.config.pgUserExternalSecret) }}' + login: '{{ .Values.postgres.config.pgUserName }}' + password: '{{ .Values.postgres.config.pgUserPassword }}' + passwordPolicy: generate + - uid: app-user-creds + type: basicAuth + externalSecret: '{{ tpl (default "" .Values.config.appUserExternalSecret) . }}' + login: '{{ .Values.config.appUserName }}' + password: '{{ .Values.config.appUserPassword }}' + passwordPolicy: generate + +################################################################# +# Global configuration defaults. +################################################################# + +# bitnami image doesn't support well single quote in password +passwordStrengthOverride: basic +global: + ingress: + virtualhost: + baseurl: "simpledemo.onap.org" + +image: onap/cps-and-nf-proxy:1.0.1 +containerPort: &svc_port 8080 + +service: + type: ClusterIP + name: cps-core + ports: + - name: &port http + port: *svc_port + +pullPolicy: Always +# flag to enable debugging - application support required +debugEnabled: false +nodeSelector: {} +affinity: {} +# Resource Limit flavor -By Default using small +flavor: small +# default number of instances +replicaCount: 1 +# Segregation for Different environment (Small and Large) +resources: + small: + limits: + cpu: 2 + memory: 2Gi + requests: + cpu: 1 + memory: 1Gi + large: + limits: + cpu: 4 + memory: 4Gi + requests: + cpu: 2 + memory: 2Gi + unlimited: {} +# probe configuration parameters +liveness: + initialDelaySeconds: 20 + periodSeconds: 20 + # necessary to disable liveness probe when setting breakpoints + # in debugger so K8s doesn't restart unresponsive container + enabled: true + path: /manage/health + port: *port + +readiness: + initialDelaySeconds: 15 + periodSeconds: 15 + path: /manage/health + port: *port + +ingress: + enabled: true + service: + - baseaddr: "cps-core" + path: "/" + name: "cps-core" + port: *svc_port + +serviceAccount: + nameOverride: cps-core + roles: + - read + +securityContext: + user_id: 100 + group_id: 655533 + +################################################################# +# Application configuration defaults. +################################################################# + +config: + + # Set it for pre loading xnfdata, else set to null + liquibaseLabels: xnf-data-preload + + # REST API basic authentication credentials (passsword is generated if not provided) + appUserName: cpsuser + spring: + profile: helm + #appUserPassword: + +# Any new property can be added in the env by setting in overrides in the format mentioned below +# All the added properties must be in "key: value" format insead of yaml. +# additional: +# spring.config.max-size: 200 +# spring.config.min-size: 10 + +logging: + level: INFO + path: /tmp + +################################################################# +# Postgres overriding defaults in the postgres +################################################################# +postgres: + nameOverride: &postgresName cps-postgres + service: + name: *postgresName + name2: cps-pg-primary + name3: cps-pg-replica + container: + name: + primary: cps-pg-primary + replica: cps-pg-replica + persistence: + mountSubPath: cps/data + mountInitPath: cps + config: + pgUserName: cps + pgDatabase: cpsdb + pgUserExternalSecret: *pgUserCredsSecretName + pgRootPasswordExternalSecret: *pgRootPassSecretName + +readinessCheck: + wait_for: + - cps-postgres diff --git a/kubernetes/cps/requirements.yaml b/kubernetes/cps/requirements.yaml index d6b6712852..9d044dcd13 100644 --- a/kubernetes/cps/requirements.yaml +++ b/kubernetes/cps/requirements.yaml @@ -1,4 +1,4 @@ -# Copyright (C) 2021 Pantheon.tech, Orange +# Copyright (C) 2021 Bell Canada. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -16,15 +16,7 @@ dependencies: - name: common version: ~8.x-0 repository: '@local' - - name: postgres - version: ~8.x-0 - repository: '@local' - - name: readinessCheck - version: ~8.x-0 - repository: '@local' - - name: repositoryGenerator - version: ~8.x-0 - repository: '@local' - - name: serviceAccount + - name: cps-core version: ~8.x-0 repository: '@local' + condition: cps-core.enabled \ No newline at end of file diff --git a/kubernetes/cps/resources/config/application-helm.yml b/kubernetes/cps/resources/config/application-helm.yml deleted file mode 100755 index 5f19007231..0000000000 --- a/kubernetes/cps/resources/config/application-helm.yml +++ /dev/null @@ -1,87 +0,0 @@ -{{/* - # Copyright (C) 2021 Pantheon.tech - # Modifications Copyright (C) 2020 Bell Canada. All rights reserved. - # Modifications Copyright (C) 2021 Nordix Foundation. All rights reserved. - # - # Licensed under the Apache License, Version 2.0 (the "License"); - # you may not use this file except in compliance with the License. - # You may obtain a copy of the License at - # - # http://www.apache.org/licenses/LICENSE-2.0 - # - # Unless required by applicable law or agreed to in writing, software - # distributed under the License is distributed on an "AS IS" BASIS, - # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - # See the License for the specific language governing permissions and - # limitations under the License. -*/}} ---- -server: - port: 8080 - -rest: - api: - cps-base-path: /cps/api - xnf-base-path: /cps-nf-proxy/api - -spring: - main: - banner-mode: "off" - jpa: - ddl-auto: create - open-in-view: false - properties: - hibernate: - enable_lazy_load_no_trans: true - dialect: org.hibernate.dialect.PostgreSQLDialect - - datasource: - url: jdbc:postgresql://{{ .Values.postgres.service.name2 }}:5432/{{ .Values.postgres.config.pgDatabase }} - username: ${DB_USERNAME} - password: ${DB_PASSWORD} - driverClassName: org.postgresql.Driver - initialization-mode: always - - cache: - type: caffeine - cache-names: yangSchema - caffeine: - spec: maximumSize=10000,expireAfterAccess=10m - - liquibase: - change-log: classpath:changelog/changelog-master.yaml - labels: {{ .Values.config.liquibaseLabels }} - -security: - # comma-separated uri patterns which do not require authorization - permit-uri: /manage/health/**,/manage/info,/swagger-ui/**,/swagger-resources/**,/v3/api-docs - auth: - username: ${CPS_USERNAME} - password: ${CPS_PASSWORD} - -# Actuator -management: - endpoints: - web: - base-path: /manage - exposure: - include: info,health,loggers - endpoint: - health: - show-details: always - # kubernetes probes: liveness and readiness - probes: - enabled: true - loggers: - enabled: true - -logging: - level: - org: - springframework: {{ .Values.logging.level }} - -{{- if .Values.config.additional }} -{{ toYaml .Values.config.additional | nindent 2 }} -{{- end }} - -# Last empty line is required otherwise the last property will be missing from application.yml file in the pod. diff --git a/kubernetes/cps/resources/config/logback.xml b/kubernetes/cps/resources/config/logback.xml deleted file mode 100644 index 56ffc88220..0000000000 --- a/kubernetes/cps/resources/config/logback.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - %d - %highlight(%-5level) [%-20.20thread] %cyan(%logger{36}) - %msg%n - - - - - - - - - - - - diff --git a/kubernetes/cps/templates/NOTES.txt b/kubernetes/cps/templates/NOTES.txt deleted file mode 100644 index 09d22dfa7c..0000000000 --- a/kubernetes/cps/templates/NOTES.txt +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright © 2018 Amdocs, Bell Canada -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -1. Get the application URL by running these commands: -{{- if .Values.ingress.enabled }} -{{- range .Values.ingress.hosts }} - http://{{ . }} -{{- end }} -{{- else if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ include "common.namespace" . }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "common.fullname" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ include "common.namespace" . }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT -{{- else if contains "LoadBalancer" .Values.service.type }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get svc -w {{ include "common.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ include "common.namespace" . }} {{ include "common.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') - export SERVICE_PORT=$(kubectl get svc --namespace {{ include "common.namespace" . }} {{ include "common.fullname" . }} -o jsonpath='{.spec.ports[0].port}') - echo http://$SERVICE_IP:$SERVICE_PORT -{{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ include "common.namespace" . }} -l "app={{ template "common.name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - export POD_PORT=$(kubectl get pods --namespace {{ include "common.namespace" . }} -l "app={{ template "common.name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].spec.containers[0].ports[0].containerPort}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl port-forward $POD_NAME 8080:$POD_PORT -{{- end }} diff --git a/kubernetes/cps/templates/configmap.yaml b/kubernetes/cps/templates/configmap.yaml deleted file mode 100644 index eeb057cbd8..0000000000 --- a/kubernetes/cps/templates/configmap.yaml +++ /dev/null @@ -1,20 +0,0 @@ -{{/* -# Copyright (C) 2021 Pantheon.tech -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -*/}} - -apiVersion: v1 -kind: ConfigMap -metadata: {{- include "common.resourceMetadata" . | nindent 2 }} -data: {{ tpl (.Files.Glob "resources/config/*").AsConfig . | nindent 2 }} diff --git a/kubernetes/cps/templates/deployment.yaml b/kubernetes/cps/templates/deployment.yaml deleted file mode 100755 index 61877c38a0..0000000000 --- a/kubernetes/cps/templates/deployment.yaml +++ /dev/null @@ -1,106 +0,0 @@ -{{/* -# Copyright (C) 2021 Pantheon.tech, Orange -# Modifications Copyright (C) 2021 Bell Canada. -# Modifications Copyright (C) 2021 Nordix Foundation. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -*/}} - -apiVersion: apps/v1 -kind: Deployment -metadata: {{- include "common.resourceMetadata" . | nindent 2 }} -spec: - replicas: {{ .Values.replicaCount }} - selector: {{- include "common.selectors" . | nindent 4 }} - template: - metadata: {{- include "common.templateMetadata" . | nindent 6 }} - spec: - {{ include "common.podSecurityContext" . | indent 6 | trim}} - serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . ) }} - initContainers: {{ include "common.readinessCheck.waitFor" . | nindent 6 }} - - name: {{ include "common.name" . }}-update-config - image: {{ include "repositoryGenerator.image.envsubst" . }} - imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} - command: - - sh - args: - - -c - - "cd /config-input && for PFILE in `find . -not -type d | grep -v -F ..`; do envsubst <${PFILE} >/config/${PFILE}; done" - env: - - name: DB_USERNAME - {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-user-creds" "key" "login") | indent 12 }} - - name: DB_PASSWORD - {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-user-creds" "key" "password") | indent 12 }} - - name: LIQUIBASE_LABELS - value: {{ .Values.config.liquibaseLabels }} - - name: CPS_USERNAME - {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "app-user-creds" "key" "login") | indent 12 }} - - name: CPS_PASSWORD - {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "app-user-creds" "key" "password") | indent 12 }} - volumeMounts: - - mountPath: /config-input - name: init-data-input - - mountPath: /config - name: init-data - containers: - - name: {{ include "common.name" . }} - image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} - imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} - ports: {{ include "common.containerPorts" . | nindent 10 }} - {{ include "common.containerSecurityContext" . | indent 8 | trim }} - # disable liveness probe when breakpoints set in debugger - # so K8s doesn't restart unresponsive container - {{- if eq .Values.liveness.enabled true }} - livenessProbe: - httpGet: - port: {{ .Values.liveness.port }} - path: {{ .Values.liveness.path }} - initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} - periodSeconds: {{ .Values.liveness.periodSeconds }} - {{ end -}} - readinessProbe: - httpGet: - port: {{ .Values.readiness.port }} - path: {{ .Values.readiness.path }} - initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} - periodSeconds: {{ .Values.readiness.periodSeconds }} - env: - - name: SPRING_PROFILES_ACTIVE - value: {{ .Values.config.spring.profile }} - resources: {{ include "common.resources" . | nindent 10 }} - {{- if .Values.nodeSelector }} - nodeSelector: {{ toYaml .Values.nodeSelector | nindent 12 }} - {{- end }} - {{- if .Values.affinity }} - affinity: {{ toYaml .Values.affinity | nindent 12 }} - {{- end }} - volumeMounts: - - mountPath: /app/resources/application-helm.yml - subPath: application-helm.yml - name: init-data - - mountPath: /app/resources/logback.xml - subPath: logback.xml - name: init-data - - mountPath: /tmp - name: init-temp - volumes: - - name: init-data-input - configMap: - name: {{ include "common.fullname" . }} - - name: init-data - emptyDir: - medium: Memory - - name: init-temp - emptyDir: {} - imagePullSecrets: - - name: "{{ include "common.namespace" . }}-docker-registry-key" \ No newline at end of file diff --git a/kubernetes/cps/templates/ingress.yaml b/kubernetes/cps/templates/ingress.yaml deleted file mode 100644 index 16f9440aba..0000000000 --- a/kubernetes/cps/templates/ingress.yaml +++ /dev/null @@ -1,17 +0,0 @@ -{{/* -# Copyright (C) 2021 Pantheon.tech -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -*/}} - -{{ include "common.ingress" . }} diff --git a/kubernetes/cps/templates/secrets.yaml b/kubernetes/cps/templates/secrets.yaml deleted file mode 100644 index f25044d339..0000000000 --- a/kubernetes/cps/templates/secrets.yaml +++ /dev/null @@ -1,17 +0,0 @@ -{{/* -# Copyright (C) 2021 Pantheon.tech -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -*/}} - -{{ include "common.secretFast" . }} diff --git a/kubernetes/cps/templates/service.yaml b/kubernetes/cps/templates/service.yaml deleted file mode 100644 index bfcaabc178..0000000000 --- a/kubernetes/cps/templates/service.yaml +++ /dev/null @@ -1,17 +0,0 @@ -{{/* - # Copyright (C) 2021 Pantheon.tech, Orange - # - # Licensed under the Apache License, Version 2.0 (the "License"); - # you may not use this file except in compliance with the License. - # You may obtain a copy of the License at - # - # http://www.apache.org/licenses/LICENSE-2.0 - # - # Unless required by applicable law or agreed to in writing, software - # distributed under the License is distributed on an "AS IS" BASIS, - # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - # See the License for the specific language governing permissions and - # limitations under the License. - */}} - -{{ include "common.service" . }} diff --git a/kubernetes/cps/values.yaml b/kubernetes/cps/values.yaml index 2312a4994d..87bba7f1da 100755 --- a/kubernetes/cps/values.yaml +++ b/kubernetes/cps/values.yaml @@ -1,4 +1,4 @@ -# Copyright (C) 2021 Pantheon.tech, Orange, Bell Canada. +# Copyright (C) 2021 Bell Canada # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,157 +12,17 @@ # See the License for the specific language governing permissions and # limitations under the License. -################################################################# -# Secrets. -################################################################# -secrets: - - uid: pg-root-pass - name: &pgRootPassSecretName '{{ include "common.release" . }}-cps-pg-root-pass' - type: password - externalSecret: '{{ ternary "" (tpl (default "" .Values.postgres.config.pgRootPasswordExternalSecret) .) (hasSuffix "cps-pg-root-pass" .Values.postgres.config.pgRootPasswordExternalSecret) }}' - password: '{{ .Values.postgres.config.pgRootpassword }}' - policy: generate - - uid: pg-user-creds - name: &pgUserCredsSecretName '{{ include "common.release" . }}-cps-pg-user-creds' - type: basicAuth - externalSecret: '{{ ternary "" (tpl (default "" .Values.postgres.config.pgUserExternalSecret) .) (hasSuffix "cps-pg-user-creds" .Values.postgres.config.pgUserExternalSecret) }}' - login: '{{ .Values.postgres.config.pgUserName }}' - password: '{{ .Values.postgres.config.pgUserPassword }}' - passwordPolicy: generate - - uid: app-user-creds - type: basicAuth - externalSecret: '{{ tpl (default "" .Values.config.appUserExternalSecret) . }}' - login: '{{ .Values.config.appUserName }}' - password: '{{ .Values.config.appUserPassword }}' - passwordPolicy: generate - ################################################################# # Global configuration defaults. ################################################################# - -# bitnami image doesn't support well single quote in password passwordStrengthOverride: basic global: ingress: virtualhost: baseurl: "simpledemo.onap.org" -image: onap/cps-and-nf-proxy:1.0.1 -containerPort: &svc_port 8080 - -service: - type: ClusterIP - name: cps - ports: - - name: &port http - port: *svc_port +config: {} -pullPolicy: Always -# flag to enable debugging - application support required -debugEnabled: false -nodeSelector: {} -affinity: {} -# Resource Limit flavor -By Default using small -flavor: small -# default number of instances -replicaCount: 1 -# Segregation for Different environment (Small and Large) -resources: - small: - limits: - cpu: 2 - memory: 2Gi - requests: - cpu: 1 - memory: 1Gi - large: - limits: - cpu: 4 - memory: 4Gi - requests: - cpu: 2 - memory: 2Gi - unlimited: {} -# probe configuration parameters -liveness: - initialDelaySeconds: 20 - periodSeconds: 20 - # necessary to disable liveness probe when setting breakpoints - # in debugger so K8s doesn't restart unresponsive container +# Enable all CPS components by default +cps-core: enabled: true - path: /manage/health - port: *port - -readiness: - initialDelaySeconds: 15 - periodSeconds: 15 - path: /manage/health - port: *port - -ingress: - enabled: true - service: - - baseaddr: "cps" - path: "/" - name: "cps" - port: *svc_port - -serviceAccount: - nameOverride: cps - roles: - - read - -securityContext: - user_id: 100 - group_id: 655533 - -################################################################# -# Application configuration defaults. -################################################################# - -config: - - # Set it for pre loading xnfdata, else set to null - liquibaseLabels: xnf-data-preload - - # REST API basic authentication credentials (passsword is generated if not provided) - appUserName: cpsuser - spring: - profile: helm - #appUserPassword: - -# Any new property can be added in the env by setting in overrides in the format mentioned below -# All the added properties must be in "key: value" format insead of yaml. -# additional: -# spring.config.max-size: 200 -# spring.config.min-size: 10 - -logging: - level: INFO - path: /tmp - -################################################################# -# Postgres overriding defaults in the postgres -################################################################# -postgres: - nameOverride: &postgresName cps-postgres - service: - name: *postgresName - name2: cps-pg-primary - name3: cps-pg-replica - container: - name: - primary: cps-pg-primary - replica: cps-pg-replica - persistence: - mountSubPath: cps/data - mountInitPath: cps - config: - pgUserName: cps - pgDatabase: cpsdb - pgUserExternalSecret: *pgUserCredsSecretName - pgRootPasswordExternalSecret: *pgRootPassSecretName - -readinessCheck: - wait_for: - - cps-postgres -- cgit 1.2.3-korg