From cbac010dec8633718531423ebe4e3ede0005d36f Mon Sep 17 00:00:00 2001 From: kerenj Date: Wed, 23 Aug 2017 10:22:33 +0000 Subject: portal K8S-Helm Parameterization changed portal k8s deployment to support helm parameterization Issue-ID: OOM-52 Change-Id: I8ad9681b597a87113089f194e1a0e8a9e550bb08 Signed-off-by: kerenj --- kubernetes/oneclick/setenv.bash | 4 +- kubernetes/portal/.helmignore | 6 + kubernetes/portal/Chart.yaml | 4 + kubernetes/portal/all-services.yaml | 71 ---------- kubernetes/portal/portal-apps-deployment.yaml | 144 -------------------- kubernetes/portal/portal-mariadb-deployment.yaml | 39 ------ kubernetes/portal/portal-vnc-dep.yaml | 131 ------------------ kubernetes/portal/portal-widgets-deployment.yaml | 57 -------- kubernetes/portal/templates/all-services.yaml | 75 +++++++++++ .../portal/templates/portal-apps-deployment.yaml | 146 +++++++++++++++++++++ .../templates/portal-mariadb-deployment.yaml | 41 ++++++ kubernetes/portal/templates/portal-vnc-dep.yaml | 133 +++++++++++++++++++ .../templates/portal-widgets-deployment.yaml | 59 +++++++++ kubernetes/portal/values.yaml | 10 ++ 14 files changed, 476 insertions(+), 444 deletions(-) create mode 100644 kubernetes/portal/.helmignore create mode 100644 kubernetes/portal/Chart.yaml delete mode 100644 kubernetes/portal/all-services.yaml delete mode 100755 kubernetes/portal/portal-apps-deployment.yaml delete mode 100755 kubernetes/portal/portal-mariadb-deployment.yaml delete mode 100644 kubernetes/portal/portal-vnc-dep.yaml delete mode 100644 kubernetes/portal/portal-widgets-deployment.yaml create mode 100644 kubernetes/portal/templates/all-services.yaml create mode 100755 kubernetes/portal/templates/portal-apps-deployment.yaml create mode 100755 kubernetes/portal/templates/portal-mariadb-deployment.yaml create mode 100644 kubernetes/portal/templates/portal-vnc-dep.yaml create mode 100644 kubernetes/portal/templates/portal-widgets-deployment.yaml create mode 100644 kubernetes/portal/values.yaml diff --git a/kubernetes/oneclick/setenv.bash b/kubernetes/oneclick/setenv.bash index 9b4de9ddce..dd6b22df94 100644 --- a/kubernetes/oneclick/setenv.bash +++ b/kubernetes/oneclick/setenv.bash @@ -1,7 +1,7 @@ #!/bin/bash -HELM_APPS=('mso' 'message-router' 'sdnc' 'vid' 'robot') -ONAP_APPS=('sdc' 'aai' 'portal' 'policy' 'appc') +HELM_APPS=('mso' 'message-router' 'sdnc' 'vid' 'robot' 'portal') +ONAP_APPS=('sdc' 'aai' 'policy' 'appc') ONAP_DOCKER_REGISTRY_KEY=${ONAP_DOCKER_REGISTRY_KEY:-onap-docker-registry-key} ONAP_DOCKER_REGISTRY=${ONAP_DOCKER_REGISTRY:-nexus3.onap.org:10001} ONAP_DOCKER_USER=${ONAP_DOCKER_USER:-docker} diff --git a/kubernetes/portal/.helmignore b/kubernetes/portal/.helmignore new file mode 100644 index 0000000000..dd5be16eb7 --- /dev/null +++ b/kubernetes/portal/.helmignore @@ -0,0 +1,6 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. + +# docker folder +docker/ diff --git a/kubernetes/portal/Chart.yaml b/kubernetes/portal/Chart.yaml new file mode 100644 index 0000000000..706a4f4816 --- /dev/null +++ b/kubernetes/portal/Chart.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +description: A Helm chart for Kubernetes +name: portal +version: 0.1.0 diff --git a/kubernetes/portal/all-services.yaml b/kubernetes/portal/all-services.yaml deleted file mode 100644 index 0cb5947535..0000000000 --- a/kubernetes/portal/all-services.yaml +++ /dev/null @@ -1,71 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: portaldb - labels: - app: portaldb -spec: - ports: - - name: portaldb - port: 3306 - selector: - app: portaldb - clusterIP: None ---- -apiVersion: v1 -kind: Service -metadata: - labels: - app: portalapps - name: portalapps -spec: - ports: - - name: portal-1 - nodePort: 30213 - port: 8006 - targetPort: 8005 - - name: portal-2 - nodePort: 30214 - port: 8010 - targetPort: 8009 - - name: portal-3 - nodePort: 30215 - port: 8989 - targetPort: 8080 - selector: - app: portalapps - type: NodePort ---- -apiVersion: v1 -kind: Service -metadata: - labels: - app: vnc-portal - name: vnc-portal -spec: - ports: - - name: tcp-1 - port: 6080 - targetPort: 80 - nodePort: 30211 - - name: tcp-2 - port: 5900 - targetPort: 5900 - nodePort: 30212 - selector: - app: vnc-portal - type: NodePort ---- -apiVersion: v1 -kind: Service -metadata: - name: portalwidgets - labels: - app: portalwidgets -spec: - ports: - - name: portalwidgets - port: 8082 - selector: - app: portalwidgets - clusterIP: None diff --git a/kubernetes/portal/portal-apps-deployment.yaml b/kubernetes/portal/portal-apps-deployment.yaml deleted file mode 100755 index c9ed3e7a6a..0000000000 --- a/kubernetes/portal/portal-apps-deployment.yaml +++ /dev/null @@ -1,144 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: portalapps -spec: - selector: - matchLabels: - app: portalapps - template: - metadata: - labels: - app: portalapps - name: portalapps - annotations: - pod.beta.kubernetes.io/init-containers: '[ - { - "args": [ - "--container-name", - "portaldb" - ], - "command": [ - "/root/ready.py" - ], - "env": [ - { - "name": "NAMESPACE", - "valueFrom": { - "fieldRef": { - "apiVersion": "v1", - "fieldPath": "metadata.namespace" - } - } - } - ], - "image": "oomk8s/readiness-check:1.0.0", - "imagePullPolicy": "Always", - "name": "portalapps-readiness" - }, - { - "command": ["/bin/bash", "-c", "if [ ! -e /portal_root/boot.txt ]; then mysql -u root -ppassword -h portaldb < /portal-mysql/oom_updates.sql; fi"], - "volumeMounts": [ - { - "mountPath": "/portal-mysql/oom_updates.sql", - "name": "portal-mariadb-onboarding-sql" - }, - { - "mountPath": "/portal_root/", - "name": "portal-root" - } - ], - "image": "oomk8s/mariadb-client-init:1.0.0", - "imagePullPolicy": "Always", - "name": "provision-portaldb-users" - } - ]' - spec: - containers: - - image: nexus3.onap.org:10001/openecomp/portalapps:1.1-STAGING-latest - lifecycle: - postStart: - exec: - command: ["/bin/sh", "-c", "echo yes > /portal_root/boot.txt"] - name: portalapps - volumeMounts: - - mountPath: /opt/apache-tomcat-8.0.37/webapps/ECOMPPORTAL/WEB-INF/fusion/conf/fusion.properties - name: portal-fusion-properties - - mountPath: /opt/apache-tomcat-8.0.37/webapps/ECOMPPORTAL/WEB-INF/classes/openid-connect.properties - name: portal-openid-connect-properties - - mountPath: /opt/apache-tomcat-8.0.37/webapps/ECOMPPORTAL/WEB-INF/conf/system.properties - name: portal-system-properties - - mountPath: /opt/apache-tomcat-8.0.37/webapps/ECOMPPORTAL/WEB-INF/classes/portal.properties - name: portal-portal-properties - - mountPath: /opt/apache-tomcat-8.0.37/webapps/ECOMPDBCAPP/WEB-INF/fusion/conf/fusion.properties - name: dbcapp-fusion-properties - - mountPath: /opt/apache-tomcat-8.0.37/webapps/ECOMPDBCAPP/WEB-INF/conf/system.properties - name: dbcapp-system-properties - - mountPath: /opt/apache-tomcat-8.0.37/webapps/ECOMPDBCAPP/WEB-INF/classes/portal.properties - name: dbcapp-portal-properties - - mountPath: /opt/apache-tomcat-8.0.37/webapps/ECOMPDBCAPP/WEB-INF/dbcapp/dbcapp.properties - name: dbcapp-dbcapp-properties - - mountPath: /opt/apache-tomcat-8.0.37/webapps/ECOMPSDKAPP/WEB-INF/conf/system.properties - name: sdkapp-system-properties - - mountPath: /opt/apache-tomcat-8.0.37/webapps/ECOMPSDKAPP/WEB-INF/classes/portal.properties - name: sdkapp-portal-properties - - mountPath: /opt/apache-tomcat-8.0.37/webapps/ECOMPSDKAPP/WEB-INF/fusion/conf/fusion.properties - name: sdkapp-fusion-properties - - mountPath: /portal_root/ - name: portal-root - - mountPath: /opt/apache-tomcat-8.0.37/logs - name: portal-logs - ports: - - containerPort: 8005 - - containerPort: 8009 - - containerPort: 8080 - readinessProbe: - tcpSocket: - port: 8080 - initialDelaySeconds: 5 - periodSeconds: 10 - volumes: - - name: portal-fusion-properties - hostPath: - path: /dockerdata-nfs/onapdemo/portal/portal-fe/webapps/etc/ECOMPPORTALAPP/fusion.properties - - name: portal-openid-connect-properties - hostPath: - path: /dockerdata-nfs/onapdemo/portal/portal-fe/webapps/etc/ECOMPPORTALAPP/openid-connect.properties - - name: portal-system-properties - hostPath: - path: /dockerdata-nfs/onapdemo/portal/portal-fe/webapps/etc/ECOMPPORTALAPP/system.properties - - name: portal-portal-properties - hostPath: - path: /dockerdata-nfs/onapdemo/portal/portal-fe/webapps/etc/ECOMPPORTALAPP/portal.properties - - name: dbcapp-fusion-properties - hostPath: - path: /dockerdata-nfs/onapdemo/portal/portal-fe/webapps/etc/ECOMPDBCAPP/fusion.properties - - name: dbcapp-system-properties - hostPath: - path: /dockerdata-nfs/onapdemo/portal/portal-fe/webapps/etc/ECOMPDBCAPP/system.properties - - name: dbcapp-portal-properties - hostPath: - path: /dockerdata-nfs/onapdemo/portal/portal-fe/webapps/etc/ECOMPDBCAPP/portal.properties - - name: dbcapp-dbcapp-properties - hostPath: - path: /dockerdata-nfs/onapdemo/portal/portal-fe/webapps/etc/ECOMPDBCAPP/dbcapp.properties - - name: sdkapp-system-properties - hostPath: - path: /dockerdata-nfs/onapdemo/portal/portal-fe/webapps/etc/ECOMPSDKAPP/system.properties - - name: sdkapp-portal-properties - hostPath: - path: /dockerdata-nfs/onapdemo/portal/portal-fe/webapps/etc/ECOMPSDKAPP/portal.properties - - name: sdkapp-fusion-properties - hostPath: - path: /dockerdata-nfs/onapdemo/portal/portal-fe/webapps/etc/ECOMPSDKAPP/fusion.properties - - name: portal-mariadb-onboarding-sql - hostPath: - path: /dockerdata-nfs/onapdemo/portal/mariadb/oom_updates.sql - - name: portal-root - hostPath: - path: /dockerdata-nfs/onapdemo/portal - - name: portal-logs - hostPath: - path: /dockerdata-nfs/onapdemo/portal/logs - imagePullSecrets: - - name: onap-docker-registry-key diff --git a/kubernetes/portal/portal-mariadb-deployment.yaml b/kubernetes/portal/portal-mariadb-deployment.yaml deleted file mode 100755 index 42481fd8b4..0000000000 --- a/kubernetes/portal/portal-mariadb-deployment.yaml +++ /dev/null @@ -1,39 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: portaldb -spec: - selector: - matchLabels: - app: portaldb - template: - metadata: - labels: - app: portaldb - name: portaldb - spec: - containers: - - image: nexus3.onap.org:10001/openecomp/portaldb:1.1-STAGING-latest - name: "portaldb" - env: - - name: MYSQL_HOST - value: portaldb.onap-portal - - name: MYSQL_ROOT_PASSWORD - value: password - volumeMounts: - - mountPath: /var/lib/mysql - name: portal-mariadb-data - ports: - - containerPort: 3306 - name: portaldb - readinessProbe: - tcpSocket: - port: 3306 - initialDelaySeconds: 5 - periodSeconds: 10 - volumes: - - name: portal-mariadb-data - hostPath: - path: /dockerdata-nfs/onapdemo/portal/mariadb/data - imagePullSecrets: - - name: onap-docker-registry-key diff --git a/kubernetes/portal/portal-vnc-dep.yaml b/kubernetes/portal/portal-vnc-dep.yaml deleted file mode 100644 index f475865ee6..0000000000 --- a/kubernetes/portal/portal-vnc-dep.yaml +++ /dev/null @@ -1,131 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - labels: - app: vnc-portal - name: vnc-portal -spec: - selector: - matchLabels: - app: vnc-portal - template: - metadata: - labels: - app: vnc-portal - name: vnc-portal - annotations: - pod.beta.kubernetes.io/init-containers: '[ - { - "args": [ - "--container-name", - "portalapps" - ], - "command": [ - "/root/ready.py" - ], - "env": [ - { - "name": "NAMESPACE", - "valueFrom": { - "fieldRef": { - "apiVersion": "v1", - "fieldPath": "metadata.namespace" - } - } - } - ], - "image": "oomk8s/readiness-check:1.0.0", - "imagePullPolicy": "Always", - "name": "vnc-portal-readiness" - }, - { - "args": [ - "--container-name", - "pap" - ], - "command": [ - "/root/ready.py" - ], - "env": [ - { - "name": "NAMESPACE", - "value": "onap-policy" - } - ], - "image": "oomk8s/readiness-check:1.0.0", - "imagePullPolicy": "Always", - "name": "vnc-pap-readiness" - }, - { - "args": [ - "--container-name", - "sdc-fe" - ], - "command": [ - "/root/ready.py" - ], - "env": [ - { - "name": "NAMESPACE", - "value": "onap-sdc" - } - ], - "image": "oomk8s/readiness-check:1.0.0", - "imagePullPolicy": "Always", - "name": "vnc-sdc-readiness" - }, - { - "args": [ - "--container-name", - "vid-server" - ], - "command": [ - "/root/ready.py" - ], - "env": [ - { - "name": "NAMESPACE", - "value": "onap-vid" - } - ], - "image": "oomk8s/readiness-check:1.0.0", - "imagePullPolicy": "Always", - "name": "vnc-vid-readiness" - }, - { - "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"], - "image": "oomk8s/ubuntu-init:1.0.0", - "imagePullPolicy": "Always", - "name": "vnc-init-hosts", - "volumeMounts": [ - { - "name": "ubuntu-init", - "mountPath": "/ubuntu-init/" - } - ] - } - ]' - spec: - containers: - - image: dorowu/ubuntu-desktop-lxde-vnc - lifecycle: - postStart: - exec: - command: ["/bin/sh", "-c", "cat /ubuntu-init/hosts >> /etc/hosts"] - env: - - name: VNC_PASSWORD - value: password - imagePullPolicy: IfNotPresent - name: vnc-portal - volumeMounts: - - mountPath: /ubuntu-init/ - name: ubuntu-init - securityContext: - privileged: true - securityContext: {} - volumes: - - name: ubuntu-init - emptyDir: {} - imagePullSecrets: - - name: onap-docker-registry-key diff --git a/kubernetes/portal/portal-widgets-deployment.yaml b/kubernetes/portal/portal-widgets-deployment.yaml deleted file mode 100644 index e170313a1e..0000000000 --- a/kubernetes/portal/portal-widgets-deployment.yaml +++ /dev/null @@ -1,57 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: portalwidgets -spec: - selector: - matchLabels: - app: portalwidgets - template: - metadata: - labels: - app: portalwidgets - name: portalwidgets - annotations: - pod.beta.kubernetes.io/init-containers: '[ - { - "args": [ - "--container-name", - "portaldb" - ], - "command": [ - "/root/ready.py" - ], - "env": [ - { - "name": "NAMESPACE", - "valueFrom": { - "fieldRef": { - "apiVersion": "v1", - "fieldPath": "metadata.namespace" - } - } - } - ], - "image": "oomk8s/readiness-check:1.0.0", - "imagePullPolicy": "Always", - "name": "portalapps-readiness" - } - ]' - spec: - containers: - - image: nexus3.onap.org:10001/openecomp/portalwms:1.1-STAGING-latest - name: portalwidgets - volumeMounts: - - mountPath: /application.properties - name: portalwidgets-application-properties - ports: - - containerPort: 8082 - readinessProbe: - tcpSocket: - port: 8082 - initialDelaySeconds: 5 - periodSeconds: 10 - volumes: - - name: portalwidgets-application-properties - hostPath: - path: /dockerdata-nfs/onapdemo/portal/portal-fe/webapps/etc/ECOMPWIDGETMS/application.properties diff --git a/kubernetes/portal/templates/all-services.yaml b/kubernetes/portal/templates/all-services.yaml new file mode 100644 index 0000000000..488fb8045c --- /dev/null +++ b/kubernetes/portal/templates/all-services.yaml @@ -0,0 +1,75 @@ +apiVersion: v1 +kind: Service +metadata: + name: portaldb + namespace: {{ .Values.NS }} + labels: + app: portaldb +spec: + ports: + - name: portaldb + port: 3306 + selector: + app: portaldb + clusterIP: None +--- +apiVersion: v1 +kind: Service +metadata: + labels: + app: portalapps + name: portalapps + namespace: {{ .Values.NS }} +spec: + ports: + - name: portal-1 + nodePort: 30213 + port: 8006 + targetPort: 8005 + - name: portal-2 + nodePort: 30214 + port: 8010 + targetPort: 8009 + - name: portal-3 + nodePort: 30215 + port: 8989 + targetPort: 8080 + selector: + app: portalapps + type: NodePort +--- +apiVersion: v1 +kind: Service +metadata: + labels: + app: vnc-portal + name: vnc-portal + namespace: {{ .Values.NS }} +spec: + ports: + - name: tcp-1 + port: 6080 + targetPort: 80 + nodePort: 30211 + - name: tcp-2 + port: 5900 + targetPort: 5900 + nodePort: 30212 + selector: + app: vnc-portal + type: NodePort +--- +apiVersion: v1 +kind: Service +metadata: + name: portalwidgets + namespace: {{ .Values.NS }} + labels: + app: portalwidgets +spec: + ports: + - name: portalwidgets + port: 8082 + selector: + app: portalwidgets + clusterIP: None diff --git a/kubernetes/portal/templates/portal-apps-deployment.yaml b/kubernetes/portal/templates/portal-apps-deployment.yaml new file mode 100755 index 0000000000..23a645910a --- /dev/null +++ b/kubernetes/portal/templates/portal-apps-deployment.yaml @@ -0,0 +1,146 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: portalapps + namespace: {{ .Values.NS }} +spec: + selector: + matchLabels: + app: portalapps + template: + metadata: + labels: + app: portalapps + name: portalapps + annotations: + pod.beta.kubernetes.io/init-containers: '[ + { + "args": [ + "--container-name", + "portaldb" + ], + "command": [ + "/root/ready.py" + ], + "env": [ + { + "name": "NAMESPACE", + "valueFrom": { + "fieldRef": { + "apiVersion": "v1", + "fieldPath": "metadata.namespace" + } + } + } + ], + "image": "{{ .Values.image.readiness }}", + "imagePullPolicy": "{{ .Values.pullPolicy }}", + "name": "portalapps-readiness" + }, + { + "command": ["/bin/bash", "-c", "if [ ! -e /portal_root/boot.txt ]; then mysql -u root -ppassword -h portaldb < /portal-mysql/oom_updates.sql; fi"], + "volumeMounts": [ + { + "mountPath": "/portal-mysql/oom_updates.sql", + "name": "portal-mariadb-onboarding-sql" + }, + { + "mountPath": "/portal_root/", + "name": "portal-root" + } + ], + "image": "{{ .Values.image.mariadbClient }}", + "imagePullPolicy": "{{ .Values.pullPolicy }}", + "name": "provision-portaldb-users" + } + ]' + spec: + containers: + - image: {{ .Values.image.portalapps }} + imagePullPolicy: {{ .Values.pullPolicy }} + lifecycle: + postStart: + exec: + command: ["/bin/sh", "-c", "echo yes > /portal_root/boot.txt"] + name: portalapps + volumeMounts: + - mountPath: /opt/apache-tomcat-8.0.37/webapps/ECOMPPORTAL/WEB-INF/fusion/conf/fusion.properties + name: portal-fusion-properties + - mountPath: /opt/apache-tomcat-8.0.37/webapps/ECOMPPORTAL/WEB-INF/classes/openid-connect.properties + name: portal-openid-connect-properties + - mountPath: /opt/apache-tomcat-8.0.37/webapps/ECOMPPORTAL/WEB-INF/conf/system.properties + name: portal-system-properties + - mountPath: /opt/apache-tomcat-8.0.37/webapps/ECOMPPORTAL/WEB-INF/classes/portal.properties + name: portal-portal-properties + - mountPath: /opt/apache-tomcat-8.0.37/webapps/ECOMPDBCAPP/WEB-INF/fusion/conf/fusion.properties + name: dbcapp-fusion-properties + - mountPath: /opt/apache-tomcat-8.0.37/webapps/ECOMPDBCAPP/WEB-INF/conf/system.properties + name: dbcapp-system-properties + - mountPath: /opt/apache-tomcat-8.0.37/webapps/ECOMPDBCAPP/WEB-INF/classes/portal.properties + name: dbcapp-portal-properties + - mountPath: /opt/apache-tomcat-8.0.37/webapps/ECOMPDBCAPP/WEB-INF/dbcapp/dbcapp.properties + name: dbcapp-dbcapp-properties + - mountPath: /opt/apache-tomcat-8.0.37/webapps/ECOMPSDKAPP/WEB-INF/conf/system.properties + name: sdkapp-system-properties + - mountPath: /opt/apache-tomcat-8.0.37/webapps/ECOMPSDKAPP/WEB-INF/classes/portal.properties + name: sdkapp-portal-properties + - mountPath: /opt/apache-tomcat-8.0.37/webapps/ECOMPSDKAPP/WEB-INF/fusion/conf/fusion.properties + name: sdkapp-fusion-properties + - mountPath: /portal_root/ + name: portal-root + - mountPath: /opt/apache-tomcat-8.0.37/logs + name: portal-logs + ports: + - containerPort: 8005 + - containerPort: 8009 + - containerPort: 8080 + readinessProbe: + tcpSocket: + port: 8080 + initialDelaySeconds: 5 + periodSeconds: 10 + volumes: + - name: portal-fusion-properties + hostPath: + path: /dockerdata-nfs/onap/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 + - name: portal-system-properties + hostPath: + path: /dockerdata-nfs/onap/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 + - name: dbcapp-fusion-properties + hostPath: + path: /dockerdata-nfs/onap/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 + - name: dbcapp-portal-properties + hostPath: + path: /dockerdata-nfs/onap/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 + - name: sdkapp-system-properties + hostPath: + path: /dockerdata-nfs/onap/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 + - name: sdkapp-fusion-properties + hostPath: + path: /dockerdata-nfs/onap/portal/portal-fe/webapps/etc/ECOMPSDKAPP/fusion.properties + - name: portal-mariadb-onboarding-sql + hostPath: + path: /dockerdata-nfs/onap/portal/mariadb/oom_updates.sql + - name: portal-root + hostPath: + path: /dockerdata-nfs/onap/portal + - name: portal-logs + hostPath: + path: /dockerdata-nfs/onap/portal/logs + imagePullSecrets: + - name: onap-docker-registry-key diff --git a/kubernetes/portal/templates/portal-mariadb-deployment.yaml b/kubernetes/portal/templates/portal-mariadb-deployment.yaml new file mode 100755 index 0000000000..cf8bbd68e0 --- /dev/null +++ b/kubernetes/portal/templates/portal-mariadb-deployment.yaml @@ -0,0 +1,41 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: portaldb + namespace: {{ .Values.NS }} +spec: + selector: + matchLabels: + app: portaldb + template: + metadata: + labels: + app: portaldb + name: portaldb + spec: + containers: + - image: {{ .Values.image.portaldb}} + imagePullPolicy: {{ .Values.pullPolicy }} + name: "portaldb" + env: + - name: MYSQL_HOST + value: portaldb.onap-portal + - name: MYSQL_ROOT_PASSWORD + value: password + volumeMounts: + - mountPath: /var/lib/mysql + name: portal-mariadb-data + ports: + - containerPort: 3306 + name: portaldb + readinessProbe: + tcpSocket: + port: 3306 + initialDelaySeconds: 5 + periodSeconds: 10 + volumes: + - name: portal-mariadb-data + hostPath: + path: /dockerdata-nfs/onap/portal/mariadb/data + imagePullSecrets: + - name: onap-docker-registry-key diff --git a/kubernetes/portal/templates/portal-vnc-dep.yaml b/kubernetes/portal/templates/portal-vnc-dep.yaml new file mode 100644 index 0000000000..e4a8574458 --- /dev/null +++ b/kubernetes/portal/templates/portal-vnc-dep.yaml @@ -0,0 +1,133 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + labels: + app: vnc-portal + name: vnc-portal + namespace: {{ .Values.NS }} +spec: + selector: + matchLabels: + app: vnc-portal + template: + metadata: + labels: + app: vnc-portal + name: vnc-portal + annotations: + pod.beta.kubernetes.io/init-containers: '[ + { + "args": [ + "--container-name", + "portalapps" + ], + "command": [ + "/root/ready.py" + ], + "env": [ + { + "name": "NAMESPACE", + "valueFrom": { + "fieldRef": { + "apiVersion": "v1", + "fieldPath": "metadata.namespace" + } + } + } + ], + "image": "{{ .Values.image.readiness }}", + "imagePullPolicy": "{{ .Values.pullPolicy }}", + "name": "vnc-portal-readiness" + }, + { + "args": [ + "--container-name", + "pap" + ], + "command": [ + "/root/ready.py" + ], + "env": [ + { + "name": "NAMESPACE", + "value": "onap-policy" + } + ], + "image": "{{ .Values.image.readiness }}", + "imagePullPolicy": "{{ .Values.pullPolicy }}", + "name": "vnc-pap-readiness" + }, + { + "args": [ + "--container-name", + "sdc-fe" + ], + "command": [ + "/root/ready.py" + ], + "env": [ + { + "name": "NAMESPACE", + "value": "onap-sdc" + } + ], + "image": "{{ .Values.image.readiness }}", + "imagePullPolicy": "{{ .Values.pullPolicy }}", + "name": "vnc-sdc-readiness" + }, + { + "args": [ + "--container-name", + "vid-server" + ], + "command": [ + "/root/ready.py" + ], + "env": [ + { + "name": "NAMESPACE", + "value": "onap-vid" + } + ], + "image": "{{ .Values.image.readiness }}", + "imagePullPolicy": "{{ .Values.pullPolicy }}", + "name": "vnc-vid-readiness" + }, + { + "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"], + "image": "{{ .Values.image.ubuntuInit }}", + "imagePullPolicy": "{{ .Values.pullPolicy }}", + "name": "vnc-init-hosts", + "volumeMounts": [ + { + "name": "ubuntu-init", + "mountPath": "/ubuntu-init/" + } + ] + } + ]' + spec: + containers: + - image: {{ .Values.image.ubuntuDesktop }} + imagePullPolicy: {{ .Values.pullPolicy }} + lifecycle: + postStart: + exec: + command: ["/bin/sh", "-c", "cat /ubuntu-init/hosts >> /etc/hosts"] + env: + - name: VNC_PASSWORD + value: password + imagePullPolicy: IfNotPresent + name: vnc-portal + volumeMounts: + - mountPath: /ubuntu-init/ + name: ubuntu-init + securityContext: + privileged: true + securityContext: {} + volumes: + - name: ubuntu-init + emptyDir: {} + imagePullSecrets: + - name: onap-docker-registry-key diff --git a/kubernetes/portal/templates/portal-widgets-deployment.yaml b/kubernetes/portal/templates/portal-widgets-deployment.yaml new file mode 100644 index 0000000000..0aea75648c --- /dev/null +++ b/kubernetes/portal/templates/portal-widgets-deployment.yaml @@ -0,0 +1,59 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: portalwidgets + namespace: {{ .Values.NS }} +spec: + selector: + matchLabels: + app: portalwidgets + template: + metadata: + labels: + app: portalwidgets + name: portalwidgets + annotations: + pod.beta.kubernetes.io/init-containers: '[ + { + "args": [ + "--container-name", + "portaldb" + ], + "command": [ + "/root/ready.py" + ], + "env": [ + { + "name": "NAMESPACE", + "valueFrom": { + "fieldRef": { + "apiVersion": "v1", + "fieldPath": "metadata.namespace" + } + } + } + ], + "image": "{{ .Values.image.readiness }}", + "imagePullPolicy": "{{ .Values.pullPolicy }}", + "name": "portalapps-readiness" + } + ]' + spec: + containers: + - image: {{ .Values.image.portalwms }} + imagePullPolicy: {{ .Values.pullPolicy }} + name: portalwidgets + volumeMounts: + - mountPath: /application.properties + name: portalwidgets-application-properties + ports: + - containerPort: 8082 + readinessProbe: + tcpSocket: + port: 8082 + initialDelaySeconds: 5 + periodSeconds: 10 + volumes: + - name: portalwidgets-application-properties + hostPath: + path: /dockerdata-nfs/onap/portal/portal-fe/webapps/etc/ECOMPWIDGETMS/application.properties diff --git a/kubernetes/portal/values.yaml b/kubernetes/portal/values.yaml new file mode 100644 index 0000000000..b88b644a08 --- /dev/null +++ b/kubernetes/portal/values.yaml @@ -0,0 +1,10 @@ +NS: onap-portal +pullPolicy: Always +image: + readiness: oomk8s/readiness-check:1.0.0 + portalapps: nexus3.onap.org:10001/openecomp/portalapps:1.1-STAGING-latest + portaldb: nexus3.onap.org:10001/openecomp/portaldb:1.1-STAGING-latest + mariadbClient: oomk8s/mariadb-client-init:1.0.0 + portalwms: nexus3.onap.org:10001/openecomp/portalwms:1.1-STAGING-latest + ubuntuInit: oomk8s/ubuntu-init:1.0.0 + ubuntuDesktop: dorowu/ubuntu-desktop-lxde-vnc -- cgit 1.2.3-korg