[MSB] Uses new tpls for repos / images 54/115254/7
authorSylvain Desbureaux <sylvain.desbureaux@orange.com>
Sat, 21 Nov 2020 21:50:06 +0000 (22:50 +0100)
committerSylvain Desbureaux <sylvain.desbureaux@orange.com>
Mon, 30 Nov 2020 21:05:41 +0000 (21:05 +0000)
This commit makes MSB 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: I97de4e13d077a6b7139d98dcd855f93645489035

52 files changed:
kubernetes/msb/Makefile [new file with mode: 0644]
kubernetes/msb/charts/msb-iag/requirements.yaml [deleted file]
kubernetes/msb/components/Makefile [new file with mode: 0644]
kubernetes/msb/components/kube2msb/.helmignore [moved from kubernetes/msb/charts/kube2msb/.helmignore with 100% similarity]
kubernetes/msb/components/kube2msb/Chart.yaml [moved from kubernetes/msb/charts/kube2msb/Chart.yaml with 100% similarity]
kubernetes/msb/components/kube2msb/requirements.yaml [moved from kubernetes/msb/charts/msb-eag/requirements.yaml with 89% similarity]
kubernetes/msb/components/kube2msb/templates/deployment.yaml [moved from kubernetes/msb/charts/kube2msb/templates/deployment.yaml with 94% similarity]
kubernetes/msb/components/kube2msb/values.yaml [moved from kubernetes/msb/charts/kube2msb/values.yaml with 95% similarity]
kubernetes/msb/components/msb-consul/.helmignore [moved from kubernetes/msb/charts/msb-consul/.helmignore with 100% similarity]
kubernetes/msb/components/msb-consul/Chart.yaml [moved from kubernetes/msb/charts/msb-consul/Chart.yaml with 100% similarity]
kubernetes/msb/components/msb-consul/requirements.yaml [moved from kubernetes/msb/charts/kube2msb/requirements.yaml with 89% similarity]
kubernetes/msb/components/msb-consul/resources/docker-entrypoint.sh [moved from kubernetes/msb/charts/msb-consul/resources/docker-entrypoint.sh with 100% similarity]
kubernetes/msb/components/msb-consul/templates/NOTES.txt [moved from kubernetes/msb/charts/msb-consul/templates/NOTES.txt with 100% similarity]
kubernetes/msb/components/msb-consul/templates/configmap.yaml [moved from kubernetes/msb/charts/msb-consul/templates/configmap.yaml with 100% similarity]
kubernetes/msb/components/msb-consul/templates/deployment.yaml [moved from kubernetes/msb/charts/msb-consul/templates/deployment.yaml with 96% similarity]
kubernetes/msb/components/msb-consul/templates/ingress.yaml [moved from kubernetes/msb/charts/msb-consul/templates/ingress.yaml with 100% similarity]
kubernetes/msb/components/msb-consul/templates/service.yaml [moved from kubernetes/msb/charts/msb-consul/templates/service.yaml with 100% similarity]
kubernetes/msb/components/msb-consul/values.yaml [moved from kubernetes/msb/charts/msb-consul/values.yaml with 98% similarity]
kubernetes/msb/components/msb-discovery/.helmignore [moved from kubernetes/msb/charts/msb-discovery/.helmignore with 100% similarity]
kubernetes/msb/components/msb-discovery/Chart.yaml [moved from kubernetes/msb/charts/msb-discovery/Chart.yaml with 100% similarity]
kubernetes/msb/components/msb-discovery/requirements.yaml [moved from kubernetes/msb/charts/msb-consul/requirements.yaml with 89% similarity]
kubernetes/msb/components/msb-discovery/resources/config/logback.xml [moved from kubernetes/msb/charts/msb-discovery/resources/config/logback.xml with 100% similarity]
kubernetes/msb/components/msb-discovery/templates/NOTES.txt [moved from kubernetes/msb/charts/msb-discovery/templates/NOTES.txt with 100% similarity]
kubernetes/msb/components/msb-discovery/templates/configmap.yaml [moved from kubernetes/msb/charts/msb-discovery/templates/configmap.yaml with 100% similarity]
kubernetes/msb/components/msb-discovery/templates/deployment.yaml [moved from kubernetes/msb/charts/msb-discovery/templates/deployment.yaml with 94% similarity]
kubernetes/msb/components/msb-discovery/templates/ingress.yaml [moved from kubernetes/msb/charts/msb-discovery/templates/ingress.yaml with 100% similarity]
kubernetes/msb/components/msb-discovery/templates/service.yaml [moved from kubernetes/msb/charts/msb-discovery/templates/service.yaml with 100% similarity]
kubernetes/msb/components/msb-discovery/values.yaml [moved from kubernetes/msb/charts/msb-discovery/values.yaml with 96% similarity]
kubernetes/msb/components/msb-eag/.helmignore [moved from kubernetes/msb/charts/msb-eag/.helmignore with 100% similarity]
kubernetes/msb/components/msb-eag/Chart.yaml [moved from kubernetes/msb/charts/msb-eag/Chart.yaml with 100% similarity]
kubernetes/msb/components/msb-eag/requirements.yaml [moved from kubernetes/msb/charts/msb-discovery/requirements.yaml with 90% similarity]
kubernetes/msb/components/msb-eag/resources/config/log/logback.xml [moved from kubernetes/msb/charts/msb-eag/resources/config/log/logback.xml with 100% similarity]
kubernetes/msb/components/msb-eag/resources/config/logback.xml [moved from kubernetes/msb/charts/msb-eag/resources/config/logback.xml with 100% similarity]
kubernetes/msb/components/msb-eag/templates/NOTES.txt [moved from kubernetes/msb/charts/msb-eag/templates/NOTES.txt with 100% similarity]
kubernetes/msb/components/msb-eag/templates/configmap.yaml [moved from kubernetes/msb/charts/msb-eag/templates/configmap.yaml with 100% similarity]
kubernetes/msb/components/msb-eag/templates/deployment.yaml [moved from kubernetes/msb/charts/msb-eag/templates/deployment.yaml with 95% similarity]
kubernetes/msb/components/msb-eag/templates/ingress.yaml [moved from kubernetes/msb/charts/msb-eag/templates/ingress.yaml with 100% similarity]
kubernetes/msb/components/msb-eag/templates/service.yaml [moved from kubernetes/msb/charts/msb-eag/templates/service.yaml with 100% similarity]
kubernetes/msb/components/msb-eag/values.yaml [moved from kubernetes/msb/charts/msb-eag/values.yaml with 96% similarity]
kubernetes/msb/components/msb-iag/.helmignore [moved from kubernetes/msb/charts/msb-iag/.helmignore with 100% similarity]
kubernetes/msb/components/msb-iag/Chart.yaml [moved from kubernetes/msb/charts/msb-iag/Chart.yaml with 100% similarity]
kubernetes/msb/components/msb-iag/requirements.yaml [new file with mode: 0644]
kubernetes/msb/components/msb-iag/resources/config/log/logback.xml [moved from kubernetes/msb/charts/msb-iag/resources/config/log/logback.xml with 100% similarity]
kubernetes/msb/components/msb-iag/resources/config/logback.xml [moved from kubernetes/msb/charts/msb-iag/resources/config/logback.xml with 100% similarity]
kubernetes/msb/components/msb-iag/templates/NOTES.txt [moved from kubernetes/msb/charts/msb-iag/templates/NOTES.txt with 100% similarity]
kubernetes/msb/components/msb-iag/templates/configmap.yaml [moved from kubernetes/msb/charts/msb-iag/templates/configmap.yaml with 100% similarity]
kubernetes/msb/components/msb-iag/templates/deployment.yaml [moved from kubernetes/msb/charts/msb-iag/templates/deployment.yaml with 95% similarity]
kubernetes/msb/components/msb-iag/templates/ingress.yaml [moved from kubernetes/msb/charts/msb-iag/templates/ingress.yaml with 100% similarity]
kubernetes/msb/components/msb-iag/templates/service.yaml [moved from kubernetes/msb/charts/msb-iag/templates/service.yaml with 100% similarity]
kubernetes/msb/components/msb-iag/values.yaml [moved from kubernetes/msb/charts/msb-iag/values.yaml with 96% similarity]
kubernetes/msb/requirements.yaml
kubernetes/msb/values.yaml

