[LOG] Uses new tpls for repos / images 46/115246/3
authorSylvain Desbureaux <sylvain.desbureaux@orange.com>
Sat, 21 Nov 2020 21:25:10 +0000 (22:25 +0100)
committerJakub Latusek <j.latusek@samsung.com>
Tue, 24 Nov 2020 09:13:34 +0000 (10:13 +0100)
This commit makes Log chart to use the new generator for repositories and
images.

Issue-ID: OOM-2364
Change-Id: Ie93c5fccc2c9ed6026cd8dd93a3d7e141d1bed83
Signed-off-by: Jakub Latusek <j.latusek@samsung.com>
36 files changed:
kubernetes/log/Makefile [new file with mode: 0644]
kubernetes/log/components/Makefile [new file with mode: 0644]
kubernetes/log/components/log-elasticsearch/Chart.yaml [moved from kubernetes/log/charts/log-elasticsearch/Chart.yaml with 100% similarity]
kubernetes/log/components/log-elasticsearch/requirements.yaml [moved from kubernetes/log/charts/log-logstash/requirements.yaml with 90% similarity]
kubernetes/log/components/log-elasticsearch/resources/config/elasticsearch.yml [moved from kubernetes/log/charts/log-elasticsearch/resources/config/elasticsearch.yml with 100% similarity]
kubernetes/log/components/log-elasticsearch/templates/NOTES.txt [moved from kubernetes/log/charts/log-elasticsearch/templates/NOTES.txt with 100% similarity]
kubernetes/log/components/log-elasticsearch/templates/configmap.yaml [moved from kubernetes/log/charts/log-elasticsearch/templates/configmap.yaml with 100% similarity]
kubernetes/log/components/log-elasticsearch/templates/deployment.yaml [moved from kubernetes/log/charts/log-elasticsearch/templates/deployment.yaml with 94% similarity]
kubernetes/log/components/log-elasticsearch/templates/ingress.yaml [moved from kubernetes/log/charts/log-elasticsearch/templates/ingress.yaml with 100% similarity]
kubernetes/log/components/log-elasticsearch/templates/pv.yaml [moved from kubernetes/log/charts/log-elasticsearch/templates/pv.yaml with 100% similarity]
kubernetes/log/components/log-elasticsearch/templates/pvc.yaml [moved from kubernetes/log/charts/log-elasticsearch/templates/pvc.yaml with 100% similarity]
kubernetes/log/components/log-elasticsearch/templates/service.yaml [moved from kubernetes/log/charts/log-elasticsearch/templates/service.yaml with 100% similarity]
kubernetes/log/components/log-elasticsearch/values.yaml [moved from kubernetes/log/charts/log-elasticsearch/values.yaml with 93% similarity]
kubernetes/log/components/log-kibana/Chart.yaml [moved from kubernetes/log/charts/log-kibana/Chart.yaml with 100% similarity]
kubernetes/log/components/log-kibana/requirements.yaml [moved from kubernetes/log/charts/log-elasticsearch/requirements.yaml with 90% similarity]
kubernetes/log/components/log-kibana/resources/config/README.txt [moved from kubernetes/log/charts/log-kibana/resources/config/README.txt with 100% similarity]
kubernetes/log/components/log-kibana/resources/config/kibana-onboarding.json [moved from kubernetes/log/charts/log-kibana/resources/config/kibana-onboarding.json with 100% similarity]
kubernetes/log/components/log-kibana/resources/config/kibana.yml [moved from kubernetes/log/charts/log-kibana/resources/config/kibana.yml with 100% similarity]
kubernetes/log/components/log-kibana/templates/NOTES.txt [moved from kubernetes/log/charts/log-kibana/templates/NOTES.txt with 100% similarity]
kubernetes/log/components/log-kibana/templates/configmap.yaml [moved from kubernetes/log/charts/log-kibana/templates/configmap.yaml with 100% similarity]
kubernetes/log/components/log-kibana/templates/deployment.yaml [moved from kubernetes/log/charts/log-kibana/templates/deployment.yaml with 92% similarity]
kubernetes/log/components/log-kibana/templates/ingress.yaml [moved from kubernetes/log/charts/log-kibana/templates/ingress.yaml with 100% similarity]
kubernetes/log/components/log-kibana/templates/service.yaml [moved from kubernetes/log/charts/log-kibana/templates/service.yaml with 100% similarity]
kubernetes/log/components/log-kibana/values.yaml [moved from kubernetes/log/charts/log-kibana/values.yaml with 92% similarity]
kubernetes/log/components/log-logstash/Chart.yaml [moved from kubernetes/log/charts/log-logstash/Chart.yaml with 100% similarity]
kubernetes/log/components/log-logstash/requirements.yaml [moved from kubernetes/log/charts/log-kibana/requirements.yaml with 90% similarity]
kubernetes/log/components/log-logstash/resources/config/logstash.yml [moved from kubernetes/log/charts/log-logstash/resources/config/logstash.yml with 100% similarity]
kubernetes/log/components/log-logstash/resources/config/onap-pipeline.conf [moved from kubernetes/log/charts/log-logstash/resources/config/onap-pipeline.conf with 100% similarity]
kubernetes/log/components/log-logstash/templates/NOTES.txt [moved from kubernetes/log/charts/log-logstash/templates/NOTES.txt with 100% similarity]
kubernetes/log/components/log-logstash/templates/configmap.yaml [moved from kubernetes/log/charts/log-logstash/templates/configmap.yaml with 100% similarity]
kubernetes/log/components/log-logstash/templates/deployment.yaml [moved from kubernetes/log/charts/log-logstash/templates/deployment.yaml with 94% similarity]
kubernetes/log/components/log-logstash/templates/ingress.yaml [moved from kubernetes/log/charts/log-logstash/templates/ingress.yaml with 100% similarity]
kubernetes/log/components/log-logstash/templates/service.yaml [moved from kubernetes/log/charts/log-logstash/templates/service.yaml with 100% similarity]
kubernetes/log/components/log-logstash/values.yaml [moved from kubernetes/log/charts/log-logstash/values.yaml with 96% similarity]
kubernetes/log/requirements.yaml
kubernetes/log/values.yaml

