From: Sylvain Desbureaux Date: Wed, 1 Sep 2021 13:24:17 +0000 (+0000) Subject: Merge "[DCAE] Helm charts for SNMPTrap collector" X-Git-Tag: 9.0.0~156 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=0204932de96a41bd840668a10dd88dc423c7106f;hp=f1a226cb3d000ba67fda520af02ac5a31968b7e9;p=oom.git Merge "[DCAE] Helm charts for SNMPTrap collector" --- diff --git a/kubernetes/cds/components/cds-blueprints-processor/values.yaml b/kubernetes/cds/components/cds-blueprints-processor/values.yaml index 71f934fbe5..942933d591 100755 --- a/kubernetes/cds/components/cds-blueprints-processor/values.yaml +++ b/kubernetes/cds/components/cds-blueprints-processor/values.yaml @@ -51,7 +51,7 @@ secrets: # Application configuration defaults. ################################################################# # application image -image: onap/ccsdk-blueprintsprocessor:1.1.4 +image: onap/ccsdk-blueprintsprocessor:1.1.5 pullPolicy: Always # flag to enable debugging - application support required diff --git a/kubernetes/cds/components/cds-command-executor/values.yaml b/kubernetes/cds/components/cds-command-executor/values.yaml index 12a7fe9b40..cb3668656a 100755 --- a/kubernetes/cds/components/cds-command-executor/values.yaml +++ b/kubernetes/cds/components/cds-command-executor/values.yaml @@ -32,7 +32,7 @@ global: # Application configuration defaults. ################################################################# # application image -image: onap/ccsdk-commandexecutor:1.1.4 +image: onap/ccsdk-commandexecutor:1.1.5 pullPolicy: Always # application configuration diff --git a/kubernetes/cds/components/cds-py-executor/values.yaml b/kubernetes/cds/components/cds-py-executor/values.yaml index b7338f88aa..02805cf5fa 100755 --- a/kubernetes/cds/components/cds-py-executor/values.yaml +++ b/kubernetes/cds/components/cds-py-executor/values.yaml @@ -30,7 +30,7 @@ global: # Application configuration defaults. ################################################################# # application image -image: onap/ccsdk-py-executor:1.1.4 +image: onap/ccsdk-py-executor:1.1.5 pullPolicy: Always # default number of instances diff --git a/kubernetes/cds/components/cds-sdc-listener/values.yaml b/kubernetes/cds/components/cds-sdc-listener/values.yaml index 4a67317298..f71dafeeb1 100644 --- a/kubernetes/cds/components/cds-sdc-listener/values.yaml +++ b/kubernetes/cds/components/cds-sdc-listener/values.yaml @@ -29,7 +29,7 @@ global: # Application configuration defaults. ################################################################# # application image -image: onap/ccsdk-sdclistener:1.1.4 +image: onap/ccsdk-sdclistener:1.1.5 name: sdc-listener pullPolicy: Always diff --git a/kubernetes/cds/components/cds-ui/values.yaml b/kubernetes/cds/components/cds-ui/values.yaml index e91e999259..8f5f806baf 100644 --- a/kubernetes/cds/components/cds-ui/values.yaml +++ b/kubernetes/cds/components/cds-ui/values.yaml @@ -44,7 +44,7 @@ certInitializer: {{.Values.fqi}} {{ .Values.fqdn }} > {{ .Values.credsPath }}/mycreds.prop # application image -image: onap/ccsdk-cds-ui-server:1.1.4 +image: onap/ccsdk-cds-ui-server:1.1.5 pullPolicy: Always # application configuration diff --git a/kubernetes/common/cassandra/resources/config/docker-entrypoint.sh b/kubernetes/common/cassandra/resources/config/docker-entrypoint.sh index c01d7c6d57..2d30f2e068 100644 --- a/kubernetes/common/cassandra/resources/config/docker-entrypoint.sh +++ b/kubernetes/common/cassandra/resources/config/docker-entrypoint.sh @@ -71,7 +71,7 @@ if [ "$1" = 'cassandra' ]; then start_rpc \ authenticator \ ; do - var="CASSANDRA_${yaml^^}" + var="CASSANDRA_$(echo $yaml | tr '[:lower:]' '[:upper:]')" # eval presents no security issue here because of limited possible values of var eval val=\$$var if [ "$val" ]; then @@ -81,7 +81,7 @@ if [ "$1" = 'cassandra' ]; then done for rackdc in dc rack; do - var="CASSANDRA_${rackdc^^}" + var="CASSANDRA_$(echo $rackdc | tr '[:lower:]' '[:upper:]')" # eval presents no security issue here because of limited possible values of var eval val=\$$var if [ "$val" ]; then diff --git a/kubernetes/common/common/templates/_affinities.tpl b/kubernetes/common/common/templates/_affinities.tpl index f0802be29d..bf7ae497ca 100644 --- a/kubernetes/common/common/templates/_affinities.tpl +++ b/kubernetes/common/common/templates/_affinities.tpl @@ -23,7 +23,7 @@ Return a soft nodeAffinity definition preferredDuringSchedulingIgnoredDuringExecution: - preference: matchExpressions: - key: {{ .key }} + - key: {{ .key }} operator: In values: {{- range .values }} @@ -40,7 +40,7 @@ Return a hard nodeAffinity definition requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - key: {{ .key }} + - key: {{ .key }} operator: In values: {{- range .values }} diff --git a/kubernetes/common/mariadb-galera/templates/statefulset.yaml b/kubernetes/common/mariadb-galera/templates/statefulset.yaml index 7b0d90a9aa..9227e182b6 100644 --- a/kubernetes/common/mariadb-galera/templates/statefulset.yaml +++ b/kubernetes/common/mariadb-galera/templates/statefulset.yaml @@ -223,7 +223,7 @@ spec: {{- end }} serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}} {{- if .Values.affinity }} - affinity: {{- include "common.tplvalues" ( dict "value" .Values.affinity "context" $) | nindent 8 }} + affinity: {{- include "common.tplValue" ( dict "value" .Values.affinity "context" $) | nindent 8 }} {{- else }} affinity: podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAffinityPreset "context" $) | nindent 10 }} @@ -231,10 +231,10 @@ spec: nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.nodeAffinityPreset.type "key" .Values.nodeAffinityPreset.key "values" .Values.nodeAffinityPreset.values) | nindent 10 }} {{- end }} {{- if .Values.nodeSelector }} - nodeSelector: {{- include "common.tplvalues" ( dict "value" .Values.nodeSelector "context" $) | nindent 8 }} + nodeSelector: {{- include "common.tplValue" ( dict "value" .Values.nodeSelector "context" $) | nindent 8 }} {{- end }} {{- if .Values.tolerations }} - tolerations: {{- include "common.tplvalues" (dict "value" .Values.tolerations "context" .) | nindent 8 }} + tolerations: {{- include "common.tplValue" (dict "value" .Values.tolerations "context" .) | nindent 8 }} {{- end }} volumes: - name: previous-boot diff --git a/kubernetes/common/mariadb-init/resources/config/db_init.sh b/kubernetes/common/mariadb-init/resources/config/db_init.sh index f130bb5118..df7c336405 100755 --- a/kubernetes/common/mariadb-init/resources/config/db_init.sh +++ b/kubernetes/common/mariadb-init/resources/config/db_init.sh @@ -21,8 +21,8 @@ set -e while read DB ; do - USER_VAR="MYSQL_USER_${DB^^}" - PASS_VAR="MYSQL_PASSWORD_${DB^^}" + USER_VAR="MYSQL_USER_$(echo $DB | tr '[:lower:]' '[:upper:]')" + PASS_VAR="MYSQL_PASSWORD_$(echo $DB | tr '[:lower:]' '[:upper:]')" {{/* # USER=${!USER_VAR} # PASS=`echo -n ${!PASS_VAR} | sed -e "s/'/''/g"` diff --git a/kubernetes/contrib/dns-server-for-vhost-ingress-testing/deploy_dns.sh b/kubernetes/contrib/dns-server-for-vhost-ingress-testing/deploy_dns.sh index 163877deca..460c046632 100755 --- a/kubernetes/contrib/dns-server-for-vhost-ingress-testing/deploy_dns.sh +++ b/kubernetes/contrib/dns-server-for-vhost-ingress-testing/deploy_dns.sh @@ -89,7 +89,7 @@ deploy() { if [ $# -eq 1 ] && [ "$1" = "-h" ]; then usage -elif [ $# -eq 1 ] && [ "$1" = "--help" ]; then +elif [ $# -eq 1 ] && [ "$1" = "--help" ]; then usage elif [ $# -eq 1 ] && [ "$1" = "--info" ]; then target_machine_notice_info 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/resources/config/application-helm.yml b/kubernetes/cps/components/cps-core/resources/config/application-helm.yml old mode 100755 new mode 100644 similarity index 68% rename from kubernetes/cps/resources/config/application-helm.yml rename to kubernetes/cps/components/cps-core/resources/config/application-helm.yml index 5f19007231..f181b82fec --- a/kubernetes/cps/resources/config/application-helm.yml +++ b/kubernetes/cps/components/cps-core/resources/config/application-helm.yml @@ -1,21 +1,21 @@ {{/* - # 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. +# 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 diff --git a/kubernetes/cps/resources/config/logback.xml b/kubernetes/cps/components/cps-core/resources/config/logback.xml similarity index 96% rename from kubernetes/cps/resources/config/logback.xml rename to kubernetes/cps/components/cps-core/resources/config/logback.xml index 56ffc88220..8256cfa18d 100644 --- a/kubernetes/cps/resources/config/logback.xml +++ b/kubernetes/cps/components/cps-core/resources/config/logback.xml @@ -1,11 +1,13 @@