summaryrefslogtreecommitdiffstats
path: root/kubernetes/portal/charts/portal-cassandra/templates
diff options
context:
space:
mode:
Diffstat (limited to 'kubernetes/portal/charts/portal-cassandra/templates')
-rw-r--r--kubernetes/portal/charts/portal-cassandra/templates/configmap.yaml2
-rw-r--r--kubernetes/portal/charts/portal-cassandra/templates/deployment.yaml36
-rw-r--r--kubernetes/portal/charts/portal-cassandra/templates/secrets.yaml27
-rw-r--r--kubernetes/portal/charts/portal-cassandra/templates/service.yaml24
4 files changed, 40 insertions, 49 deletions
diff --git a/kubernetes/portal/charts/portal-cassandra/templates/configmap.yaml b/kubernetes/portal/charts/portal-cassandra/templates/configmap.yaml
index fd42fd49ac..e0fec186bb 100644
--- a/kubernetes/portal/charts/portal-cassandra/templates/configmap.yaml
+++ b/kubernetes/portal/charts/portal-cassandra/templates/configmap.yaml
@@ -18,5 +18,5 @@ metadata:
name: {{ include "common.fullname" . }}-docker-entry-initd
namespace: {{ include "common.namespace" . }}
data:
-{{ tpl (.Files.Glob "resources/config/mariadb/docker-entrypoint-initdb.d/*").AsConfig . | indent 2 }}
+{{ tpl (.Files.Glob "resources/config/cassandra/docker-entrypoint-initdb.d/*").AsConfig . | indent 2 }}
diff --git a/kubernetes/portal/charts/portal-cassandra/templates/deployment.yaml b/kubernetes/portal/charts/portal-cassandra/templates/deployment.yaml
index 91c4fa4140..9e1a57d6fa 100644
--- a/kubernetes/portal/charts/portal-cassandra/templates/deployment.yaml
+++ b/kubernetes/portal/charts/portal-cassandra/templates/deployment.yaml
@@ -40,26 +40,35 @@ spec:
- containerPort: {{ .Values.service.internalPort3 }}
- containerPort: {{ .Values.service.internalPort4 }}
- containerPort: {{ .Values.service.internalPort5 }}
- {{- if eq .Values.liveness.enabled true }}
+ {{ if eq .Values.liveness.enabled true }}
livenessProbe:
- tcpSocket:
- port: {{ .Values.service.internalPort }}
+ exec:
+ command:
+ - /bin/bash
+ - -c
+ - nodetool status | grep $POD_IP | awk '$1!="UN" { exit 1; }'
initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
periodSeconds: {{ .Values.liveness.periodSeconds }}
- {{end -}}
+ {{ end }}
readinessProbe:
- tcpSocket:
- port: {{ .Values.service.internalPort }}
+ exec:
+ command:
+ - /bin/bash
+ - -c
+ - nodetool status | grep $POD_IP | awk '$1!="UN" { exit 1; }'
initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
periodSeconds: {{ .Values.readiness.periodSeconds }}
env:
- name: CASSUSER
value: "{{ .Values.config.cassandraUsername }}"
- name: CASSPASS
+ value: "{{ .Values.config.cassandraPassword }}"
+ - name: JVM_OPTS
+ value: "{{ .Values.config.cassandraJvmOpts }}"
+ - name: POD_IP
valueFrom:
- secretKeyRef:
- name: {{ template "common.fullname" . }}
- key: db-root-password
+ fieldRef:
+ fieldPath: status.podIP
volumeMounts:
- mountPath: /etc/localtime
name: localtime
@@ -70,6 +79,8 @@ spec:
- name: cassandra-docker-entrypoint-initdb
mountPath: /docker-entrypoint-initdb.d/zzz_portalsdk.cql
subPath: portalsdk.cql
+ - name: {{ include "common.fullname" . }}-data
+ mountPath: /var/lib/cassandra/data
resources:
{{ toYaml .Values.resources | indent 12 }}
{{- if .Values.nodeSelector }}
@@ -87,5 +98,12 @@ spec:
- name: localtime
hostPath:
path: /etc/localtime
+ {{- if .Values.persistence.enabled }}
+ - name: {{ include "common.fullname" . }}-data
+ persistentVolumeClaim:
+ claimName: {{ include "common.fullname" . }}
+ {{- else }}
+ emptyDir: {}
+ {{- end }}
imagePullSecrets:
- name: "{{ include "common.namespace" . }}-docker-registry-key"
diff --git a/kubernetes/portal/charts/portal-cassandra/templates/secrets.yaml b/kubernetes/portal/charts/portal-cassandra/templates/secrets.yaml
deleted file mode 100644
index 6e4c210f6e..0000000000
--- a/kubernetes/portal/charts/portal-cassandra/templates/secrets.yaml
+++ /dev/null
@@ -1,27 +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: {{ include "common.fullname" . }}
- namespace: {{ include "common.namespace" . }}
- labels:
- app: {{ include "common.name" . }}
- chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
- release: {{ .Release.Name }}
- heritage: {{ .Release.Service }}
-type: Opaque
-data:
- db-root-password: {{ .Values.config.cassandraPassword | b64enc | quote }}
diff --git a/kubernetes/portal/charts/portal-cassandra/templates/service.yaml b/kubernetes/portal/charts/portal-cassandra/templates/service.yaml
index e78a42e83b..12174314d5 100644
--- a/kubernetes/portal/charts/portal-cassandra/templates/service.yaml
+++ b/kubernetes/portal/charts/portal-cassandra/templates/service.yaml
@@ -15,7 +15,7 @@
apiVersion: v1
kind: Service
metadata:
- name: {{ include "common.fullname" . }}
+ name: {{ include "common.servicename" . }}
namespace: {{ include "common.namespace" . }}
labels:
app: {{ include "common.name" . }}
@@ -29,41 +29,41 @@ spec:
- port: {{ .Values.service.externalPort }}
targetPort: {{ .Values.service.internalPort }}
nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort }}
- name: {{ .Values.service.name }}
+ name: {{ .Values.service.portName }}
- port: {{ .Values.service.externalPort2 }}
targetPort: {{ .Values.service.internalPort2 }}
nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort2 }}
- name: {{ .Values.service.name }}2
+ name: {{ .Values.service.portName }}2
- port: {{ .Values.service.externalPort3 }}
targetPort: {{ .Values.service.internalPort3 }}
nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort3 }}
- name: {{ .Values.service.name }}3
+ name: {{ .Values.service.portName }}3
- port: {{ .Values.service.externalPort4 }}
targetPort: {{ .Values.service.internalPort4 }}
nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort4 }}
- name: {{ .Values.service.name }}4
+ name: {{ .Values.service.portName }}4
- port: {{ .Values.service.externalPort5 }}
targetPort: {{ .Values.service.internalPort5 }}
nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort5 }}
- name: {{ .Values.service.name }}5
+ name: {{ .Values.service.portName }}5
{{- else -}}
- port: {{ .Values.service.externalPort }}
targetPort: {{ .Values.service.internalPort }}
- name: {{ .Values.service.name }}
+ name: {{ .Values.service.portName }}
- port: {{ .Values.service.externalPort2 }}
targetPort: {{ .Values.service.internalPort2 }}
- name: {{ .Values.service.name }}2
+ name: {{ .Values.service.portName }}2
- port: {{ .Values.service.externalPort3 }}
targetPort: {{ .Values.service.internalPort3 }}
- name: {{ .Values.service.name }}3
+ name: {{ .Values.service.portName }}3
- port: {{ .Values.service.externalPort4 }}
targetPort: {{ .Values.service.internalPort4 }}
- name: {{ .Values.service.name }}4
+ name: {{ .Values.service.portName }}4
- port: {{ .Values.service.externalPort5 }}
targetPort: {{ .Values.service.internalPort5 }}
- name: {{ .Values.service.name }}5
+ name: {{ .Values.service.portName }}5
{{- end}}
selector:
app: {{ include "common.name" . }}
- release: {{ .Release.Name }} \ No newline at end of file
+ release: {{ .Release.Name }}