diff options
Diffstat (limited to 'templates')
-rw-r--r-- | templates/configmap.yaml | 39 | ||||
-rw-r--r-- | templates/deployment.yaml | 91 | ||||
-rw-r--r-- | templates/job.yaml | 132 | ||||
-rw-r--r-- | templates/pv.yaml | 37 | ||||
-rw-r--r-- | templates/pvc.yaml | 48 | ||||
-rw-r--r-- | templates/secrets.yaml | 47 | ||||
-rw-r--r-- | templates/service.yaml | 41 |
7 files changed, 301 insertions, 134 deletions
diff --git a/templates/configmap.yaml b/templates/configmap.yaml index c7cf9ae..cfa57f7 100644 --- a/templates/configmap.yaml +++ b/templates/configmap.yaml @@ -15,7 +15,42 @@ apiVersion: v1 kind: ConfigMap metadata: - name: {{ include "common.fullname" . }} + name: {{ .Release.Name }}-aaf-backup namespace: {{ include "common.namespace" . }} data: -{{ (.Files.Glob "resources/config/aaf-data/*").AsConfig | indent 2 }} +{{ tpl (.Files.Glob "resources/config/backup/*").AsConfig . | indent 2 }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ .Release.Name }}-aaf-public + namespace: {{ include "common.namespace" . }} +data: +{{ tpl (.Files.Glob "resources/config/public/*").AsConfig . | indent 2 }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ .Release.Name }}-aaf-local + namespace: {{ include "common.namespace" . }} +data: +{{ tpl (.Files.Glob "resources/config/local/org.osaaf.location.props").AsConfig . | indent 2 }} +{{ tpl (.Files.Glob "resources/config/local/org.osaaf.cm.ca.props").AsConfig . | indent 2 }} +{{ tpl (.Files.Glob "resources/config/local/org.osaaf.cassandra.props").AsConfig . | indent 2 }} +{{ tpl (.Files.Glob "resources/config/local/org.osaaf.aaf.props").AsConfig . | indent 2 }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ .Release.Name }}-aaf-etc + namespace: {{ include "common.namespace" . }} +data: +{{ tpl (.Files.Glob "resources/config/etc/*").AsConfig . | indent 2 }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ .Release.Name }}-aaf-data + namespace: {{ include "common.namespace" . }} +data: +{{ tpl (.Files.Glob "resources/config/data/*").AsConfig . | indent 2 }} diff --git a/templates/deployment.yaml b/templates/deployment.yaml deleted file mode 100644 index 2a4e7d2..0000000 --- a/templates/deployment.yaml +++ /dev/null @@ -1,91 +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. - -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 }} - selector: - matchLabels: - app: {{ include "common.name" . }} - template: - metadata: - labels: - app: {{ include "common.name" . }} - name: {{ include "common.fullname" . }} - spec: - initContainers: - - command: - - /root/ready.py - args: - - --container-name - - aaf-cs - 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: - - env: - - name: CASSANDRA_CLUSTER - value: cassandra_container - image: "{{ include "common.repository" . }}/{{ .Values.image }}" - imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} - volumeMounts: - - mountPath: /data - name: aaf-data - name: {{ include "common.name" . }} - # 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 }} - 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 }} - - volumes: - - name: aaf-data - configMap: - name: {{ include "common.fullname" . }} - imagePullSecrets: - - name: "{{ include "common.namespace" . }}-docker-registry-key" diff --git a/templates/job.yaml b/templates/job.yaml new file mode 100644 index 0000000..7ce871e --- /dev/null +++ b/templates/job.yaml @@ -0,0 +1,132 @@ +# 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: batch/v1 +kind: Job +metadata: + name: {{ include "common.fullname" . }}-create-config + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + template: + metadata: + labels: + app: aaf-init-job + release: {{ .Release.Name }} + spec: + containers: + - command: ["/bin/bash","-c","if [ ! -d /data/backup ]; then mkdir /data/data && cp -Ra /data1/data/..data/* /data/data/ && mkdir /data/etc && cp -Ra /data1/etc/..data/* data/etc/ && mkdir /data/backup && cp -Ra /data1/backup/..data/* /data/backup/ && cp -Ra /data1/public /data/ && cp -Ra /data1/local /data && mkdir -p /data/logs/oauth && mkdir -p /data/logs/hello && mkdir -p /data/logs/fs && mkdir -p /data/logs/gui && mkdir -p /data/logs/locate && mkdir -p /data/logs/cm && mkdir -p /data/logs/service; fi; exit 0"] + image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + name: aaf-init-job + volumeMounts: + - mountPath: /etc/localtime + name: localtime + readOnly: true + - mountPath: /data + name: aaf-persistent-data + - mountPath: /data1/etc + name: aaf-etc + - mountPath: /data1/data + name: aaf-data + - mountPath: /data1/public/iframe_denied_test.html + name: aaf-public + subPath: iframe_denied_test.html + - mountPath: /data1/public/aaf_2_0.xsd + name: aaf-public + subPath: aaf_2_0.xsd + - mountPath: /data1/public/truststoreONAP.p12 + name: aaf-public-secret + subPath: truststoreONAP.p12 + - mountPath: /data1/public/AAF_RootCA.cer + name: aaf-public-secret + subPath: AAF_RootCA.cer + - mountPath: /data1/public/truststoreONAPall.jks + name: aaf-public-secret + subPath: truststoreONAPall.jks + - mountPath: /data1/local/org.osaaf.location.props + name: aaf-local + subPath: org.osaaf.location.props + - mountPath: /data1/local/org.osaaf.cm.ca.props + name: aaf-local + subPath: org.osaaf.cm.ca.props + - mountPath: /data1/local/org.osaaf.cassandra.props + name: aaf-local + subPath: org.osaaf.cassandra.props + - mountPath: /data1/local/org.osaaf.aaf.props + name: aaf-local + subPath: org.osaaf.aaf.props + - mountPath: /data1/local/org.osaaf.aaf.trust.p12 + name: aaf-local-secret + subPath: org.osaaf.aaf.trust.p12 + - mountPath: /data1/local/org.osaaf.aaf.p12 + name: aaf-local-secret + subPath: org.osaaf.aaf.p12 + - mountPath: /data1/local/org.osaaf.aaf.keyfile + name: aaf-local-secret + subPath: org.osaaf.aaf.keyfile + - mountPath: /data1/local/org.osaaf.aaf.cm.p12 + name: aaf-local-secret + subPath: org.osaaf.aaf.cm.p12 + - mountPath: /data1/backup + name: aaf-backup + 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 }} + volumes: + - name: localtime + hostPath: + path: /etc/localtime + - name: aaf-local-secret + secret: + secretName: {{ .Release.Name }}-aaf-local-secret + - name: aaf-public-secret + secret: + secretName: {{ .Release.Name }}-aaf-public-secret + - name: aaf-etc + configMap: + name: {{ .Release.Name }}-aaf-etc + - name: aaf-local + configMap: + name: {{ .Release.Name }}-aaf-local + - name: aaf-backup + configMap: + name: {{ .Release.Name }}-aaf-backup + - name: aaf-public + configMap: + name: {{ .Release.Name }}-aaf-public + - name: aaf-data + configMap: + name: {{ .Release.Name }}-aaf-data + - name: aaf-persistent-data + {{- if .Values.global.persistence.enabled }} + persistentVolumeClaim: + claimName: {{ .Release.Name }}-aaf-pvc + {{- else }} + emptyDir: {} + {{- end }} + restartPolicy: OnFailure + imagePullSecrets: + - name: "{{ include "common.namespace" . }}-docker-registry-key" diff --git a/templates/pv.yaml b/templates/pv.yaml new file mode 100644 index 0000000..d9b58f6 --- /dev/null +++ b/templates/pv.yaml @@ -0,0 +1,37 @@ +{{/* +# 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 and .Values.global.persistence.enabled (not .Values.persistence.existingClaim) -}} +kind: PersistentVolume +apiVersion: v1 +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 }}" + name: {{ include "common.fullname" . }} +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 }} +{{- end -}} diff --git a/templates/pvc.yaml b/templates/pvc.yaml new file mode 100644 index 0000000..255c277 --- /dev/null +++ b/templates/pvc.yaml @@ -0,0 +1,48 @@ +{{/* +# 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 and .Values.global.persistence.enabled (not .Values.persistence.existingClaim) -}} +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: {{ .Release.Name }}-aaf-pvc + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" +{{- if .Values.persistence.annotations }} + annotations: +{{ toYaml .Values.persistence.annotations | indent 4 }} +{{- end }} +spec: + selector: + matchLabels: + name: {{ include "common.fullname" . }} + accessModes: + - {{ .Values.persistence.accessMode }} + resources: + requests: + storage: {{ .Values.persistence.size }} +{{- if .Values.persistence.storageClass }} +{{- if (eq "-" .Values.persistence.storageClass) }} + storageClassName: "" +{{- else }} + storageClassName: "{{ .Values.persistence.storageClass }}" +{{- end }} +{{- end }} +{{- end -}} diff --git a/templates/secrets.yaml b/templates/secrets.yaml new file mode 100644 index 0000000..d67601c --- /dev/null +++ b/templates/secrets.yaml @@ -0,0 +1,47 @@ +# 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: Secret +metadata: + name: {{ .Release.Name}}-aaf-local-secret + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +data: +{{ (.Files.Glob "resources/config/local/org.osaaf.aaf.trust.p12").AsSecrets | indent 2 }} +{{ (.Files.Glob "resources/config/local/org.osaaf.aaf.p12").AsSecrets | indent 2 }} +{{ (.Files.Glob "resources/config/local/org.osaaf.aaf.keyfile").AsSecrets | indent 2 }} +{{ (.Files.Glob "resources/config/local/org.osaaf.aaf.cm.p12").AsSecrets | indent 2 }} +type: Opaque +--- +apiVersion: v1 +kind: Secret +metadata: + name: {{ .Release.Name}}-aaf-public-secret + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +data: +{{ (.Files.Glob "resources/config/public/truststoreONAP.p12").AsSecrets | indent 2 }} +{{ (.Files.Glob "resources/config/public/AAF_RootCA.cer").AsSecrets | indent 2 }} +{{ (.Files.Glob "resources/config/public/truststoreONAPall.jks").AsSecrets | indent 2 }} +type: Opaque + diff --git a/templates/service.yaml b/templates/service.yaml deleted file mode 100644 index 587e07a..0000000 --- a/templates/service.yaml +++ /dev/null @@ -1,41 +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. - -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: - ports: - {{if eq .Values.service.type "NodePort" -}} - - port: {{ .Values.service.externalPort }} - #Example internal target port if required - #targetPort: {{ .Values.service.internalPort }} - nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .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 }} - type: {{ .Values.service.type }} |