diff --git a/kubernetes/msb/Makefile b/kubernetes/msb/Makefile
new file mode 100644 (file)
index 0000000..4c79718
--- /dev/null
@@ -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/msb/charts/msb-iag/requirements.yaml b/kubernetes/msb/charts/msb-iag/requirements.yaml
deleted file mode 100644 (file)
index 6cc26cd..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-# Copyright © 2018 Amdocs, Bell Canada , ZTE
-#
-# 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: ~7.x-0
-    repository: '@local'
diff --git a/kubernetes/msb/components/Makefile b/kubernetes/msb/components/Makefile
new file mode 100644 (file)
index 0000000..bf267b7
--- /dev/null
@@ -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 :=
+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)
+%:
+       @:
@@ -15,3 +15,6 @@ dependencies:
   - name: common
     version: ~7.x-0
     repository: '@local'
+  - name: repositoryGenerator
+    version: ~7.x-0
+    repository: '@local'
@@ -49,12 +49,12 @@ 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" . }}-readiness
       containers:
         - name: {{ include "common.name" . }}
-          image: "{{ include "common.repository" . }}/{{ .Values.image }}"
+          image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
           env:
           - name: KUBE_MASTER_URL
similarity index 95%
rename from kubernetes/msb/charts/kube2msb/values.yaml
rename to kubernetes/msb/components/kube2msb/values.yaml
index 3c67227..d2a0a15 100644 (file)
 #################################################################
 global:
   nodePortPrefix: 302
