summaryrefslogtreecommitdiffstats
path: root/kubernetes/aaf/templates
diff options
context:
space:
mode:
authorMandeep Khinda <mandeep.khinda@amdocs.com>2018-10-09 14:47:35 +0000
committerMandeep Khinda <mandeep.khinda@amdocs.com>2018-10-11 00:52:31 +0000
commit6dcc80d4de60b8de810216f8ed8b66e8b496e1c3 (patch)
tree73dfe10ec12e10733dca273e7ac0896e004e5718 /kubernetes/aaf/templates
parentecfeff652323b5b09e7d70b513863c711f1919c7 (diff)
refactor AAF casablanca charts
Issue-ID: AAF-539 Change-Id: Id1f263d526ef5fa88c6cd25f7ed1779d3a0cd2ee Signed-off-by: Mandeep Khinda <mandeep.khinda@amdocs.com>
Diffstat (limited to 'kubernetes/aaf/templates')
-rw-r--r--kubernetes/aaf/templates/configmap.yaml48
-rw-r--r--kubernetes/aaf/templates/job.yaml115
-rw-r--r--kubernetes/aaf/templates/pv.yaml52
-rw-r--r--kubernetes/aaf/templates/pvc.yaml57
-rw-r--r--kubernetes/aaf/templates/secrets.yaml30
5 files changed, 111 insertions, 191 deletions
diff --git a/kubernetes/aaf/templates/configmap.yaml b/kubernetes/aaf/templates/configmap.yaml
deleted file mode 100644
index 9d21e057d6..0000000000
--- a/kubernetes/aaf/templates/configmap.yaml
+++ /dev/null
@@ -1,48 +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: ConfigMap
-metadata:
- name: {{ .Release.Name }}-aaf-backup
- namespace: {{ include "common.namespace" . }}
-data:
-{{ tpl (.Files.Glob "resources/config/backup/*").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/kubernetes/aaf/templates/job.yaml b/kubernetes/aaf/templates/job.yaml
index 719b6dc2c2..103b908491 100644
--- a/kubernetes/aaf/templates/job.yaml
+++ b/kubernetes/aaf/templates/job.yaml
@@ -15,7 +15,7 @@
apiVersion: batch/v1
kind: Job
metadata:
- name: {{ include "common.fullname" . }}-create-config
+ name: {{ .Release.Name }}-create-config
namespace: {{ include "common.namespace" . }}
labels:
app: {{ include "common.name" . }}
@@ -29,79 +29,28 @@ spec:
app: aaf-init-job
release: {{ .Release.Name }}
spec:
- initContainers:
- - name: {{ include "common.name" . }}-inject-config
- command:
- - /bin/bash
- - -c
- - >
- git clone -b {{ .Values.config.gerritBranch }} --single-branch {{ .Values.config.gerritProject }} /tmp/gerrit;
- echo "Clone complete. Copying from /tmp/gerrit/ to /public";
- cp -rf /tmp/gerrit/auth/sample/public/* /public;
- echo "Done.";
- image: "{{ .Values.global.ubuntuInitRepository }}/{{ .Values.global.ubuntuInitImage }}"
- imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
- volumeMounts:
- - name: aaf-public
- mountPath: "/public"
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 }}"
+ - name: {{ include "common.name" . }}-config-container
+ image: "{{ include "common.repository" . }}/{{ .Values.aaf_config.image }}"
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
- subPath: truststoreONAP.p12
- - mountPath: /data1/public/AAF_RootCA.cer
- name: aaf-public
- subPath: AAF_RootCA.cer
- - mountPath: /data1/public/truststoreONAPall.jks
- name: aaf-public
- 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
- - mountPath: /share
- name: aaf-public
+ - mountPath: "/opt/app/osaaf"
+ name: {{ include "common.name" . }}-config-vol
+ env:
+ - name: HOSTNAME
+ value: "{{ .Values.global.cadi.hostname }}"
+ - name: AAF_ENV
+ value: "{{ .Values.global.cadi.aaf_env }}"
+ - name: AAF_REGISTER_AS
+ value: "{{ .Values.global.cadi.aaf_register_as }}"
+ - name: LATITUDE
+ value: "{{ .Values.global.cadi.cadi_latitude }}"
+ - name: LONGITUDE
+ value: "{{ .Values.global.cadi.cadi_longitude }}"
+ - name: CASS_HOST
+ value: "{{ .Values.global.cassandraServiceName }}"
+ - name: AAF_LOCATOR_AS
+ value: "{{ .Values.global.locateServiceName }}"
resources:
{{ include "common.resources" . | indent 12 }}
{{- if .Values.nodeSelector }}
@@ -113,33 +62,13 @@ spec:
{{ 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-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-data
- configMap:
- name: {{ .Release.Name }}-aaf-data
- - name: aaf-persistent-data
+ - name: {{ include "common.name" . }}-config-vol
{{- if .Values.global.persistence.enabled }}
persistentVolumeClaim:
- claimName: {{ .Release.Name }}-aaf-pvc
+ claimName: {{ .Release.Name }}-config
{{- else }}
emptyDir: {}
{{- end }}
- - name: aaf-public
- emptyDir: {}
restartPolicy: OnFailure
imagePullSecrets:
- name: "{{ include "common.namespace" . }}-docker-registry-key"
diff --git a/kubernetes/aaf/templates/pv.yaml b/kubernetes/aaf/templates/pv.yaml
index d9b58f62ad..9d28184985 100644
--- a/kubernetes/aaf/templates/pv.yaml
+++ b/kubernetes/aaf/templates/pv.yaml
@@ -14,24 +14,60 @@
# limitations under the License.
*/}}
-{{- if and .Values.global.persistence.enabled (not .Values.persistence.existingClaim) -}}
+{{- if and .Values.global.persistence.enabled (not .Values.persistence.config.existingClaim) }}
kind: PersistentVolume
apiVersion: v1
metadata:
- name: {{ include "common.fullname" . }}
+ name: {{ .Release.Name }}-config
namespace: {{ include "common.namespace" . }}
labels:
- app: {{ include "common.name" . }}
+ app: {{ include "common.name" . }}-config
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
name: {{ include "common.fullname" . }}
spec:
capacity:
- storage: {{ .Values.persistence.size}}
+ storage: {{ .Values.persistence.config.size}}
accessModes:
- - {{ .Values.persistence.accessMode }}
- persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }}
+ - {{ .Values.persistence.config.accessMode }}
+ persistentVolumeReclaimPolicy: {{ .Values.persistence.config.volumeReclaimPolicy }}
hostPath:
- path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}
-{{- end -}}
+ path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.config.mountSubPath }}
+{{- if .Values.persistence.config.storageClass }}
+{{- if (eq "-" .Values.persistence.config.storageClass) }}
+ storageClassName: ""
+{{- else }}
+ storageClassName: "{{ .Values.persistence.config.storageClass }}"
+{{- end }}
+{{- end }}
+{{- end }}
+---
+{{- if and .Values.global.persistence.enabled (not .Values.persistence.logs.existingClaim) }}
+kind: PersistentVolume
+apiVersion: v1
+metadata:
+ name: {{ .Release.Name }}-logs
+ namespace: {{ include "common.namespace" . }}
+ labels:
+ app: {{ include "common.name" . }}-logs
+ chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
+ release: "{{ .Release.Name }}"
+ heritage: "{{ .Release.Service }}"
+ name: {{ include "common.fullname" . }}
+spec:
+ capacity:
+ storage: {{ .Values.persistence.logs.size}}
+ accessModes:
+ - {{ .Values.persistence.logs.accessMode }}
+ persistentVolumeReclaimPolicy: {{ .Values.persistence.logs.volumeReclaimPolicy }}
+ hostPath:
+ path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.logs.mountSubPath }}
+{{- if .Values.persistence.logs.storageClass }}
+{{- if (eq "-" .Values.persistence.logs.storageClass) }}
+ storageClassName: ""
+{{- else }}
+ storageClassName: "{{ .Values.persistence.logs.storageClass }}"
+{{- end }}
+{{- end }}
+{{- end }} \ No newline at end of file
diff --git a/kubernetes/aaf/templates/pvc.yaml b/kubernetes/aaf/templates/pvc.yaml
index 255c27751c..a9c8b908eb 100644
--- a/kubernetes/aaf/templates/pvc.yaml
+++ b/kubernetes/aaf/templates/pvc.yaml
@@ -14,35 +14,68 @@
# limitations under the License.
*/}}
-{{- if and .Values.global.persistence.enabled (not .Values.persistence.existingClaim) -}}
+{{- if and .Values.global.persistence.enabled (not .Values.persistence.config.existingClaim) }}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
- name: {{ .Release.Name }}-aaf-pvc
+ name: {{ .Release.Name }}-config
namespace: {{ include "common.namespace" . }}
labels:
- app: {{ include "common.name" . }}
+ app: {{ include "common.name" . }}-config
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
-{{- if .Values.persistence.annotations }}
+{{- if .Values.persistence.config.annotations }}
annotations:
-{{ toYaml .Values.persistence.annotations | indent 4 }}
+{{ toYaml .Values.persistence.config.annotations | indent 4 }}
{{- end }}
spec:
selector:
matchLabels:
- name: {{ include "common.fullname" . }}
+ app: {{ include "common.name" . }}-config
accessModes:
- - {{ .Values.persistence.accessMode }}
+ - {{ .Values.persistence.config.accessMode }}
resources:
requests:
- storage: {{ .Values.persistence.size }}
-{{- if .Values.persistence.storageClass }}
-{{- if (eq "-" .Values.persistence.storageClass) }}
+ storage: {{ .Values.persistence.config.size }}
+{{- if .Values.persistence.config.storageClass }}
+{{- if (eq "-" .Values.persistence.config.storageClass) }}
storageClassName: ""
{{- else }}
- storageClassName: "{{ .Values.persistence.storageClass }}"
+ storageClassName: "{{ .Values.persistence.config.storageClass }}"
{{- end }}
{{- end }}
-{{- end -}}
+{{- end }}
+---
+{{- if and .Values.global.persistence.enabled (not .Values.persistence.logs.existingClaim) }}
+kind: PersistentVolumeClaim
+apiVersion: v1
+metadata:
+ name: {{ .Release.Name }}-logs
+ namespace: {{ include "common.namespace" . }}
+ labels:
+ app: {{ include "common.name" . }}-logs
+ chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
+ release: "{{ .Release.Name }}"
+ heritage: "{{ .Release.Service }}"
+{{- if .Values.persistence.logs.annotations }}
+ annotations:
+{{ toYaml .Values.persistence.logs.annotations | indent 4 }}
+{{- end }}
+spec:
+ selector:
+ matchLabels:
+ app: {{ include "common.name" . }}-logs
+ accessModes:
+ - {{ .Values.persistence.logs.accessMode }}
+ resources:
+ requests:
+ storage: {{ .Values.persistence.logs.size }}
+{{- if .Values.persistence.logs.storageClass }}
+{{- if (eq "-" .Values.persistence.logs.storageClass) }}
+ storageClassName: ""
+{{- else }}
+ storageClassName: "{{ .Values.persistence.logs.storageClass }}"
+{{- end }}
+{{- end }}
+{{- end -}} \ No newline at end of file
diff --git a/kubernetes/aaf/templates/secrets.yaml b/kubernetes/aaf/templates/secrets.yaml
deleted file mode 100644
index fe876e1c6c..0000000000
--- a/kubernetes/aaf/templates/secrets.yaml
+++ /dev/null
@@ -1,30 +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: 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