diff --git a/kubernetes/log/Makefile b/kubernetes/log/Makefile
new file mode 100644 (file)
index 0000000..89b2f46
--- /dev/null
@@ -0,0 +1,56 @@
+# 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 */.))))
+HELM_VER := $(shell $(HELM_BIN) version --template "{{.Version}}")
+
+.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)
+ifeq "$(findstring v3,$(HELM_VER))" "v3"
+       @if [ -f $*/Chart.yaml ]; then PACKAGE_NAME=$$($(HELM_BIN) package -d $(PACKAGE_DIR) $* | cut -d":" -f2) && $(HELM_BIN) push -f $$PACKAGE_NAME local; fi
+else
+       @if [ -f $*/Chart.yaml ]; then $(HELM_BIN) package -d $(PACKAGE_DIR) $*; fi
+endif
+       @$(HELM_BIN) repo index $(PACKAGE_DIR)
+
+clean:
+       @rm -f */requirements.lock
+       @rm -f *tgz */charts/*tgz
+       @rm -rf $(PACKAGE_DIR)
+%:
+       @:
diff --git a/kubernetes/log/components/Makefile b/kubernetes/log/components/Makefile
new file mode 100644 (file)
index 0000000..d62cb0b
--- /dev/null
@@ -0,0 +1,56 @@
+# 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 */.))))
+HELM_VER := $(shell $(HELM_BIN) version --template "{{.Version}}")
+
+.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)
+ifeq "$(findstring v3,$(HELM_VER))" "v3"
+       @if [ -f $*/Chart.yaml ]; then PACKAGE_NAME=$$($(HELM_BIN) package -d $(PACKAGE_DIR) $* | cut -d":" -f2) && $(HELM_BIN) push -f $$PACKAGE_NAME local; fi
+else
+       @if [ -f $*/Chart.yaml ]; then $(HELM_BIN) package -d $(PACKAGE_DIR) $*; fi
+endif
+       @$(HELM_BIN) repo index $(PACKAGE_DIR)
+
+clean:
+       @rm -f */requirements.lock
+       @rm -f *tgz */charts/*tgz
+       @rm -rf $(PACKAGE_DIR)
+%:
+       @:
@@ -17,3 +17,6 @@ dependencies:
   - name: common
     version: ~6.x-0
     repository: '@local'
+  - name: repositoryGenerator
+    version: ~6.x-0
+    repository: '@local'
@@ -15,7 +15,7 @@
 # limitations under the License.
 */}}
 
-apiVersion: extensions/v1beta1
+apiVersion: apps/v1
 kind: Deployment
 metadata:
   name: {{ include "common.fullname" . }}
@@ -51,7 +51,7 @@ spec:
               fieldPath: metadata.namespace
         securityContext:
           privileged: true
-        image: {{ .Values.global.busyboxRepository | default .Values.busyboxRepository }}/{{ .Values.busyboxImage }}
+        image: {{ include "repositoryGenerator.image.busybox" . }}
         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
         name: init-sysctl
         volumeMounts:
@@ -59,7 +59,7 @@ spec:
           mountPath: /logroot/
       containers:
         - name: {{ include "common.name" . }}