-  readinessImage: onap/oom/readiness:3.0.1
 
 #################################################################
 # Application configuration defaults.
 #################################################################
 # application image
-repository: nexus3.onap.org:10001
 image: onap/oom/kube2msb:1.2.6
 pullPolicy: Always
 istioSidecar: true
@@ -15,3 +15,6 @@ dependencies:
   - name: common
     version: ~7.x-0
     repository: '@local'
+  - name: repositoryGenerator
+    version: ~7.x-0
+    repository: '@local'
@@ -39,7 +39,7 @@ spec:
       serviceAccountName: msb
       containers:
         - name: {{ include "common.name" . }}
-          image: "{{ .Values.global.dockerHubRepository | default .Values.dockerHubRepository }}/{{ .Values.image }}"
+          image: {{ include "repositoryGenerator.dockerHubRepository" . }}/{{ .Values.image }}
           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
           securityContext:
             runAsUser: {{ .Values.securityContext.runAsUser }}
@@ -21,7 +21,6 @@ global:
 # Application configuration defaults.
 #################################################################
 # application image
-dockerHubRepository: docker.io
 image: library/consul:1.4.3
 pullPolicy: Always
 istioSidecar: true
@@ -15,3 +15,6 @@ dependencies:
   - name: common
     version: ~7.x-0
     repository: '@local'
+  - name: repositoryGenerator
+    version: ~7.x-0
+    repository: '@local'
@@ -49,12 +49,12 @@ 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" . }}-readiness
       containers:
         - name: {{ include "common.name" . }}
-          image: "{{ include "common.repository" . }}/{{ .Values.image }}"
+          image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
           ports:
           - containerPort: {{ .Values.service.internalPort }}
@@ -94,7 +94,7 @@ spec:
 
         # Filebeat sidecar container
         - name: {{ include "common.name" . }}-filebeat-onap
-          image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
+          image: {{ include "repositoryGenerator.image.logging" . }}
           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
           volumeMounts:
           - name: {{ include "common.fullname" . }}-filebeat-conf
 #################################################################
 global:
   nodePortPrefix: 302
-  readinessImage: onap/oom/readiness:3.0.1
 
 #################################################################
 # Application configuration defaults.
 #################################################################
 # application image
-repository: nexus3.onap.org:10001
 image: onap/msb/msb_discovery:1.2.6
 pullPolicy: Always
 istioSidecar: true
