diff options
Diffstat (limited to 'kubernetes/portal/templates')
8 files changed, 167 insertions, 93 deletions
diff --git a/kubernetes/portal/templates/all-services.yaml b/kubernetes/portal/templates/all-services.yaml index 28ca0303b1..b676e3c6d1 100644 --- a/kubernetes/portal/templates/all-services.yaml +++ b/kubernetes/portal/templates/all-services.yaml @@ -3,7 +3,7 @@ apiVersion: v1 kind: Service metadata: name: portaldb - namespace: "{{ .Values.nsPrefix }}-portal" + namespace: "{{ .Values.nsPrefix }}" labels: app: portaldb spec: @@ -22,7 +22,7 @@ metadata: labels: app: portalapps name: portalapps - namespace: "{{ .Values.nsPrefix }}-portal" + namespace: "{{ .Values.nsPrefix }}" annotations: msb.onap.org/service-info: '[ { @@ -58,9 +58,9 @@ apiVersion: v1 kind: Service metadata: labels: - app: vnc-portal - name: vnc-portal - namespace: "{{ .Values.nsPrefix }}-portal" + app: portal-vnc + name: portal-vnc + namespace: "{{ .Values.nsPrefix }}" spec: ports: - name: tcp-1 @@ -72,7 +72,7 @@ spec: targetPort: 5900 nodePort: {{ .Values.nodePortPrefix }}12 selector: - app: vnc-portal + app: portal-vnc type: NodePort #{{ end }} #{{ if not .Values.disablePortalPortalwidgets }} @@ -81,7 +81,7 @@ apiVersion: v1 kind: Service metadata: name: portalwidgets - namespace: "{{ .Values.nsPrefix }}-portal" + namespace: "{{ .Values.nsPrefix }}" labels: app: portalwidgets spec: @@ -91,4 +91,4 @@ spec: selector: app: portalwidgets clusterIP: None -#{{ end }}
\ No newline at end of file +#{{ end }} diff --git a/kubernetes/portal/templates/portal-apps-configmap.yaml b/kubernetes/portal/templates/portal-apps-configmap.yaml new file mode 100644 index 0000000000..ec3805de32 --- /dev/null +++ b/kubernetes/portal/templates/portal-apps-configmap.yaml @@ -0,0 +1,35 @@ +#{{ if not .Values.disablePortalPortalapps }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: portal-onap-portal-sdk-configmap + namespace: {{ .Values.nsPrefix }} +data: +{{ tpl (.Files.Glob "resources/config/portal-fe/webapps/etc/ONAPPORTALSDK/*").AsConfig . | indent 2 }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: portal-onap-portal-configmap + namespace: {{ .Values.nsPrefix }} +data: +{{ tpl (.Files.Glob "resources/config/portal-fe/webapps/etc/ONAPPORTAL/*").AsConfig . | indent 2 }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: portal-mariadb-configmap + namespace: {{ .Values.nsPrefix }} +data: +{{ tpl (.Files.Glob "resources/config/mariadb/oom_updates.sql").AsConfig . | indent 2 }} +#{{ end }} +--- +#{{ if not .Values.disablePortalPortalwidgets }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: portal-onapwidgetms-configmap + namespace: {{ .Values.nsPrefix }} +data: +{{ tpl (.Files.Glob "resources/config/portal-fe/webapps/etc/ONAPWIDGETMS/application.properties").AsConfig . | indent 2 }} +#{{ end }} diff --git a/kubernetes/portal/templates/portal-apps-deployment.yaml b/kubernetes/portal/templates/portal-apps-deployment.yaml index 761441acc3..e00151c714 100755 --- a/kubernetes/portal/templates/portal-apps-deployment.yaml +++ b/kubernetes/portal/templates/portal-apps-deployment.yaml @@ -2,9 +2,10 @@ apiVersion: extensions/v1beta1 kind: Deployment metadata: - name: portalapps - namespace: "{{ .Values.nsPrefix }}-portal" + name: portal-apps + namespace: "{{ .Values.nsPrefix }}" spec: + replicas: {{ .Values.portalAppsReplicas }} selector: matchLabels: app: portalapps @@ -12,7 +13,7 @@ spec: metadata: labels: app: portalapps - name: portalapps + name: portal-apps spec: initContainers: - command: @@ -33,11 +34,19 @@ spec: volumeMounts: - mountPath: /portal-mysql/oom_updates.sql name: portal-mariadb-onboarding-sql + subPath: oom_updates.sql - mountPath: /portal_root/ name: portal-root image: {{ .Values.image.mariadbClient }} imagePullPolicy: {{ .Values.pullPolicy }} name: provision-portaldb-users + - command: ["/bin/bash", "-c", "mkdir -p /ubuntu-init/ && chmod -R 777 /ubuntu-init/"] + volumeMounts: + - name: portal-logs + mountPath: /ubuntu-init/ + image: {{ .Values.image.ubuntuInit }} + imagePullPolicy: {{ .Values.pullPolicy }} + name: portal-app-logs-init containers: - image: {{ .Values.image.portalapps }} imagePullPolicy: {{ .Values.pullPolicy }} @@ -51,23 +60,32 @@ spec: name: localtime readOnly: true - mountPath: "{{ .Values.onapPortal.webappsDir }}/ONAPPORTAL/WEB-INF/fusion/conf/fusion.properties" - name: portal-fusion-properties + name: onap-portal-properties + subPath: fusion.properties - mountPath: "{{ .Values.onapPortal.webappsDir }}/ONAPPORTAL/WEB-INF/classes/openid-connect.properties" - name: portal-openid-connect-properties + name: onap-portal-properties + subPath: openid-connect.properties - mountPath: "{{ .Values.onapPortal.webappsDir }}/ONAPPORTAL/WEB-INF/conf/system.properties" - name: portal-system-properties + name: onap-portal-properties + subPath: system.properties - mountPath: "{{ .Values.onapPortal.webappsDir }}/ONAPPORTAL/WEB-INF/classes/portal.properties" - name: portal-portal-properties + name: onap-portal-properties + subPath: portal.properties - mountPath: "{{ .Values.onapPortal.webappsDir }}/ONAPPORTAL/WEB-INF/classes/logback.xml" name: portal-logback + subPath: logback.xml - mountPath: "{{ .Values.onapPortal.webappsDir }}/ONAPPORTALSDK/WEB-INF/conf/system.properties" - name: sdkapp-system-properties + name: portal-sdkapp-properties + subPath: system.properties - mountPath: "{{ .Values.onapPortal.webappsDir }}/ONAPPORTALSDK/WEB-INF/classes/portal.properties" - name: sdkapp-portal-properties + name: portal-sdkapp-properties + subPath: portal.properties - mountPath: "{{ .Values.onapPortal.webappsDir }}/ONAPPORTALSDK/WEB-INF/fusion/conf/fusion.properties" - name: sdkapp-fusion-properties + name: portal-sdkapp-properties + subPath: fusion.properties - mountPath: "{{ .Values.onapPortal.webappsDir }}/ONAPPORTALSDK/WEB-INF/classes/logback.xml" name: sdkapp-logback + subPath: logback.xml - mountPath: /portal_root/ name: portal-root - mountPath: "{{ .Values.onapPortal.webappsDir }}/logs" @@ -89,6 +107,7 @@ spec: volumeMounts: - mountPath: /usr/share/filebeat/filebeat.yml name: filebeat-conf + subPath: filebeat.yml - mountPath: /var/log/onap name: portal-logs2 - mountPath: /usr/share/filebeat/data @@ -98,48 +117,35 @@ spec: hostPath: path: /etc/localtime - name: filebeat-conf - hostPath: - path: /dockerdata-nfs/{{ .Values.nsPrefix }}/log/filebeat/logback/filebeat.yml + configMap: + name: portal-filebeat-configmap - name: portal-logs2 emptyDir: {} - name: portal-data-filebeat emptyDir: {} - - name: portal-fusion-properties - hostPath: - path: /dockerdata-nfs/{{ .Values.nsPrefix }}/portal/portal-fe/webapps/etc/ONAPPORTAL/fusion.properties - - name: portal-openid-connect-properties - hostPath: - path: /dockerdata-nfs/{{ .Values.nsPrefix }}/portal/portal-fe/webapps/etc/ONAPPORTAL/openid-connect.properties - - name: portal-system-properties - hostPath: - path: /dockerdata-nfs/{{ .Values.nsPrefix }}/portal/portal-fe/webapps/etc/ONAPPORTAL/system.properties - - name: portal-portal-properties - hostPath: - path: /dockerdata-nfs/{{ .Values.nsPrefix }}/portal/portal-fe/webapps/etc/ONAPPORTAL/portal.properties + - name: onap-portal-properties + configMap: + defaultMode: 0755 + name: portal-onap-portal-configmap + - name: portal-sdkapp-properties + configMap: + defaultMode: 0755 + name: portal-onap-portal-sdk-configmap - name: portal-logback - hostPath: - path: /dockerdata-nfs/{{ .Values.nsPrefix }}/log/portal/onapportal/logback.xml - - name: sdkapp-system-properties - hostPath: - path: /dockerdata-nfs/{{ .Values.nsPrefix }}/portal/portal-fe/webapps/etc/ONAPPORTALSDK/system.properties - - name: sdkapp-portal-properties - hostPath: - path: /dockerdata-nfs/{{ .Values.nsPrefix }}/portal/portal-fe/webapps/etc/ONAPPORTALSDK/portal.properties - - name: sdkapp-fusion-properties - hostPath: - path: /dockerdata-nfs/{{ .Values.nsPrefix }}/portal/portal-fe/webapps/etc/ONAPPORTALSDK/fusion.properties + configMap: + name: portal-onapportal-log-configmap - name: sdkapp-logback - hostPath: - path: /dockerdata-nfs/{{ .Values.nsPrefix }}/log/portal/onapportalsdk/logback.xml + configMap: + name: portal-onapportalsdk-log-configmap - name: portal-mariadb-onboarding-sql - hostPath: - path: /dockerdata-nfs/{{ .Values.nsPrefix }}/portal/mariadb/oom_updates.sql + configMap: + name: portal-mariadb-configmap - name: portal-root hostPath: - path: /dockerdata-nfs/{{ .Values.nsPrefix }}/portal + path: {{ .Values.dataRootDir }}/{{ .Values.nsPrefix }}/portal - name: portal-logs hostPath: - path: /dockerdata-nfs/{{ .Values.nsPrefix }}/portal/logs + path: {{ .Values.dataRootDir }}/{{ .Values.nsPrefix }}/portal/logs imagePullSecrets: - name: "{{ .Values.nsPrefix }}-docker-registry-key" #{{ end }} diff --git a/kubernetes/portal/templates/portal-logs-configmap.yaml b/kubernetes/portal/templates/portal-logs-configmap.yaml new file mode 100644 index 0000000000..60abcb78c8 --- /dev/null +++ b/kubernetes/portal/templates/portal-logs-configmap.yaml @@ -0,0 +1,26 @@ +#{{ if not .Values.disablePortalPortalapps }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: portal-filebeat-configmap + namespace: {{ .Values.nsPrefix }} +data: +{{ tpl (.Files.Glob "resources/config/log/filebeat/filebeat.yml").AsConfig . | indent 2 }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: portal-onapportal-log-configmap + namespace: {{ .Values.nsPrefix }} +data: +{{ tpl (.Files.Glob "resources/config/log/portal/onapportal/logback.xml").AsConfig . | indent 2 }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: portal-onapportalsdk-log-configmap + namespace: {{ .Values.nsPrefix }} +data: +{{ tpl (.Files.Glob "resources/config/log/portal/onapportalsdk/logback.xml").AsConfig . | indent 2 }} +#{{ end }} + diff --git a/kubernetes/portal/templates/portal-mariadb-deployment.yaml b/kubernetes/portal/templates/portal-mariadb-deployment.yaml index fafcad2772..828779eaa9 100755 --- a/kubernetes/portal/templates/portal-mariadb-deployment.yaml +++ b/kubernetes/portal/templates/portal-mariadb-deployment.yaml @@ -2,9 +2,10 @@ apiVersion: extensions/v1beta1 kind: Deployment metadata: - name: portaldb - namespace: "{{ .Values.nsPrefix }}-portal" + name: portal-db + namespace: "{{ .Values.nsPrefix }}" spec: + replicas: {{ .Values.portalDbReplicas }} selector: matchLabels: app: portaldb @@ -12,7 +13,7 @@ spec: metadata: labels: app: portaldb - name: portaldb + name: portal-db spec: containers: - image: {{ .Values.image.portaldb}} @@ -20,7 +21,7 @@ spec: name: "portaldb" env: - name: MYSQL_HOST - value: "portaldb.{{ .Values.nsPrefix }}-portal" + value: "portaldb.{{ .Values.nsPrefix }}" - name: MYSQL_ROOT_PASSWORD value: Aa123456 volumeMounts: diff --git a/kubernetes/portal/templates/portal-pv-pvc.yaml b/kubernetes/portal/templates/portal-pv-pvc.yaml index b4d2baa334..1f554bc34a 100644 --- a/kubernetes/portal/templates/portal-pv-pvc.yaml +++ b/kubernetes/portal/templates/portal-pv-pvc.yaml @@ -2,10 +2,10 @@ apiVersion: v1 kind: PersistentVolume metadata: - name: "{{ .Values.nsPrefix }}-portal-db" - namespace: "{{ .Values.nsPrefix }}-portal" + name: "{{ .Values.nsPrefix }}-portal" + namespace: "{{ .Values.nsPrefix }}" labels: - name: "{{ .Values.nsPrefix }}-portal-db" + name: "{{ .Values.nsPrefix }}-portal" spec: capacity: storage: 2Gi @@ -13,13 +13,13 @@ spec: - ReadWriteMany persistentVolumeReclaimPolicy: Retain hostPath: - path: /dockerdata-nfs/{{ .Values.nsPrefix }}/portal/mariadb/data + path: {{ .Values.dataRootDir }}/{{ .Values.nsPrefix }}/portal/mariadb/data --- kind: PersistentVolumeClaim apiVersion: v1 metadata: name: portal-db - namespace: "{{ .Values.nsPrefix }}-portal" + namespace: "{{ .Values.nsPrefix }}" spec: accessModes: - ReadWriteMany @@ -28,5 +28,5 @@ spec: storage: 2Gi selector: matchLabels: - name: "{{ .Values.nsPrefix }}-portal-db" -#{{ end }}
\ No newline at end of file + name: "{{ .Values.nsPrefix }}-portal" +#{{ end }} diff --git a/kubernetes/portal/templates/portal-vnc-dep.yaml b/kubernetes/portal/templates/portal-vnc-dep.yaml index 536ac37396..0680a8ab24 100644 --- a/kubernetes/portal/templates/portal-vnc-dep.yaml +++ b/kubernetes/portal/templates/portal-vnc-dep.yaml @@ -1,27 +1,36 @@ #{{ if not .Values.disablePortalVncPortal }} kind: ConfigMap metadata: - name: vnc-profiles-ini - namespace: "{{ .Values.nsPrefix }}-portal" + name: portal-vnc-profiles-ini + namespace: "{{ .Values.nsPrefix }}" data: {{ (.Files.Glob "resources/vnc/init_profile/profiles.ini").AsConfig | indent 2 }} --- +apiVersion: v1 +kind: ConfigMap +metadata: + name: portal-vnc-update-hosts + namespace: "{{ .Values.nsPrefix }}" +data: +{{ (.Files.Glob "resources/scripts/update_hosts.sh").AsConfig | indent 2 }} +--- apiVersion: extensions/v1beta1 kind: Deployment metadata: labels: - app: vnc-portal - name: vnc-portal - namespace: "{{ .Values.nsPrefix }}-portal" + app: portal-vnc + name: portal-vnc + namespace: "{{ .Values.nsPrefix }}" spec: + replicas: {{ .Values.vncPortalReplicas }} selector: matchLabels: - app: vnc-portal + app: portal-vnc template: metadata: labels: - app: vnc-portal - name: vnc-portal + app: portal-vnc + name: portal-vnc spec: initContainers: - command: @@ -37,7 +46,7 @@ spec: fieldPath: metadata.namespace image: {{ .Values.image.readiness }} imagePullPolicy: {{ .Values.pullPolicy }} - name: vnc-portal-readiness + name: portal-vnc-readiness - command: - /root/ready.py args: @@ -45,7 +54,7 @@ spec: - pap env: - name: NAMESPACE - value: {{ .Values.nsPrefix }}-policy + value: {{ .Values.nsPrefix }} image: {{ .Values.image.readiness }} imagePullPolicy: {{ .Values.pullPolicy }} name: vnc-pap-readiness @@ -56,7 +65,7 @@ spec: - sdc-fe env: - name: NAMESPACE - value: {{ .Values.nsPrefix }}-sdc + value: {{ .Values.nsPrefix }} image: {{ .Values.image.readiness }} imagePullPolicy: {{ .Values.pullPolicy }} name: vnc-sdc-readiness @@ -67,38 +76,31 @@ spec: - vid-server env: - name: NAMESPACE - value: {{ .Values.nsPrefix }}-vid + value: {{ .Values.nsPrefix }} image: {{ .Values.image.readiness }} imagePullPolicy: {{ .Values.pullPolicy }} name: vnc-vid-readiness - - command: ["/bin/sh","-c"] - args: ["echo `host sdc-be.{{ .Values.nsPrefix }}-sdc | awk ''{print$4}''` sdc.api.be.simpledemo.onap.org >> /ubuntu-init/hosts; echo `host portalapps.{{ .Values.nsPrefix }}-portal | awk ''{print$4}''` portal.api.simpledemo.onap.org >> /ubuntu-init/hosts; echo `host pap.{{ .Values.nsPrefix }}-policy | awk ''{print$4}''` policy.api.simpledemo.onap.org >> /ubuntu-init/hosts; echo `host sdc-fe.{{ .Values.nsPrefix }}-sdc | awk ''{print$4}''` sdc.api.simpledemo.onap.org >> /ubuntu-init/hosts; echo `host vid-server.{{ .Values.nsPrefix }}-vid | awk ''{print$4}''` vid.api.simpledemo.onap.org >> /ubuntu-init/hosts; echo `host sparky-be.{{ .Values.nsPrefix }}-aai | awk ''{print$4}''` aai.api.simpledemo.onap.org >> /ubuntu-init/hosts"] - image: {{ .Values.image.ubuntuInit }} - imagePullPolicy: {{ .Values.pullPolicy }} - name: vnc-init-hosts - volumeMounts: - - name: ubuntu-init - mountPath: /ubuntu-init/ containers: - image: {{ .Values.image.ubuntuDesktop }} imagePullPolicy: {{ .Values.pullPolicy }} lifecycle: postStart: exec: - command: ["/bin/sh", "-c", "mkdir -p /root/.mozilla/firefox/onap.default; cp /root/.init_profile/profiles.ini /root/.mozilla/firefox/; echo 'user_pref(\"browser.tabs.remote.autostart.2\", false);' > /root/.mozilla/firefox/onap.default/prefs.js; cat /ubuntu-init/hosts >> /etc/hosts"] + command: ["/bin/sh", "-c", "mkdir -p /root/.mozilla/firefox/onap.default; cp /root/.init_profile/profiles.ini /root/.mozilla/firefox/; echo 'user_pref(\"browser.tabs.remote.autostart.2\", false);' > /root/.mozilla/firefox/onap.default/prefs.js; (while true; do /tmp/update_hosts.sh sdc-be.{{ .Values.nsPrefix }} sdc.api.be.simpledemo.onap.org; /tmp/update_hosts.sh portalapps.{{ .Values.nsPrefix }} portal.api.simpledemo.onap.org; /tmp/update_hosts.sh pap.{{ .Values.nsPrefix }} policy.api.simpledemo.onap.org; /tmp/update_hosts.sh sdc-fe.{{ .Values.nsPrefix }} sdc.api.simpledemo.onap.org; /tmp/update_hosts.sh vid-server.{{ .Values.nsPrefix }} vid.api.simpledemo.onap.org; /tmp/update_hosts.sh sparky-be.{{ .Values.nsPrefix }} aai.api.simpledemo.onap.org; /tmp/update_hosts.sh cli.{{ .Values.nsPrefix }} cli.api.simpledemo.onap.org; sleep 10; done) > update_hosts.log 2>&1 &"] env: - name: VNC_PASSWORD value: password - name: vnc-portal + name: portal-vnc volumeMounts: - mountPath: /etc/localtime name: localtime readOnly: true - - mountPath: /ubuntu-init/ - name: ubuntu-init - mountPath: /root/.init_profile/profiles.ini name: vnc-profiles-ini subPath: profiles.ini + - mountPath: /tmp/update_hosts.sh + name: vnc-update-hosts + subPath: update_hosts.sh securityContext: privileged: true securityContext: {} @@ -106,11 +108,13 @@ spec: - name: localtime hostPath: path: /etc/localtime - - name: ubuntu-init - emptyDir: {} - name: vnc-profiles-ini configMap: - name: vnc-profiles-ini + name: portal-vnc-profiles-ini + - name: vnc-update-hosts + configMap: + name: portal-vnc-update-hosts + defaultMode: 0755 imagePullSecrets: - name: "{{ .Values.nsPrefix }}-docker-registry-key" #{{ end }} diff --git a/kubernetes/portal/templates/portal-widgets-deployment.yaml b/kubernetes/portal/templates/portal-widgets-deployment.yaml index 600419399e..d5237caf33 100644 --- a/kubernetes/portal/templates/portal-widgets-deployment.yaml +++ b/kubernetes/portal/templates/portal-widgets-deployment.yaml @@ -2,9 +2,10 @@ apiVersion: extensions/v1beta1 kind: Deployment metadata: - name: portalwidgets - namespace: "{{ .Values.nsPrefix }}-portal" + name: portal-widgets + namespace: "{{ .Values.nsPrefix }}" spec: + replicas: {{ .Values.portalWidgetsReplicas }} selector: matchLabels: app: portalwidgets @@ -12,7 +13,7 @@ spec: metadata: labels: app: portalwidgets - name: portalwidgets + name: portal-widgets spec: initContainers: - command: @@ -31,7 +32,7 @@ spec: name: portalapps-readiness containers: - image: {{ .Values.image.portalwms }} - imagePullPolicy: {{ .Values.pullPolicy }} + imagePullPolicy: {{ .Values.pullPolicy }} name: portalwidgets volumeMounts: - mountPath: /etc/localtime @@ -39,6 +40,7 @@ spec: readOnly: true - mountPath: /application.properties name: portalwidgets-application-properties + subPath: application.properties ports: - containerPort: 8082 readinessProbe: @@ -51,8 +53,8 @@ spec: hostPath: path: /etc/localtime - name: portalwidgets-application-properties - hostPath: - path: /dockerdata-nfs/{{ .Values.nsPrefix }}/portal/portal-fe/webapps/etc/ONAPWIDGETMS/application.properties + configMap: + name: portal-onapwidgetms-configmap imagePullSecrets: - name: "{{ .Values.nsPrefix }}-docker-registry-key" #{{ end }} |