From 14d5161857232c4edf5374d5763f3df22b6dc736 Mon Sep 17 00:00:00 2001 From: vaibhav_16dec Date: Wed, 28 Mar 2018 07:48:35 +0000 Subject: Helm Chart Standardization of uui Issue-ID: OOM-749 Change-Id: Ie71686869da88a8bb7f6d09d38a5fa4a92b02aeb Signed-off-by: vaibhav_16dec --- kubernetes/uui/templates/NOTES.txt | 19 ++++++ kubernetes/uui/templates/all-services.yaml | 72 ---------------------- kubernetes/uui/templates/deployment.yaml | 71 +++++++++++++++++++++ kubernetes/uui/templates/service.yaml | 51 +++++++++++++++ kubernetes/uui/templates/uui-deployment.yaml | 54 ---------------- .../uui/templates/uui-server-deployment.yaml | 52 ---------------- 6 files changed, 141 insertions(+), 178 deletions(-) create mode 100644 kubernetes/uui/templates/NOTES.txt delete mode 100644 kubernetes/uui/templates/all-services.yaml create mode 100644 kubernetes/uui/templates/deployment.yaml create mode 100644 kubernetes/uui/templates/service.yaml delete mode 100644 kubernetes/uui/templates/uui-deployment.yaml delete mode 100644 kubernetes/uui/templates/uui-server-deployment.yaml (limited to 'kubernetes/uui/templates') diff --git a/kubernetes/uui/templates/NOTES.txt b/kubernetes/uui/templates/NOTES.txt new file mode 100644 index 0000000000..6e0b9fc06d --- /dev/null +++ b/kubernetes/uui/templates/NOTES.txt @@ -0,0 +1,19 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range .Values.ingress.hosts }} + http://{{ . }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ include "common.namespace" . }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "common.name" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ include "common.namespace" . }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get svc -w {{ include "common.name" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ include "common.namespace" . }} {{ include "common.name" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') + echo http://$SERVICE_IP:{{ .Values.service.externalPort }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ include "common.namespace" . }} -l "app={{ .Chart.Name }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl port-forward $POD_NAME 8080:{{ .Values.service.internalPort }} +{{- end }} diff --git a/kubernetes/uui/templates/all-services.yaml b/kubernetes/uui/templates/all-services.yaml deleted file mode 100644 index 7f450cd9ae..0000000000 --- a/kubernetes/uui/templates/all-services.yaml +++ /dev/null @@ -1,72 +0,0 @@ -# Copyright © 2017 Amdocs, Bell Canada -# -# 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. - -#{{ if not .Values.disableUuiUui }} -apiVersion: v1 -kind: Service -metadata: - labels: - app: uui - name: uui - namespace: "{{ .Values.nsPrefix }}" - annotations: - msb.onap.org/service-info: '[ - { - "serviceName": "usecaseui-gui", - "version": "v1", - "url": "/usecase-ui", - "path":"/iui/usecaseui", - "protocol": "UI" - "port": "8080", - "visualRange":"1|0" - } - ]' -spec: - ports: - - name: uui - nodePort: {{ .Values.uuiPortPrefix }}98 - port: 8080 - selector: - app: uui - type: NodePort -#{{ end }} -#{{ if not .Values.disableUuiServer }} ---- -apiVersion: v1 -kind: Service -metadata: - labels: - app: uui-server - name: uui-server - namespace: "{{ .Values.nsPrefix }}" - annotations: - msb.onap.org/service-info: '[ - { - "serviceName": "usecaseui-server", - "version": "v1", - "url": "/api/usecaseui/server/v1", - "protocol": "UI" - "port": "8080", - "visualRange":"1|0" - } - ]' -spec: - ports: - - name: uui-server - nodePort: {{ .Values.uuiPortPrefix }}99 - port: 8082 - selector: - app: uui-server - type: NodePort -#{{ end }} \ No newline at end of file diff --git a/kubernetes/uui/templates/deployment.yaml b/kubernetes/uui/templates/deployment.yaml new file mode 100644 index 0000000000..4b3ed7c66e --- /dev/null +++ b/kubernetes/uui/templates/deployment.yaml @@ -0,0 +1,71 @@ +# Copyright © 2017 Amdocs, Bell Canada +# +# 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. + +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: {{ include "common.fullname" . }} + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + replicas: {{ .Values.replicaCount }} + template: + metadata: + labels: + app: {{ include "common.name" . }} + release: {{ .Release.Name }} + spec: + containers: + - name: {{ include "common.name" . }} + image: "{{ .Values.global.repository | default .Values.repository }}/{{ .Values.image }}" + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + command: + - /bin/bash + - -c + - /home/uui/tomcat/bin/catalina.sh run + ports: + - containerPort: {{ .Values.service.internalPort }} + # disable liveness probe when breakpoints set in debugger + # so K8s doesn't restart unresponsive container + {{- if eq .Values.liveness.enabled true }} + livenessProbe: + tcpSocket: + port: {{ .Values.service.internalPort }} + initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} + periodSeconds: {{ .Values.liveness.periodSeconds }} + {{ end -}} + readinessProbe: + tcpSocket: + port: {{ .Values.service.internalPort }} + initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} + periodSeconds: {{ .Values.readiness.periodSeconds }} + env: + - name: MSB_ADDR + value: {{ tpl .Values.msbaddr . }} + resources: +{{ toYaml .Values.resources | indent 12 }} + {{- if .Values.nodeSelector }} + nodeSelector: +{{ toYaml .Values.nodeSelector | indent 10 }} + {{- end -}} + {{- if .Values.affinity }} + affinity: +{{ toYaml .Values.affinity | indent 10 }} + {{- end }} + imagePullSecrets: + - name: "{{ include "common.namespace" . }}-docker-registry-key" diff --git a/kubernetes/uui/templates/service.yaml b/kubernetes/uui/templates/service.yaml new file mode 100644 index 0000000000..4570c99473 --- /dev/null +++ b/kubernetes/uui/templates/service.yaml @@ -0,0 +1,51 @@ +# Copyright © 2017 Amdocs, Bell Canada +# +# 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. + +apiVersion: v1 +kind: Service +metadata: + name: {{ include "common.fullname" . }} + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + annotations: + msb.onap.org/service-info: '[ + { + "serviceName": "usecaseui-gui", + "version": "v1", + "url": "/usecase-ui", + "path":"/iui/usecaseui", + "protocol": "UI" + "port": "8080", + "visualRange":"1|0" + } + ]' +spec: + type: {{ .Values.service.type }} + ports: + {{if eq .Values.service.type "NodePort" -}} + - port: {{ .Values.service.internalPort }} + nodePort: {{ .Values.global.uuiPortPrefix | default .Values.uuiPortPrefix }}{{ .Values.service.nodePort }} + name: {{ .Values.service.name }} + {{- else -}} + - port: {{ .Values.service.externalPort }} + targetPort: {{ .Values.service.internalPort }} + name: {{ .Values.service.name }} + {{- end}} + selector: + app: {{ include "common.name" . }} + release: {{ .Release.Name }} diff --git a/kubernetes/uui/templates/uui-deployment.yaml b/kubernetes/uui/templates/uui-deployment.yaml deleted file mode 100644 index ad757cbc22..0000000000 --- a/kubernetes/uui/templates/uui-deployment.yaml +++ /dev/null @@ -1,54 +0,0 @@ -# Copyright © 2017 Amdocs, Bell Canada -# -# 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. - -#{{ if not .Values.disableUuiUui }} -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - labels: - app: uui - name: uui - namespace: "{{ .Values.nsPrefix }}" -spec: - replicas: {{ .Values.uuiReplicas }} - selector: - matchLabels: - app: uui - template: - metadata: - labels: - app: uui - name: uui - spec: - containers: - - image: {{ .Values.image.uuiImage }}:{{ .Values.image.uuiVersion }} - imagePullPolicy: {{ .Values.pullPolicy }} - command: - - /bin/bash - - -c - - /home/uui/tomcat/bin/catalina.sh run - name: uui - env: - - name: MSB_ADDR - value: {{ tpl .Values.msbaddr . }} - ports: - - containerPort: 8080 - readinessProbe: - tcpSocket: - port: 8080 - initialDelaySeconds: 5 - periodSeconds: 10 - imagePullSecrets: - - name: "{{ .Values.nsPrefix }}-docker-registry-key" -#{{ end }} diff --git a/kubernetes/uui/templates/uui-server-deployment.yaml b/kubernetes/uui/templates/uui-server-deployment.yaml deleted file mode 100644 index 2b9c3e9010..0000000000 --- a/kubernetes/uui/templates/uui-server-deployment.yaml +++ /dev/null @@ -1,52 +0,0 @@ -# Copyright © 2017 Amdocs, Bell Canada -# -# 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. - -#{{ if not .Values.disableUuiUui }} -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - labels: - app: uui-server - name: uui-server - namespace: "{{ .Values.nsPrefix }}" -spec: - replicas: {{ .Values.uuiServerReplicas }} - selector: - matchLabels: - app: uui-server - template: - metadata: - labels: - app: uui-server - name: uui-server - spec: - containers: - - image: {{ .Values.uuiserver.image }}:{{ .Values.uuiserver.version }} - imagePullPolicy: {{ .Values.pullPolicy }} - name: uui-server - env: - - name: MSB_ADDR - value: {{tpl .Values.msbaddr .}} - - name: MR_ADDR - value: {{tpl .Values.mraddr .}} - ports: - - containerPort: 8082 - readinessProbe: - tcpSocket: - port: 8082 - initialDelaySeconds: 5 - periodSeconds: 10 - imagePullSecrets: - - name: "{{ .Values.nsPrefix }}-docker-registry-key" -#{{ end }} -- cgit 1.2.3-korg