summaryrefslogtreecommitdiffstats
path: root/kubernetes/appc/charts/appc-ansible-server/templates/statefulset.yaml
diff options
context:
space:
mode:
authorJames MacNider <James.MacNider@amdocs.com>2019-04-10 13:00:00 +0000
committerGerrit Code Review <gerrit@onap.org>2019-04-10 13:00:00 +0000
commit0a963269106eeee84f48bcb2bb7c64449a43d3c6 (patch)
treec243bb53ec9bf3db43ec07acb469c8249a5a2573 /kubernetes/appc/charts/appc-ansible-server/templates/statefulset.yaml
parenta12e76d8b95ed9830dd3a5666ff7b2e14c46dd3b (diff)
parent0fc907668d782e8726ac55e6f666cfe7035e0ad8 (diff)
Merge "expose ansible container on nfs mount"
Diffstat (limited to 'kubernetes/appc/charts/appc-ansible-server/templates/statefulset.yaml')
-rw-r--r--kubernetes/appc/charts/appc-ansible-server/templates/statefulset.yaml114
1 files changed, 114 insertions, 0 deletions
diff --git a/kubernetes/appc/charts/appc-ansible-server/templates/statefulset.yaml b/kubernetes/appc/charts/appc-ansible-server/templates/statefulset.yaml
new file mode 100644
index 0000000000..5f1cc5ae24
--- /dev/null
+++ b/kubernetes/appc/charts/appc-ansible-server/templates/statefulset.yaml
@@ -0,0 +1,114 @@
+# Copyright © 2018 Amdocs, Bell Canada, AT&T
+#
+# 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: apps/v1beta1
+kind: StatefulSet
+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 }}
+spec:
+ replicas: {{ .Values.replicaCount }}
+ template:
+ metadata:
+ labels:
+ app: {{ include "common.name" . }}
+ release: {{ .Release.Name }}
+ spec:
+ initContainers:
+ - command:
+ - /root/ready.py
+ args:
+ - --container-name
+ - {{ .Values.config.appcChartName }}
+ 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:
+ - name: {{ include "common.name" . }}
+ command: ["/bin/bash"]
+ args: ["-c", "cd /opt/onap/ccsdk && ./startAnsibleServer.sh"]
+ image: "{{ include "common.repository" . }}/{{ .Values.image }}"
+ imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
+ ports:
+ - containerPort: {{ .Values.service.internalPort }}
+ # disable liveness probe when breakpoints set in debugger
+ # so K8s doesn't restart unresponsive container
+ {{ if .Values.liveness.enabled }}
+ 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 }}
+ volumeMounts:
+ - mountPath: /etc/localtime
+ name: localtime
+ readOnly: true
+ - mountPath: {{ .Values.config.configDir }}/RestServer_config
+ name: config
+ subPath: RestServer_config
+ - mountPath: {{ .Values.persistence.playbookPath }}
+ name: {{ include "common.fullname" . }}-data
+ resources:
+{{ include "common.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: config
+ configMap:
+ name: {{ include "common.fullname" . }}
+ defaultMode: 0644
+{{ if not .Values.persistence.enabled }}
+ - name: {{ include "common.fullname" . }}-data
+ emptyDir: {}
+{{ else }}
+ volumeClaimTemplates:
+ - metadata:
+ name: {{ include "common.fullname" . }}-data
+ labels:
+ name: {{ include "common.fullname" . }}
+ spec:
+ accessModes: [ {{ .Values.persistence.accessMode }} ]
+ storageClassName: {{ include "common.fullname" . }}-data
+ resources:
+ requests:
+ storage: {{ .Values.persistence.size }}
+{{ end }}
+ imagePullSecrets:
+ - name: "{{ include "common.namespace" . }}-docker-registry-key"