Skip to content
Snippets Groups Projects
Commit fdf00181 authored by Andrea Michelotti's avatar Andrea Michelotti
Browse files

statefulset gateway

parent 7509798a
No related branches found
No related tags found
No related merge requests found
apiVersion: apps/v1
kind: Deployment
kind: StatefulSet
metadata:
name: {{ include "ca-gateway-chart.fullname" . }}
labels:
......@@ -9,6 +9,7 @@ spec:
selector:
matchLabels:
{{- include "ca-gateway-chart.selectorLabels" . | nindent 6 }}
serviceName: {{ include "ca-gateway-chart.fullname" . }}
template:
metadata:
{{- with .Values.podAnnotations }}
......@@ -19,63 +20,14 @@ spec:
{{- include "ca-gateway-chart.selectorLabels" . | nindent 8 }}
spec:
serviceAccountName: {{ include "ca-gateway-chart.serviceAccountName" . }}
{{- if 0 }}
initContainers:
- name: init-volumes
image: baltig.infn.it:4567/epics-containers/container-init
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
command:
- sh
- -c
- |
id
ls -latr /config
pwd
mountdir=/config
cd $mountdir
pwd
ls -latr
if [ -n {{ .Values.gitRepoConfig.url }} ]; then
if [ -n "{{ .Values.gitRepoConfig.branch }}" ]; then
git clone -b {{ .Values.gitRepoConfig.branch }} {{ .Values.gitRepoConfig.url }} --recurse-submodules
else
git clone {{ .Values.gitRepoConfig.url }} --recurse-submodules
fi
if [ -d temp-config/{{ .Values.gitRepoConfig.path }} ]; then
if [ "{{ .Values.gitRepoConfig.path }}" != "." ]; then
mv {{ .Values.gitRepoConfig.path }}/* $mountdir/
fi
fi
# chmod a+w,a+r -R $mountdir
fi
imagePullPolicy: IfNotPresent
resources:
{{ toYaml .Values.resources | indent 8}}
securityContext:
{{ toYaml .Values.securityContext | nindent 8 }}
volumeMounts:
- name: host-config
mountPath: /config
{{- end }}
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- if .Values.gitRepoConfig.url }}
# volumeMounts:
# - name: host-config
# mountPath: /config
{{- if .Values.gitRepoConfig.exec }}
command:
- sh
- sh
- -c
- |
mountdir=/epics/ca-gateway/configure
......@@ -105,10 +57,10 @@ spec:
- configMapRef:
name: {{ .Values.epicsConfiguration.name }}
{{- end }}
{{- range $envVar := .Values.env }}
- name: {{ $envVar.name }}
value: {{ $envVar.value | quote }}
{{- end }}
{{- range $envVar := .Values.env }}
- name: {{ $envVar.name }}
value: {{ $envVar.value | quote }}
{{- end }}
ports:
- containerPort: 5064
- containerPort: 5065
......@@ -128,10 +80,11 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
# {{- if .Values.gitRepoConfig.url }}
# volumes:
# - name: host-config
# hostPath:
# path: /tmp
# {{- end }}
volumeClaimTemplates:
- metadata:
name: data
spec:
accessModes: ["ReadWriteOnce"]
resources:
requests:
storage: 1Gi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment