aboutsummaryrefslogtreecommitdiffstats
path: root/kubernetes/vnfsdk/templates
diff options
context:
space:
mode:
authorjasmineWen <jasmine.wen@amdocs.com>2018-08-29 15:55:28 +0000
committerjasmineWen <jasmine.wen@amdocs.com>2018-09-14 17:49:13 +0000
commitfb56f0f4bf91c10fc2e898993c70c49613b67bcc (patch)
treec459ca605dd588d46f4700b609bb4a95a9f57bd8 /kubernetes/vnfsdk/templates
parent48e8fe5f53f34428e4dffe7b4760586d7e48c8cd (diff)
Upgrade VNFSDK to use common Postgres charts
Issue-ID: OOM-1185 Change-Id: Ie011e87bc9322149076ec62cab3a8b3315e1d817 Signed-off-by: jasmineWen <jasmine.wen@amdocs.com>
Diffstat (limited to 'kubernetes/vnfsdk/templates')
-rw-r--r--kubernetes/vnfsdk/templates/configmap.yaml21
-rw-r--r--kubernetes/vnfsdk/templates/deployment.yaml4
-rw-r--r--kubernetes/vnfsdk/templates/job.yaml70
3 files changed, 93 insertions, 2 deletions
diff --git a/kubernetes/vnfsdk/templates/configmap.yaml b/kubernetes/vnfsdk/templates/configmap.yaml
new file mode 100644
index 0000000000..5a40a61427
--- /dev/null
+++ b/kubernetes/vnfsdk/templates/configmap.yaml
@@ -0,0 +1,21 @@
+# 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: {{ include "common.fullname" . }}
+ namespace: {{ include "common.namespace" . }}
+data:
+{{ tpl (.Files.Glob "resources/config/marketplace_tables_postgres.sql").AsConfig . | indent 2 }}
diff --git a/kubernetes/vnfsdk/templates/deployment.yaml b/kubernetes/vnfsdk/templates/deployment.yaml
index 8220553cf6..5b6f9237ce 100644
--- a/kubernetes/vnfsdk/templates/deployment.yaml
+++ b/kubernetes/vnfsdk/templates/deployment.yaml
@@ -38,7 +38,7 @@ spec:
- /root/ready.py
args:
- --container-name
- - "{{ .Values.vnfsdkpostgres.nameOverride }}"
+ - "{{ .Values.postgres.nameOverride }}"
env:
- name: NAMESPACE
valueFrom:
@@ -54,7 +54,7 @@ spec:
name: {{ include "common.name" . }}
env:
- name: POSTGRES_SERVICE_HOST
- value: "$(VNFSDK_POSTGRES_SERVICE_HOST)"
+ value: "$(VNFSDK_DBSET_SERVICE_HOST)"
readinessProbe:
tcpSocket:
port: {{ .Values.service.internalPort }}
diff --git a/kubernetes/vnfsdk/templates/job.yaml b/kubernetes/vnfsdk/templates/job.yaml
new file mode 100644
index 0000000000..08d31077c6
--- /dev/null
+++ b/kubernetes/vnfsdk/templates/job.yaml
@@ -0,0 +1,70 @@
+# 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" . }}-init-postgres
+ namespace: {{ include "common.namespace" . }}
+ labels:
+ app: {{ include "common.name" . }}-job
+ chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
+ release: {{ .Release.Name }}
+ heritage: {{ .Release.Service }}
+spec:
+ backoffLimit: 20
+ template:
+ metadata:
+ labels:
+ app: {{ include "common.name" . }}-job
+ release: {{ .Release.Name }}
+ spec:
+ restartPolicy: Never
+ initContainers:
+ - command:
+ - /root/ready.py
+ args:
+ - --container-name
+ - "{{ .Values.postgres.nameOverride }}"
+ env:
+ - name: NAMESPACE
+ valueFrom:
+ fieldRef:
+ apiVersion: v1
+ fieldPath: metadata.namespace
+ image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
+ imagePullPolicy: {{ .Values.global.pullPolicy}}
+ name: {{ include "common.name" . }}-readiness
+ containers:
+ - name: {{ include "common.name" . }}-job
+ image: "{{ .Values.postgresRepository }}/{{ .Values.postgresImage }}"
+ imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
+ env:
+ - name: PGPASSWORD
+ value: "{{ .Values.postgres.config.pgUserPassword }}"
+ command:
+ - /bin/sh
+ - -c
+ - |
+ psql -U {{ .Values.postgres.config.pgUserName }} -h $(VNFSDK_DBPRI_SERVICE_HOST) -f /aaa/init/marketplace_tables_postgres.sql
+ volumeMounts:
+ - name: init-data
+ mountPath: /aaa/init/marketplace_tables_postgres.sql
+ subPath: marketplace_tables_postgres.sql
+ imagePullSecrets:
+ - name: "{{ include "common.namespace" . }}-docker-registry-key"
+ volumes:
+ - name: init-data
+ configMap:
+ name: {{ include "common.fullname" . }}