diff options
author | Sylvain Desbureaux <sylvain.desbureaux@orange.com> | 2020-11-21 22:48:15 +0100 |
---|---|---|
committer | Sylvain Desbureaux <sylvain.desbureaux@orange.com> | 2020-11-23 17:47:41 +0100 |
commit | 856fce1c3b3e1441058e0db89a5b3d7a13202a02 (patch) | |
tree | 146d7bf95dc4917cd4b54ab20bdbd6ff8f81e107 | |
parent | f0dacd23777a7998915afe00150b25135b932f86 (diff) |
[APPC] Uses new tpls for repos / images
This commit makes APPC chart to use the new generator for repositories and
images.
As new templates doesn't work well with "sub charts", we move also
subcharts to components folder.
Issue-ID: OOM-2364
Signed-off-by: Sylvain Desbureaux <sylvain.desbureaux@orange.com>
Change-Id: I31178186d08926ae708261e84debb5bf49562b7a
-rw-r--r-- | kubernetes/appc/Makefile | 51 | ||||
-rw-r--r-- | kubernetes/appc/components/Makefile | 51 | ||||
-rw-r--r-- | kubernetes/appc/components/appc-ansible-server/.helmignore (renamed from kubernetes/appc/charts/appc-ansible-server/.helmignore) | 0 | ||||
-rw-r--r-- | kubernetes/appc/components/appc-ansible-server/Chart.yaml (renamed from kubernetes/appc/charts/appc-ansible-server/Chart.yaml) | 0 | ||||
-rw-r--r-- | kubernetes/appc/components/appc-ansible-server/requirements.yaml (renamed from kubernetes/appc/charts/appc-ansible-server/requirements.yaml) | 3 | ||||
-rw-r--r-- | kubernetes/appc/components/appc-ansible-server/resources/config/RestServer_config (renamed from kubernetes/appc/charts/appc-ansible-server/resources/config/RestServer_config) | 0 | ||||
-rw-r--r-- | kubernetes/appc/components/appc-ansible-server/templates/configmap.yaml (renamed from kubernetes/appc/charts/appc-ansible-server/templates/configmap.yaml) | 0 | ||||
-rw-r--r-- | kubernetes/appc/components/appc-ansible-server/templates/pv.yaml (renamed from kubernetes/appc/charts/appc-ansible-server/templates/pv.yaml) | 0 | ||||
-rw-r--r-- | kubernetes/appc/components/appc-ansible-server/templates/service.yaml (renamed from kubernetes/appc/charts/appc-ansible-server/templates/service.yaml) | 0 | ||||
-rw-r--r-- | kubernetes/appc/components/appc-ansible-server/templates/statefulset.yaml (renamed from kubernetes/appc/charts/appc-ansible-server/templates/statefulset.yaml) | 4 | ||||
-rw-r--r-- | kubernetes/appc/components/appc-ansible-server/values.yaml (renamed from kubernetes/appc/charts/appc-ansible-server/values.yaml) | 5 | ||||
-rw-r--r-- | kubernetes/appc/components/appc-cdt/.helmignore (renamed from kubernetes/appc/charts/appc-cdt/.helmignore) | 0 | ||||
-rw-r--r-- | kubernetes/appc/components/appc-cdt/Chart.yaml (renamed from kubernetes/appc/charts/appc-cdt/Chart.yaml) | 0 | ||||
-rw-r--r-- | kubernetes/appc/components/appc-cdt/requirements.yaml (renamed from kubernetes/appc/charts/appc-cdt/requirements.yaml) | 3 | ||||
-rw-r--r-- | kubernetes/appc/components/appc-cdt/templates/NOTES.txt (renamed from kubernetes/appc/charts/appc-cdt/templates/NOTES.txt) | 0 | ||||
-rw-r--r-- | kubernetes/appc/components/appc-cdt/templates/deployment.yaml (renamed from kubernetes/appc/charts/appc-cdt/templates/deployment.yaml) | 2 | ||||
-rw-r--r-- | kubernetes/appc/components/appc-cdt/templates/ingress.yaml (renamed from kubernetes/appc/charts/appc-cdt/templates/ingress.yaml) | 0 | ||||
-rw-r--r-- | kubernetes/appc/components/appc-cdt/templates/service.yaml (renamed from kubernetes/appc/charts/appc-cdt/templates/service.yaml) | 0 | ||||
-rw-r--r-- | kubernetes/appc/components/appc-cdt/values.yaml (renamed from kubernetes/appc/charts/appc-cdt/values.yaml) | 1 | ||||
-rw-r--r-- | kubernetes/appc/requirements.yaml | 11 | ||||
-rw-r--r-- | kubernetes/appc/templates/statefulset.yaml | 8 | ||||
-rw-r--r-- | kubernetes/appc/values.yaml | 10 |
22 files changed, 131 insertions, 18 deletions
diff --git a/kubernetes/appc/Makefile b/kubernetes/appc/Makefile new file mode 100644 index 0000000000..4c79718d02 --- /dev/null +++ b/kubernetes/appc/Makefile @@ -0,0 +1,51 @@ +# Copyright © 2020 Samsung Electronics +# +# 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 + +EXCLUDES := dist resources templates charts docker +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 $(HELM_BIN) package -d $(PACKAGE_DIR) $*; fi + @$(HELM_BIN) repo index $(PACKAGE_DIR) + +clean: + @rm -f */requirements.lock + @rm -f *tgz */charts/*tgz + @rm -rf $(PACKAGE_DIR) +%: + @: diff --git a/kubernetes/appc/components/Makefile b/kubernetes/appc/components/Makefile new file mode 100644 index 0000000000..f2e7a1fb82 --- /dev/null +++ b/kubernetes/appc/components/Makefile @@ -0,0 +1,51 @@ +# Copyright © 2020 Samsung Electronics +# +# 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 + +EXCLUDES := soHelpers +HELM_BIN := helm +HELM_CHARTS := soHelpers $(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 $(HELM_BIN) package -d $(PACKAGE_DIR) $*; fi + @$(HELM_BIN) repo index $(PACKAGE_DIR) + +clean: + @rm -f */requirements.lock + @rm -f *tgz */charts/*tgz + @rm -rf $(PACKAGE_DIR) +%: + @: diff --git a/kubernetes/appc/charts/appc-ansible-server/.helmignore b/kubernetes/appc/components/appc-ansible-server/.helmignore index f0c1319444..f0c1319444 100644 --- a/kubernetes/appc/charts/appc-ansible-server/.helmignore +++ b/kubernetes/appc/components/appc-ansible-server/.helmignore diff --git a/kubernetes/appc/charts/appc-ansible-server/Chart.yaml b/kubernetes/appc/components/appc-ansible-server/Chart.yaml index 9c47c9eaef..9c47c9eaef 100644 --- a/kubernetes/appc/charts/appc-ansible-server/Chart.yaml +++ b/kubernetes/appc/components/appc-ansible-server/Chart.yaml diff --git a/kubernetes/appc/charts/appc-ansible-server/requirements.yaml b/kubernetes/appc/components/appc-ansible-server/requirements.yaml index 33afc43aa5..2fa99a9484 100644 --- a/kubernetes/appc/charts/appc-ansible-server/requirements.yaml +++ b/kubernetes/appc/components/appc-ansible-server/requirements.yaml @@ -16,3 +16,6 @@ dependencies: - name: common version: ~6.x-0 repository: '@local' + - name: repositoryGenerator + version: ~6.x-0 + repository: '@local' diff --git a/kubernetes/appc/charts/appc-ansible-server/resources/config/RestServer_config b/kubernetes/appc/components/appc-ansible-server/resources/config/RestServer_config index dc0859985e..dc0859985e 100644 --- a/kubernetes/appc/charts/appc-ansible-server/resources/config/RestServer_config +++ b/kubernetes/appc/components/appc-ansible-server/resources/config/RestServer_config diff --git a/kubernetes/appc/charts/appc-ansible-server/templates/configmap.yaml b/kubernetes/appc/components/appc-ansible-server/templates/configmap.yaml index 3bfe84c6e7..3bfe84c6e7 100644 --- a/kubernetes/appc/charts/appc-ansible-server/templates/configmap.yaml +++ b/kubernetes/appc/components/appc-ansible-server/templates/configmap.yaml diff --git a/kubernetes/appc/charts/appc-ansible-server/templates/pv.yaml b/kubernetes/appc/components/appc-ansible-server/templates/pv.yaml index b2acf37393..b2acf37393 100644 --- a/kubernetes/appc/charts/appc-ansible-server/templates/pv.yaml +++ b/kubernetes/appc/components/appc-ansible-server/templates/pv.yaml diff --git a/kubernetes/appc/charts/appc-ansible-server/templates/service.yaml b/kubernetes/appc/components/appc-ansible-server/templates/service.yaml index e952357c4c..e952357c4c 100644 --- a/kubernetes/appc/charts/appc-ansible-server/templates/service.yaml +++ b/kubernetes/appc/components/appc-ansible-server/templates/service.yaml diff --git a/kubernetes/appc/charts/appc-ansible-server/templates/statefulset.yaml b/kubernetes/appc/components/appc-ansible-server/templates/statefulset.yaml index 537703d21c..0e9e60ab5f 100644 --- a/kubernetes/appc/charts/appc-ansible-server/templates/statefulset.yaml +++ b/kubernetes/appc/components/appc-ansible-server/templates/statefulset.yaml @@ -38,7 +38,7 @@ spec: spec: initContainers: - name: {{ include "common.name" . }}-chown - image: "busybox" + image: {{ include "repositoryGenerator.image.busybox" . }} command: ["sh", "-c", "chown -R {{ .Values.config.ansibleUid }}:{{ .Values.config.ansibleGid}} {{ .Values.persistence.playbookPath }}"] volumeMounts: - mountPath: {{ .Values.persistence.playbookPath }} @@ -47,7 +47,7 @@ spec: - name: {{ include "common.name" . }} command: ["/bin/bash"] args: ["-c", "cd /opt/onap/ccsdk && ./startAnsibleServer.sh"] - image: "{{ include "common.repository" . }}/{{ .Values.image }}" + image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} ports: - containerPort: {{ .Values.service.internalPort }} diff --git a/kubernetes/appc/charts/appc-ansible-server/values.yaml b/kubernetes/appc/components/appc-ansible-server/values.yaml index 474c5973ec..1588bc52d6 100644 --- a/kubernetes/appc/charts/appc-ansible-server/values.yaml +++ b/kubernetes/appc/components/appc-ansible-server/values.yaml @@ -17,9 +17,7 @@ ################################################################# global: nodePortPrefix: 302 - readinessImage: onap/oom/readiness:3.0.1 - loggingRepository: docker.elastic.co - loggingImage: beats/filebeat:5.5.0 + persistence: {} ################################################################# # Application configuration defaults. @@ -27,7 +25,6 @@ global: flavor: small # application image -repository: nexus3.onap.org:10001 image: onap/ccsdk-ansible-server-image:0.4.4 pullPolicy: Always diff --git a/kubernetes/appc/charts/appc-cdt/.helmignore b/kubernetes/appc/components/appc-cdt/.helmignore index f0c1319444..f0c1319444 100644 --- a/kubernetes/appc/charts/appc-cdt/.helmignore +++ b/kubernetes/appc/components/appc-cdt/.helmignore diff --git a/kubernetes/appc/charts/appc-cdt/Chart.yaml b/kubernetes/appc/components/appc-cdt/Chart.yaml index 3d83bc945c..3d83bc945c 100644 --- a/kubernetes/appc/charts/appc-cdt/Chart.yaml +++ b/kubernetes/appc/components/appc-cdt/Chart.yaml diff --git a/kubernetes/appc/charts/appc-cdt/requirements.yaml b/kubernetes/appc/components/appc-cdt/requirements.yaml index a7089ea6b3..fa92c63e34 100644 --- a/kubernetes/appc/charts/appc-cdt/requirements.yaml +++ b/kubernetes/appc/components/appc-cdt/requirements.yaml @@ -16,3 +16,6 @@ dependencies: - name: common version: ~6.x-0 repository: '@local' + - name: repositoryGenerator + version: ~6.x-0 + repository: '@local' diff --git a/kubernetes/appc/charts/appc-cdt/templates/NOTES.txt b/kubernetes/appc/components/appc-cdt/templates/NOTES.txt index 1a7dbc5d13..1a7dbc5d13 100644 --- a/kubernetes/appc/charts/appc-cdt/templates/NOTES.txt +++ b/kubernetes/appc/components/appc-cdt/templates/NOTES.txt diff --git a/kubernetes/appc/charts/appc-cdt/templates/deployment.yaml b/kubernetes/appc/components/appc-cdt/templates/deployment.yaml index 3ccea21cc5..ebcabf5112 100644 --- a/kubernetes/appc/charts/appc-cdt/templates/deployment.yaml +++ b/kubernetes/appc/components/appc-cdt/templates/deployment.yaml @@ -38,7 +38,7 @@ spec: initContainers: containers: - name: {{ include "common.name" . }} - image: "{{ include "common.repository" . }}/{{ .Values.image }}" + image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} command: - /opt/startCdt.sh diff --git a/kubernetes/appc/charts/appc-cdt/templates/ingress.yaml b/kubernetes/appc/components/appc-cdt/templates/ingress.yaml index 8f87c68f1e..8f87c68f1e 100644 --- a/kubernetes/appc/charts/appc-cdt/templates/ingress.yaml +++ b/kubernetes/appc/components/appc-cdt/templates/ingress.yaml diff --git a/kubernetes/appc/charts/appc-cdt/templates/service.yaml b/kubernetes/appc/components/appc-cdt/templates/service.yaml index 54e239ebc5..54e239ebc5 100644 --- a/kubernetes/appc/charts/appc-cdt/templates/service.yaml +++ b/kubernetes/appc/components/appc-cdt/templates/service.yaml diff --git a/kubernetes/appc/charts/appc-cdt/values.yaml b/kubernetes/appc/components/appc-cdt/values.yaml index e8508204bc..b3dab719bd 100644 --- a/kubernetes/appc/charts/appc-cdt/values.yaml +++ b/kubernetes/appc/components/appc-cdt/values.yaml @@ -25,7 +25,6 @@ global: flavor: small # application image -repository: nexus3.onap.org:10001 image: onap/appc-cdt-image:1.7.2 pullPolicy: Always diff --git a/kubernetes/appc/requirements.yaml b/kubernetes/appc/requirements.yaml index d512a7ee08..be72cc2b99 100644 --- a/kubernetes/appc/requirements.yaml +++ b/kubernetes/appc/requirements.yaml @@ -22,3 +22,14 @@ dependencies: - name: dgbuilder version: ~6.x-0 repository: '@local' + - name: repositoryGenerator + version: ~6.x-0 + repository: '@local' + - name: appc-ansible-server + version: ~6.x-0 + repository: 'file://components/appc-ansible-server' + condition: appc-ansible-server.enabled + - name: appc-cdt + version: ~6.x-0 + repository: 'file://components/appc-cdt' + condition: appc-cdt.enabled
\ No newline at end of file diff --git a/kubernetes/appc/templates/statefulset.yaml b/kubernetes/appc/templates/statefulset.yaml index 5e889f1d96..208315495b 100644 --- a/kubernetes/appc/templates/statefulset.yaml +++ b/kubernetes/appc/templates/statefulset.yaml @@ -69,7 +69,7 @@ spec: name: onap-sdnc-data-properties - mountPath: /config/sdnc-svclogic-config name: onap-sdnc-svclogic-config - image: "{{ .Values.global.envsubstImage }}" + image: {{ include "repositoryGenerator.image.envsubst" . }} imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} name: {{ include "common.name" . }}-update-config @@ -85,17 +85,17 @@ spec: fieldRef: apiVersion: v1 fieldPath: metadata.namespace - image: "{{ include "common.repository" . }}/{{ .Values.global.readinessImage }}" + image: {{ include "repositoryGenerator.image.readiness" . }} imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} - name: {{ include "common.name" . }}-chown - image: "busybox" + image: {{ include "repositoryGenerator.image.busybox" . }} command: ["sh", "-c", "chown -R {{ .Values.config.odlUid }}:{{ .Values.config.odlGid}} {{ .Values.persistence.mdsalPath }}"] volumeMounts: - mountPath: {{ .Values.persistence.mdsalPath }} name: {{ include "common.fullname" . }}-data containers: - name: {{ include "common.name" . }} - image: "{{ include "common.repository" . }}/{{ .Values.image }}" + image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} command: - /opt/appc/bin/startODL.sh diff --git a/kubernetes/appc/values.yaml b/kubernetes/appc/values.yaml index 8b3ce26d52..92c9985c35 100644 --- a/kubernetes/appc/values.yaml +++ b/kubernetes/appc/values.yaml @@ -18,12 +18,7 @@ ################################################################# global: nodePortPrefix: 302 - readinessImage: onap/oom/readiness:3.0.1 centralizedLoggingEnabled: false - loggingRepository: docker.elastic.co - loggingImage: beats/filebeat:5.5.0 - # envsusbt - envsubstImage: dibi/envsubst persistence: mountPath: /dockerdata-nfs @@ -55,7 +50,6 @@ secrets: ################################################################# flavor: small # application image -repository: nexus3.onap.org:10001 image: onap/appc-image:1.7.2 pullPolicy: Always @@ -111,12 +105,16 @@ config: dmaapServicePassword: onapappc appc-ansible-server: + enabled: true service: name: appc-ansible-server internalPort: 8000 config: mysqlServiceName: appc-dbhost +appc-cdt: + enabled: true + mariadb-galera: nameOverride: appc-db config: |