diff options
Diffstat (limited to 'kubernetes/selfservice/templates')
-rw-r--r-- | kubernetes/selfservice/templates/configmap.yaml | 7 | ||||
-rw-r--r-- | kubernetes/selfservice/templates/deployment.yaml | 66 | ||||
-rw-r--r-- | kubernetes/selfservice/templates/pv.yaml | 55 | ||||
-rw-r--r-- | kubernetes/selfservice/templates/pvc.yaml | 55 | ||||
-rw-r--r-- | kubernetes/selfservice/templates/secrets.yaml | 34 | ||||
-rw-r--r-- | kubernetes/selfservice/templates/service.yaml | 38 |
6 files changed, 255 insertions, 0 deletions
diff --git a/kubernetes/selfservice/templates/configmap.yaml b/kubernetes/selfservice/templates/configmap.yaml new file mode 100644 index 0000000000..af1d51e19c --- /dev/null +++ b/kubernetes/selfservice/templates/configmap.yaml @@ -0,0 +1,7 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "common.fullname" . }}-configmap + namespace: {{ include "common.namespace" . }} +data: +{{ tpl (.Files.Glob "resources/config/*").AsConfig . | indent 2 }} diff --git a/kubernetes/selfservice/templates/deployment.yaml b/kubernetes/selfservice/templates/deployment.yaml new file mode 100644 index 0000000000..e9588e4c0f --- /dev/null +++ b/kubernetes/selfservice/templates/deployment.yaml @@ -0,0 +1,66 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + labels: + app: {{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + name: {{ include "common.fullname" . }} + namespace: {{ include "common.namespace" . }} +spec: + replicas: {{ .Values.replicaCount }} + template: + metadata: + annotations: + checksum.helm.kubernetes.io/configmap: {{ include (print $.Chart.Name "/templates/configmap.yaml") . | sha256sum }} + labels: + app: {{ include "common.name" . }} + release: {{ .Release.Name }} + spec: + containers: + - name: {{ include "common.name" . }} + image:"{{ .Values.global.selfserviceRepository }}/{{ .Values.image }}" + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + volumeMounts: + - mountPath: {{ .Values.deployerVolumePath }}/resources + name: initial-resources + - mountPath: {{ .Values.deployerVolumePath }}/k8s + name: k8s-api-secret + readOnly: true + - mountPath: /var/log/aee/portal + name: {{ include "common.fullname" . }}-pvc-log + - mountPath: /var/AEE/hde + name: {{ include "common.fullname" . }}-pvc + ports: + - containerPort: {{ .Values.service.httpInternalPort }} + - containerPort: {{ .Values.service.debugInternalPort }} + - containerPort: {{ .Values.service.dbInternalPort }} + {{ if .Values.liveness.enabled }} + livenessProbe: + tcpSocket: + port: {{ .Values.service.httpInternalPort }} + initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} + periodSeconds: {{ .Values.liveness.periodSeconds }} + {{ end }} + readinessProbe: + tcpSocket: + port: {{ .Values.service.httpInternalPort }} + initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} + periodSeconds: {{ .Values.readiness.periodSeconds }} + volumes: + - name: k8s-api-secret + secret: + secretName: k8s-api-secret + - name: initial-resources + configMap: + name: {{ include "common.fullname" . }}-configmap + - name: {{ include "common.fullname" . }}-pvc-log + persistentVolumeClaim: + claimName: {{ include "common.fullname" . }}-log + - name: {{ include "common.fullname" . }}-pvc + persistentVolumeClaim: + claimName: {{ .Values.persistence.volumeMountName }} + restartPolicy: {{ .Values.global.restartPolicy | default .Values.restartPolicy }} + imagePullSecrets: + - name: "{{ include "common.namespace" . }}-ss-docker-registry-key" diff --git a/kubernetes/selfservice/templates/pv.yaml b/kubernetes/selfservice/templates/pv.yaml new file mode 100644 index 0000000000..6af58d6105 --- /dev/null +++ b/kubernetes/selfservice/templates/pv.yaml @@ -0,0 +1,55 @@ +{{/* +# 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. +*/}} + +kind: PersistentVolume +apiVersion: v1 +metadata: + name: {{ .Values.persistence.volumeName}} + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" + name: {{ .Values.persistence.volumeName}} +spec: + capacity: + storage: {{ .Values.persistence.size}} + accessModes: + - {{ .Values.persistence.accessMode }} + persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }} + hostPath: + path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }} +--- +kind: PersistentVolume +apiVersion: v1 +metadata: + name: {{ include "common.fullname" . }}-log + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" + name: {{ include "common.fullname" . }}-log +spec: + capacity: + storage: {{ .Values.persistence.size}} + accessModes: + - {{ .Values.persistence.accessMode }} + persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }} + hostPath: + path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPathLog }} diff --git a/kubernetes/selfservice/templates/pvc.yaml b/kubernetes/selfservice/templates/pvc.yaml new file mode 100644 index 0000000000..1301f485f5 --- /dev/null +++ b/kubernetes/selfservice/templates/pvc.yaml @@ -0,0 +1,55 @@ +{{/* +# 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. +*/}} + +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: {{ .Values.persistence.volumeMountName }} + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" +spec: + selector: + matchLabels: + name: {{ .Values.persistence.volumeName}} + accessModes: + - {{ .Values.persistence.accessMode }} + resources: + requests: + storage: {{ .Values.persistence.size}} +--- +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: {{ include "common.fullname" . }}-log + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" +spec: + selector: + matchLabels: + name: {{ include "common.fullname" . }}-log + accessModes: + - {{ .Values.persistence.accessMode }} + resources: + requests: + storage: {{ .Values.persistence.size}} diff --git a/kubernetes/selfservice/templates/secrets.yaml b/kubernetes/selfservice/templates/secrets.yaml new file mode 100644 index 0000000000..fe2198d126 --- /dev/null +++ b/kubernetes/selfservice/templates/secrets.yaml @@ -0,0 +1,34 @@ +# An optional propery file for accessing the k8s by self service, for deployment, tiller etc. +# It is assumed to be prepared during boot strapping +# By default this is NOT required +# The content of the file should be a java properties format and should include the following keys +# username - the k8s username to use, for example kubernetes-admin +# token - the k8s token to use, for example as returned by: +# $ kubectl describe secret $(kubectl get secrets | grep default | cut -f1 -d ' ') | grep -E '^token' | cut -f2 -d':' | tr -d '\t' +# api_url - the k8s api url, for example https://10.247.88.15:6443 +# Once you have this file, you may pass its base64 value, for example, if you placed the file at /root/k8s/access.props: +# helm install --set k8sAccessProps=`cat /root/k8s/access.props |base64 --wrap 0` -n aee-selfservice selfservice +apiVersion: v1 +kind: Secret +metadata: + name: k8s-api-secret + namespace: {{ include "common.namespace" . }} +type: Opaque +data: + access.props: {{ .Values.k8sAccessProps }} +--- +apiVersion: v1 +kind: Secret +metadata: + name: {{ include "common.namespace" . }}-ss-docker-registry-key + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +data: + .dockercfg: {{ include "common.repository.secret" . }} +type: kubernetes.io/dockercfg + + diff --git a/kubernetes/selfservice/templates/service.yaml b/kubernetes/selfservice/templates/service.yaml new file mode 100644 index 0000000000..44442551e9 --- /dev/null +++ b/kubernetes/selfservice/templates/service.yaml @@ -0,0 +1,38 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "common.servicename" . }} + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + type: {{ .Values.service.type }} + ports: + {{if eq .Values.service.type "NodePort" -}} + - name: {{ .Values.service.httpPortName }} + port: {{ .Values.service.httpExternalPort }} + nodePort: {{ .Values.global.nodePortPrefixExt | default .Values.nodePortPrefixExt }}{{ .Values.service.httpNodePort }} + - name: {{ .Values.service.debugPortName }} + port: {{ .Values.service.debugExternalPort }} + nodePort: {{ .Values.global.nodePortPrefixExt | default .Values.nodePortPrefixExt }}{{ .Values.service.debugNodePort }} + - name: {{ .Values.service.dbPortName }} + port: {{ .Values.service.dbExternalPort }} + nodePort: {{ .Values.global.nodePortPrefixExt | default .Values.nodePortPrefixExt }}{{ .Values.service.dbNodePort }} + {{- else -}} + - name: {{ .Values.service.httpPortName }} + port: {{ .Values.service.httpExternalPort }} + targetPort: {{ .Values.service.httpInternalPort }} + - name: {{ .Values.service.debugPortName }} + port: {{ .Values.service.debugExternalPort }} + targetPort: {{ .Values.service.debugInternalPort }} + - name: {{ .Values.service.dbPortName }} + port: {{ .Values.service.dbExternalPort }} + targetPort: {{ .Values.service.dbInternalPort }} + {{- end}} + selector: + app: {{ include "common.name" . }} + release: {{ .Release.Name }} + |