-          image: "{{ .Values.global.loggingRepository | default .Values.loggingRepository }}/{{ .Values.image }}"
+          image: {{ include "repositoryGenerator.elasticRepository" . }}/{{ .Values.image }}
           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
           resources:
 {{ include "common.resources" . | indent 12 }}
 #################################################################
 global:
   nodePortPrefix: 302
-  loggingRepository: docker.elastic.co
-  loggingImage: beats/filebeat:5.5.0
   persistence: {}
 
 #################################################################
 # Application configuration defaults.
 #################################################################
 
-# BusyBox image
-busyboxRepository: docker.io
-busyboxImage: library/busybox:latest
-
 # application image
-loggingRepository: docker.elastic.co
 image: elasticsearch/elasticsearch:5.5.0
 pullPolicy: Always
 
@@ -17,3 +17,6 @@ dependencies:
   - name: common
     version: ~6.x-0
     repository: '@local'
+  - name: repositoryGenerator
+    version: ~6.x-0
+    repository: '@local'
@@ -15,7 +15,7 @@
 # limitations under the License.
 */}}
 
-apiVersion: extensions/v1beta1
+apiVersion: apps/v1
 kind: Deployment
 metadata:
   name: {{ include "common.fullname" . }}
@@ -45,7 +45,7 @@ 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
       - args:
@@ -57,7 +57,7 @@ spec:
             fieldRef:
               apiVersion: v1
               fieldPath: metadata.namespace
-        image: "{{ .Values.elasticdumpRepository }}/{{ .Values.elasticdumpImage }}"
+        image: {{ include "repositoryGenerator.dockerHubRepository" . }}/{{ .Values.elasticdumpImage }}
         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
         name: {{ include "common.name" . }}-elasticdump
         volumeMounts:
@@ -66,7 +66,7 @@ spec:
             subPath: kibana-onboarding.json
       containers:
         - name: {{ include "common.name" . }}
-          image: "{{ .Values.global.loggingRepository | default .Values.loggingRepository }}/{{ .Values.image }}"
+          image: {{ include "repositoryGenerator.elasticRepository" . }}/{{ .Values.image }}
           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
           resources:
 {{ include "common.resources" . | indent 12 }}
@@ -18,7 +18,6 @@
 #################################################################
 global:
   nodePortPrefix: 302
-  readinessImage: onap/oom/readiness:3.0.1
   persistence: {}
 
 #################################################################
@@ -26,15 +25,9 @@ global:
 #################################################################
 
 # Elasticdump image
-elasticdumpRepository: docker.io
 elasticdumpImage: taskrabbit/elasticsearch-dump
 
-# BusyBox image
-busyboxRepository: docker.io
-busyboxImage: library/busybox:latest
-
 # application image
-loggingRepository: docker.elastic.co
 image: kibana/kibana:5.5.0
 pullPolicy: Always
 
@@ -17,3 +17,6 @@ dependencies:
   - name: common
     version: ~6.x-0
     repository: '@local'
+  - name: repositoryGenerator
+    version: ~6.x-0
+    repository: '@local'
@@ -15,7 +15,7 @@
 # limitations under the License.
 */}}
 
-apiVersion: extensions/v1beta1
+apiVersion: apps/v1
 kind: Deployment
 metadata:
   name: {{ include "common.fullname" . }}
@@ -45,12 +45,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: "{{ .Values.global.loggingRepository| default .Values.loggingRepository }}/{{ .Values.image }}"
+          image: {{ include "repositoryGenerator.elasticRepository" . }}/{{ .Values.image }}
           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
           resources:
 {{ include "common.resources" . | indent 12 }}
@@ -18,7 +18,6 @@
 #################################################################
 global:
   nodePortPrefix: 302
-  readinessImage: onap/oom/readiness:3.0.1
   persistence: {}
 
 #################################################################
@@ -26,7 +25,6 @@ global:
 #################################################################
 
 # application image
-loggingRepository: docker.elastic.co
 image: logstash/logstash:5.4.3
 pullPolicy: Always
 
index a7089ea..ae81fc8 100644 (file)
@@ -16,3 +16,16 @@ dependencies:
   - name: common
     version: ~6.x-0
     repository: '@local'
+  - name: repositoryGenerator
+    version: ~6.x-0
+    repository: '@local'
+  - name: log-elasticsearch
+    version: ~6.x-0
+    repository: 'file://components/log-elasticsearch'
+  - name: log-kibana
+    version: ~6.x-0
+    repository: 'file://components/log-kibana'
+  - name: log-logstash
+    version: ~6.x-0
+    repository: 'file://components/log-logstash'
+
index bb41a87..ddcf523 100644 (file)
@@ -18,4 +18,3 @@
 #################################################################
 global:
   nodePortPrefix: 302
-  readinessImage: onap/oom/readiness:3.0.1