diff options
Diffstat (limited to 'kubernetes/so/templates')
-rw-r--r-- | kubernetes/so/templates/NOTES.txt | 19 | ||||
-rw-r--r-- | kubernetes/so/templates/clusterrolebinding.yaml | 19 | ||||
-rw-r--r-- | kubernetes/so/templates/configmap.yaml | 15 | ||||
-rw-r--r-- | kubernetes/so/templates/deployment.yaml | 177 | ||||
-rw-r--r-- | kubernetes/so/templates/log-configmap.yaml | 15 | ||||
-rw-r--r-- | kubernetes/so/templates/namespace.yaml | 4 | ||||
-rw-r--r-- | kubernetes/so/templates/secrets.yaml | 13 | ||||
-rw-r--r-- | kubernetes/so/templates/service.yaml | 69 |
8 files changed, 331 insertions, 0 deletions
diff --git a/kubernetes/so/templates/NOTES.txt b/kubernetes/so/templates/NOTES.txt new file mode 100644 index 0000000000..24371d08ab --- /dev/null +++ b/kubernetes/so/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 {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "common.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.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.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "common.fullname" . }} -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 {{ .Release.Namespace }} -l "app={{ template "so.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/so/templates/clusterrolebinding.yaml b/kubernetes/so/templates/clusterrolebinding.yaml new file mode 100644 index 0000000000..a1ff116614 --- /dev/null +++ b/kubernetes/so/templates/clusterrolebinding.yaml @@ -0,0 +1,19 @@ + +apiVersion: rbac.authorization.k8s.io/v1beta1 +kind: ClusterRoleBinding +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 }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: cluster-admin +subjects: + - kind: ServiceAccount + name: default + namespace: {{ include "common.namespace" . }}
\ No newline at end of file diff --git a/kubernetes/so/templates/configmap.yaml b/kubernetes/so/templates/configmap.yaml new file mode 100644 index 0000000000..c9afd4f71e --- /dev/null +++ b/kubernetes/so/templates/configmap.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: so-configmap + namespace: {{ include "common.namespace" . }} +data: +{{ tpl (.Files.Glob "resources/config/mso/*").AsConfig . | indent 2 }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: so-docker-file-configmap + namespace: {{ include "common.namespace" . }} +data: +{{ tpl (.Files.Glob "resources/config/docker-files/scripts/start-jboss-server.sh").AsConfig . | indent 2 }} diff --git a/kubernetes/so/templates/deployment.yaml b/kubernetes/so/templates/deployment.yaml new file mode 100644 index 0000000000..67718ad522 --- /dev/null +++ b/kubernetes/so/templates/deployment.yaml @@ -0,0 +1,177 @@ +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: + initContainers: + - command: + - /root/ready.py + args: + - --container-name + - mariadb + env: + - name: NAMESPACE + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.namespace + image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + name: {{ include "common.name" . }}-readiness + containers: + - name: {{ .Chart.Name }} + command: + - /tmp/start-jboss-server.sh + image: "{{ .Values.global.repository | default .Values.repository }}/{{ .Values.image }}" + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + ports: + - containerPort: {{ .Values.service.internalPort }} + - containerPort: {{ .Values.service.internalPort2 }} + - containerPort: {{ .Values.service.internalPort3 }} + - containerPort: {{ .Values.service.internalPort4 }} + - containerPort: {{ .Values.service.internalPort5 }} + # 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: JBOSS_DEBUG + value: {{ .Values.global.debugEnabled | default .Values.debugEnabled | quote }} + volumeMounts: + - mountPath: /etc/localtime + name: localtime + readOnly: true + - mountPath: /shared/ + name: so + - mountPath: /tmp/start-jboss-server.sh + name: so-docker-files + subPath: start-jboss-server.sh + - mountPath: /opt/jboss/standalone/configuration/standalone-full-ha-mso.xml + name: so-config + subPath: standalone-full-ha-mso.xml + + - mountPath: /var/log/onap + name: so-logs + - mountPath: /var/berks-cookbooks/mso-config/files/default/mso-po-adapter-config/logback.network.xml + name: so-logback + subPath: logback.network.xml + - mountPath: /var/berks-cookbooks/mso-config/files/default/mso-po-adapter-config/logback.tenant.xml + name: so-logback + subPath: logback.tenant.xml + - mountPath: /var/berks-cookbooks/mso-config/files/default/mso-po-adapter-config/logback.vnf.xml + name: so-logback + subPath: logback.vnf.xml + - mountPath: /var/berks-cookbooks/mso-config/files/default/mso-po-adapter-config/logback.vfc.xml + name: so-logback + subPath: logback.vfc.xml + - mountPath: /var/berks-cookbooks/mso-config/files/default/mso-api-handler-infra-config/logback.apihandler-infra.xml + name: so-logback + subPath: logback.apihandler-infra.xml + - mountPath: /var/berks-cookbooks/mso-config/files/default/mso-appc-adapter-config/logback.appc.xml + name: so-logback + subPath: logback.appc.xml + - mountPath: /var/berks-cookbooks/mso-config/files/default/mso-requests-db-adapter-config/logback.msorequestsdbadapter.xml + name: so-logback + subPath: logback.msorequestsdbadapter.xml + - mountPath: /var/berks-cookbooks/mso-config/files/default/mso-asdc-controller-config/logback.asdc.xml + name: so-logback + subPath: logback.asdc.xml + - mountPath: /var/berks-cookbooks/mso-config/files/default/mso-sdnc-adapter-config/logback.sdnc.xml + name: so-logback + subPath: logback.sdnc.xml + - mountPath: /var/berks-cookbooks/mso-config/files/default/mso-bpmn-config/logback.bpmn.xml + name: so-logback + subPath: logback.bpmn.xml + - mountPath: /var/berks-cookbooks/mso-config/files/default/mso-workflow-message-adapter-config/logback.workflow-message-adapter.xml + name: so-logback + subPath: logback.workflow-message-adapter.xml + 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 }} + + # side car containers + - name: filebeat-onap + image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}" + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + volumeMounts: + - mountPath: /usr/share/filebeat/filebeat.yml + name: filebeat-conf + subPath: filebeat.yml + - mountPath: /var/log/onap + name: so-logs + - mountPath: /usr/share/filebeat/data + name: so-data-filebeat + + volumes: + - name: localtime + hostPath: + path: /etc/localtime + - name: so-logback + configMap: + name: so-log-configmap + - name: filebeat-conf + configMap: + name: so-filebeat-configmap + - name: so + configMap: + name: so-configmap + items: + - key: mso-docker.json + path: mso-docker.json + mode: 0755 + - key: aai.crt + path: aai.crt + mode: 0755 + - key: encryption.key + path: encryption.key + mode: 0644 + - name: so-config + configMap: + name: so-configmap + items: + - key: standalone-full-ha-mso.xml + path: standalone-full-ha-mso.xml + mode: 0644 + - name: so-logs + emptyDir: {} + - name: so-data-filebeat + emptyDir: {} + - name: so-docker-files + configMap: + name: so-docker-file-configmap + items: + - key: start-jboss-server.sh + path: start-jboss-server.sh + mode: 0755 + imagePullSecrets: + - name: "{{ include "common.name" . }}-docker-registry-key"
\ No newline at end of file diff --git a/kubernetes/so/templates/log-configmap.yaml b/kubernetes/so/templates/log-configmap.yaml new file mode 100644 index 0000000000..4d1cc90886 --- /dev/null +++ b/kubernetes/so/templates/log-configmap.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: so-log-configmap + namespace: {{ include "common.namespace" . }} +data: +{{ tpl (.Files.Glob "resources/config/log/*").AsConfig . | indent 2 }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: so-filebeat-configmap + namespace: {{ include "common.namespace" . }} +data: +{{ tpl (.Files.Glob "resources/config/log/filebeat/*").AsConfig . | indent 2 }} diff --git a/kubernetes/so/templates/namespace.yaml b/kubernetes/so/templates/namespace.yaml new file mode 100644 index 0000000000..83eb8e7815 --- /dev/null +++ b/kubernetes/so/templates/namespace.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: {{ include "common.namespace" . }}
\ No newline at end of file diff --git a/kubernetes/so/templates/secrets.yaml b/kubernetes/so/templates/secrets.yaml new file mode 100644 index 0000000000..3bdef26165 --- /dev/null +++ b/kubernetes/so/templates/secrets.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: Secret +metadata: + name: {{ include "common.name" . }}-docker-registry-key + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.fullname" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +data: + .dockercfg: {{ .Values.global.repositorySecret | default .Values.repositorySecret }} +type: kubernetes.io/dockercfg
\ No newline at end of file diff --git a/kubernetes/so/templates/service.yaml b/kubernetes/so/templates/service.yaml new file mode 100644 index 0000000000..e3e4d48018 --- /dev/null +++ b/kubernetes/so/templates/service.yaml @@ -0,0 +1,69 @@ +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": "so", + "version": "v1", + "url": "/ecomp/mso/infra", + "protocol": "REST" + "port": "8080", + "visualRange":"1" + }, + { + "serviceName": "so-deprecated", + "version": "v1", + "url": "/ecomp/mso/infra", + "protocol": "REST" + "port": "8080", + "visualRange":"1", + "path":"/ecomp/mso/infra" + } + ]' +spec: + type: {{ .Values.service.type }} + ports: + {{if eq .Values.service.type "NodePort" -}} + - port: {{ .Values.service.internalPort }} + nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.externalPort }} + name: {{ .Values.service.name }} + - port: {{ .Values.service.internalPort2 }} + nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.externalPort2 }} + name: {{ .Values.service.name }}2 + - port: {{ .Values.service.internalPort3 }} + nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.externalPort3 }} + name: {{ .Values.service.name }}3 + - port: {{ .Values.service.internalPort4 }} + nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.externalPort4 }} + name: {{ .Values.service.name }}4 + - port: {{ .Values.service.internalPort5 }} + nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.externalPort5 }} + name: {{ .Values.service.name }}5 + {{- else -}} + - port: {{ .Values.service.externalPort }} + targetPort: {{ .Values.service.internalPort }} + name: {{ .Values.service.name }} + - port: {{ .Values.service.externalPort2 }} + targetPort: {{ .Values.service.internalPort2 }} + name: {{ .Values.service.name }}2 + - port: {{ .Values.service.externalPort3 }} + targetPort: {{ .Values.service.internalPort3 }} + name: {{ .Values.service.name }}3 + - port: {{ .Values.service.externalPort4 }} + targetPort: {{ .Values.service.internalPort4 }} + name: {{ .Values.service.name }}4 + - port: {{ .Values.service.externalPort5 }} + targetPort: {{ .Values.service.internalPort5 }} + name: {{ .Values.service.name }}5 + {{- end}} + selector: + app: {{ include "common.name" . }} + release: {{ .Release.Name }}
\ No newline at end of file |