@@ -15,3 +15,6 @@ dependencies:
   - name: common
     version: ~7.x-0
     repository: '@local'
+  - name: repositoryGenerator
+    version: ~7.x-0
+    repository: '@local'
\ No newline at end of file
@@ -49,12 +49,12 @@ 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" . }}-readiness
       containers:
         - name: {{ include "common.name" . }}
-          image: "{{ include "common.repository" . }}/{{ .Values.image }}"
+          image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
           ports:
           - containerPort: {{ .Values.service.internalPort }}
@@ -108,7 +108,7 @@ spec:
         {{- end }}
         # side car containers
         - name: filebeat-onap
-          image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
+          image: {{ include "repositoryGenerator.image.logging" . }}
           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
           volumeMounts:
           - name: {{ include "common.fullname" . }}-filebeat-conf
similarity index 96%
rename from kubernetes/msb/charts/msb-eag/values.yaml
rename to kubernetes/msb/components/msb-eag/values.yaml
index f63964c..b8813b8 100644 (file)
 #################################################################
 global:
   nodePortPrefix: 302
-  readinessImage: onap/oom/readiness:3.0.1
 
 #################################################################
 # Application configuration defaults.
 #################################################################
 # application image
-repository: nexus3.onap.org:10001
 image: onap/msb/msb_apigateway:1.2.7
 pullPolicy: Always
 istioSidecar: true
diff --git a/kubernetes/msb/components/msb-iag/requirements.yaml b/kubernetes/msb/components/msb-iag/requirements.yaml
new file mode 100644 (file)
index 0000000..467a52a
--- /dev/null
@@ -0,0 +1,20 @@
+# Copyright © 2018 Amdocs, Bell Canada , ZTE
+#
+# 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: ~7.x-0
+    repository: '@local'
+  - name: repositoryGenerator
+    version: ~7.x-0
+    repository: '@local'
@@ -49,12 +49,12 @@ 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" . }}-readiness
       containers:
         - name: {{ include "common.name" . }}
-          image: "{{ include "common.repository" . }}/{{ .Values.image }}"
+          image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
           ports:
           - containerPort: {{ .Values.service.internalPort }}
@@ -108,7 +108,7 @@ spec:
         {{- end }}
         # side car containers
         - name: filebeat-onap
-          image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
+          image: {{ include "repositoryGenerator.image.logging" . }}
           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
           volumeMounts:
           - name: {{ include "common.fullname" . }}-filebeat-conf
similarity index 96%
rename from kubernetes/msb/charts/msb-iag/values.yaml
rename to kubernetes/msb/components/msb-iag/values.yaml
index b1f19c9..b91ddca 100644 (file)
 #################################################################
 global:
   nodePortPrefix: 302
-  readinessImage: onap/oom/readiness:3.0.1
 
 #################################################################
 # Application configuration defaults.
 #################################################################
 # application image
-repository: nexus3.onap.org:10001
 image: onap/msb/msb_apigateway:1.2.7
 pullPolicy: Always
 istioSidecar: true
index 6cc26cd..c52bec4 100644 (file)
@@ -15,3 +15,21 @@ dependencies:
   - name: common
     version: ~7.x-0
     repository: '@local'
+  - name: repositoryGenerator
+    version: ~7.x-0
+    repository: '@local'
+  - name: kube2msb
+    version: ~7.x-0
+    repository: 'file://components/kube2msb'
+  - name: msb-consul
+    version: ~7.x-0
+    repository: 'file://components/msb-consul'
+  - name: msb-discovery
+    version: ~7.x-0
+    repository: 'file://components/msb-discovery'
+  - name: msb-eag
+    version: ~7.x-0
+    repository: 'file://components/msb-eag'
+  - name: msb-iag
+    version: ~7.x-0
+    repository: 'file://components/msb-iag'
\ No newline at end of file
index 27fc008..739fcea 100644 (file)
@@ -18,8 +18,6 @@
 #################################################################
 global:
   nodePortPrefix: 302
-  loggingRepository: docker.elastic.co
-  loggingImage: beats/filebeat:5.5.0
 
 # application configuration
 config: