From 0e8f8899ca6fdc589316c59f90f8f7283bbfad49 Mon Sep 17 00:00:00 2001 From: Mandeep Khinda Date: Fri, 25 Aug 2017 03:31:17 +0000 Subject: refactor helm files to use namespace prefix -removed the full namespace from each template. better lets us reuse variables. -made secret end up in a configurable namespace -fixed some bugs where secrets were missing -updated createAll and delete to make use of namespace prefix removing the need for seds to replace the word onap. *** all containers at this point come up in my env. except for aai model loader which is failing cause its still at 1.0 and its trying to talk to a 1.1 sdc and it doesnt auth properly. *** Issue-ID:OOM-215 Change-Id: I15815a01469786a391e272fde4bdaa53ff48091c Signed-off-by: Mandeep Khinda --- kubernetes/portal/templates/all-services.yaml | 8 +++--- .../portal/templates/portal-apps-deployment.yaml | 32 +++++++++++----------- .../templates/portal-mariadb-deployment.yaml | 8 +++--- kubernetes/portal/templates/portal-vnc-dep.yaml | 13 ++++----- .../templates/portal-widgets-deployment.yaml | 6 ++-- kubernetes/portal/values.yaml | 2 +- 6 files changed, 35 insertions(+), 34 deletions(-) (limited to 'kubernetes/portal') diff --git a/kubernetes/portal/templates/all-services.yaml b/kubernetes/portal/templates/all-services.yaml index 488fb8045c..2107e2a30b 100644 --- a/kubernetes/portal/templates/all-services.yaml +++ b/kubernetes/portal/templates/all-services.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: Service metadata: name: portaldb - namespace: {{ .Values.NS }} + namespace: "{{ .Values.nsPrefix }}-portal" labels: app: portaldb spec: @@ -19,7 +19,7 @@ metadata: labels: app: portalapps name: portalapps - namespace: {{ .Values.NS }} + namespace: "{{ .Values.nsPrefix }}-portal" spec: ports: - name: portal-1 @@ -44,7 +44,7 @@ metadata: labels: app: vnc-portal name: vnc-portal - namespace: {{ .Values.NS }} + namespace: "{{ .Values.nsPrefix }}-portal" spec: ports: - name: tcp-1 @@ -63,7 +63,7 @@ apiVersion: v1 kind: Service metadata: name: portalwidgets - namespace: {{ .Values.NS }} + namespace: "{{ .Values.nsPrefix }}-portal" labels: app: portalwidgets spec: diff --git a/kubernetes/portal/templates/portal-apps-deployment.yaml b/kubernetes/portal/templates/portal-apps-deployment.yaml index 23a645910a..a0818fab1b 100755 --- a/kubernetes/portal/templates/portal-apps-deployment.yaml +++ b/kubernetes/portal/templates/portal-apps-deployment.yaml @@ -2,7 +2,7 @@ apiVersion: extensions/v1beta1 kind: Deployment metadata: name: portalapps - namespace: {{ .Values.NS }} + namespace: "{{ .Values.nsPrefix }}-portal" spec: selector: matchLabels: @@ -102,45 +102,45 @@ spec: volumes: - name: portal-fusion-properties hostPath: - path: /dockerdata-nfs/onap/portal/portal-fe/webapps/etc/ECOMPPORTALAPP/fusion.properties + path: /dockerdata-nfs/{{ .Values.nsPrefix }}/portal/portal-fe/webapps/etc/ECOMPPORTALAPP/fusion.properties - name: portal-openid-connect-properties hostPath: - path: /dockerdata-nfs/onap/portal/portal-fe/webapps/etc/ECOMPPORTALAPP/openid-connect.properties + path: /dockerdata-nfs/{{ .Values.nsPrefix }}/portal/portal-fe/webapps/etc/ECOMPPORTALAPP/openid-connect.properties - name: portal-system-properties hostPath: - path: /dockerdata-nfs/onap/portal/portal-fe/webapps/etc/ECOMPPORTALAPP/system.properties + path: /dockerdata-nfs/{{ .Values.nsPrefix }}/portal/portal-fe/webapps/etc/ECOMPPORTALAPP/system.properties - name: portal-portal-properties hostPath: - path: /dockerdata-nfs/onap/portal/portal-fe/webapps/etc/ECOMPPORTALAPP/portal.properties + path: /dockerdata-nfs/{{ .Values.nsPrefix }}/portal/portal-fe/webapps/etc/ECOMPPORTALAPP/portal.properties - name: dbcapp-fusion-properties hostPath: - path: /dockerdata-nfs/onap/portal/portal-fe/webapps/etc/ECOMPDBCAPP/fusion.properties + path: /dockerdata-nfs/{{ .Values.nsPrefix }}/portal/portal-fe/webapps/etc/ECOMPDBCAPP/fusion.properties - name: dbcapp-system-properties hostPath: - path: /dockerdata-nfs/onap/portal/portal-fe/webapps/etc/ECOMPDBCAPP/system.properties + path: /dockerdata-nfs/{{ .Values.nsPrefix }}/portal/portal-fe/webapps/etc/ECOMPDBCAPP/system.properties - name: dbcapp-portal-properties hostPath: - path: /dockerdata-nfs/onap/portal/portal-fe/webapps/etc/ECOMPDBCAPP/portal.properties + path: /dockerdata-nfs/{{ .Values.nsPrefix }}/portal/portal-fe/webapps/etc/ECOMPDBCAPP/portal.properties - name: dbcapp-dbcapp-properties hostPath: - path: /dockerdata-nfs/onap/portal/portal-fe/webapps/etc/ECOMPDBCAPP/dbcapp.properties + path: /dockerdata-nfs/{{ .Values.nsPrefix }}/portal/portal-fe/webapps/etc/ECOMPDBCAPP/dbcapp.properties - name: sdkapp-system-properties hostPath: - path: /dockerdata-nfs/onap/portal/portal-fe/webapps/etc/ECOMPSDKAPP/system.properties + path: /dockerdata-nfs/{{ .Values.nsPrefix }}/portal/portal-fe/webapps/etc/ECOMPSDKAPP/system.properties - name: sdkapp-portal-properties hostPath: - path: /dockerdata-nfs/onap/portal/portal-fe/webapps/etc/ECOMPSDKAPP/portal.properties + path: /dockerdata-nfs/{{ .Values.nsPrefix }}/portal/portal-fe/webapps/etc/ECOMPSDKAPP/portal.properties - name: sdkapp-fusion-properties hostPath: - path: /dockerdata-nfs/onap/portal/portal-fe/webapps/etc/ECOMPSDKAPP/fusion.properties + path: /dockerdata-nfs/{{ .Values.nsPrefix }}/portal/portal-fe/webapps/etc/ECOMPSDKAPP/fusion.properties - name: portal-mariadb-onboarding-sql hostPath: - path: /dockerdata-nfs/onap/portal/mariadb/oom_updates.sql + path: /dockerdata-nfs/{{ .Values.nsPrefix }}/portal/mariadb/oom_updates.sql - name: portal-root hostPath: - path: /dockerdata-nfs/onap/portal + path: /dockerdata-nfs/{{ .Values.nsPrefix }}/portal - name: portal-logs hostPath: - path: /dockerdata-nfs/onap/portal/logs + path: /dockerdata-nfs/{{ .Values.nsPrefix }}/portal/logs imagePullSecrets: - - name: onap-docker-registry-key + - name: "{{ .Values.nsPrefix }}-docker-registry-key" diff --git a/kubernetes/portal/templates/portal-mariadb-deployment.yaml b/kubernetes/portal/templates/portal-mariadb-deployment.yaml index cf8bbd68e0..a31c6a24b2 100755 --- a/kubernetes/portal/templates/portal-mariadb-deployment.yaml +++ b/kubernetes/portal/templates/portal-mariadb-deployment.yaml @@ -2,7 +2,7 @@ apiVersion: extensions/v1beta1 kind: Deployment metadata: name: portaldb - namespace: {{ .Values.NS }} + namespace: "{{ .Values.nsPrefix }}-portal" spec: selector: matchLabels: @@ -19,7 +19,7 @@ spec: name: "portaldb" env: - name: MYSQL_HOST - value: portaldb.onap-portal + value: "portaldb.{{ .Values.nsPrefix }}-portal" - name: MYSQL_ROOT_PASSWORD value: password volumeMounts: @@ -36,6 +36,6 @@ spec: volumes: - name: portal-mariadb-data hostPath: - path: /dockerdata-nfs/onap/portal/mariadb/data + path: /dockerdata-nfs/{{ .Values.nsPrefix }}/portal/mariadb/data imagePullSecrets: - - name: onap-docker-registry-key + - name: "{{ .Values.nsPrefix }}-docker-registry-key" diff --git a/kubernetes/portal/templates/portal-vnc-dep.yaml b/kubernetes/portal/templates/portal-vnc-dep.yaml index e4a8574458..fb7bd93e44 100644 --- a/kubernetes/portal/templates/portal-vnc-dep.yaml +++ b/kubernetes/portal/templates/portal-vnc-dep.yaml @@ -4,7 +4,7 @@ metadata: labels: app: vnc-portal name: vnc-portal - namespace: {{ .Values.NS }} + namespace: "{{ .Values.nsPrefix }}-portal" spec: selector: matchLabels: @@ -50,7 +50,7 @@ spec: "env": [ { "name": "NAMESPACE", - "value": "onap-policy" + "value": "{{ .Values.nsPrefix }}-policy" } ], "image": "{{ .Values.image.readiness }}", @@ -68,7 +68,7 @@ spec: "env": [ { "name": "NAMESPACE", - "value": "onap-sdc" + "value": "{{ .Values.nsPrefix }}-sdc" } ], "image": "{{ .Values.image.readiness }}", @@ -86,7 +86,7 @@ spec: "env": [ { "name": "NAMESPACE", - "value": "onap-vid" + "value": "{{ .Values.nsPrefix }}-vid" } ], "image": "{{ .Values.image.readiness }}", @@ -95,7 +95,7 @@ spec: }, { "command": ["/bin/sh","-c"], - "args": ["echo `host sdc-be.onap-sdc | awk ''{print$4}''` sdc.api.be.simpledemo.openecomp.org >> /ubuntu-init/hosts; echo `host portalapps.onap-portal | awk ''{print$4}''` portal.api.simpledemo.openecomp.org >> /ubuntu-init/hosts; echo `host pap.onap-policy | awk ''{print$4}''` policy.api.simpledemo.openecomp.org >> /ubuntu-init/hosts; echo `host sdc-fe.onap-sdc | awk ''{print$4}''` sdc.ui.simpledemo.openecomp.org >> /ubuntu-init/hosts; echo `host vid-server.onap-vid | awk ''{print$4}''` vid.api.simpledemo.openecomp.org >> /ubuntu-init/hosts; echo `host sparky-fe.onap-aai | awk ''{print$4}''` aai.api.simpledemo.openecomp.org >> /ubuntu-init/hosts"], + "args": ["echo `host sdc-be.{{ .Values.nsPrefix }}-sdc | awk ''{print$4}''` sdc.api.be.simpledemo.openecomp.org >> /ubuntu-init/hosts; echo `host portalapps.{{ .Values.nsPrefix }}-portal | awk ''{print$4}''` portal.api.simpledemo.openecomp.org >> /ubuntu-init/hosts; echo `host pap.{{ .Values.nsPrefix }}-policy | awk ''{print$4}''` policy.api.simpledemo.openecomp.org >> /ubuntu-init/hosts; echo `host sdc-fe.{{ .Values.nsPrefix }}-sdc | awk ''{print$4}''` sdc.ui.simpledemo.openecomp.org >> /ubuntu-init/hosts; echo `host vid-server.{{ .Values.nsPrefix }}-vid | awk ''{print$4}''` vid.api.simpledemo.openecomp.org >> /ubuntu-init/hosts; echo `host sparky-fe.{{ .Values.nsPrefix }}-aai | awk ''{print$4}''` aai.api.simpledemo.openecomp.org >> /ubuntu-init/hosts"], "image": "{{ .Values.image.ubuntuInit }}", "imagePullPolicy": "{{ .Values.pullPolicy }}", "name": "vnc-init-hosts", @@ -118,7 +118,6 @@ spec: env: - name: VNC_PASSWORD value: password - imagePullPolicy: IfNotPresent name: vnc-portal volumeMounts: - mountPath: /ubuntu-init/ @@ -130,4 +129,4 @@ spec: - name: ubuntu-init emptyDir: {} imagePullSecrets: - - name: onap-docker-registry-key + - name: "{{ .Values.nsPrefix }}-docker-registry-key" diff --git a/kubernetes/portal/templates/portal-widgets-deployment.yaml b/kubernetes/portal/templates/portal-widgets-deployment.yaml index 0aea75648c..5b020e5865 100644 --- a/kubernetes/portal/templates/portal-widgets-deployment.yaml +++ b/kubernetes/portal/templates/portal-widgets-deployment.yaml @@ -2,7 +2,7 @@ apiVersion: extensions/v1beta1 kind: Deployment metadata: name: portalwidgets - namespace: {{ .Values.NS }} + namespace: "{{ .Values.nsPrefix }}-portal" spec: selector: matchLabels: @@ -56,4 +56,6 @@ spec: volumes: - name: portalwidgets-application-properties hostPath: - path: /dockerdata-nfs/onap/portal/portal-fe/webapps/etc/ECOMPWIDGETMS/application.properties + path: /dockerdata-nfs/{{ .Values.nsPrefix }}/portal/portal-fe/webapps/etc/ECOMPWIDGETMS/application.properties + imagePullSecrets: + - name: "{{ .Values.nsPrefix }}-docker-registry-key" \ No newline at end of file diff --git a/kubernetes/portal/values.yaml b/kubernetes/portal/values.yaml index b88b644a08..ae9479e03a 100644 --- a/kubernetes/portal/values.yaml +++ b/kubernetes/portal/values.yaml @@ -1,4 +1,4 @@ -NS: onap-portal +nsPrefix: onap pullPolicy: Always image: readiness: oomk8s/readiness-check:1.0.0 -- cgit 1.2.3-korg