lbry-docker/contrib/k8s-lbry/charts/chainquery/templates/deployments.yaml

62 lines
1.9 KiB
YAML
Raw Normal View History

2019-05-01 01:13:10 +02:00
{{- if .Values.enabled }}
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: {{ template "chainquery.fullname" . }}
labels:
app: {{ template "chainquery.name" . }}
chart: {{ template "chainquery.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
strategy:
type: Recreate
selector:
matchLabels:
app: {{ template "chainquery.name" . }}
release: {{ .Release.Name }}
template:
metadata:
labels:
app: {{ template "chainquery.name" . }}
release: {{ .Release.Name }}
spec:
securityContext:
fsGroup: 1000
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
{{- if .Values.configurationFile }}
initContainers:
- name: copy-chainquery-config
image: busybox
command: ['sh', '-c', 'cp /configmap/chainqueryconfig.toml /etc/lbry/chainqueryconfig.toml']
volumeMounts:
- name: configmap
mountPath: /configmap
- name: config
mountPath: /etc/lbry
{{- end }}
containers:
- name: {{ template "chainquery.fullname" . }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
resources:
{{ toYaml .Values.resources | indent 10 }}
ports:
- name: port
containerPort: {{ .Values.service.port }}
volumeMounts:
{{- if .Values.configurationFile }}
- name: config
mountPath: /etc/lbry/chainqueryconfig.toml
subPath: chainqueryconfig.toml
{{- end }}
volumes:
{{- if .Values.configurationFile }}
- name: config
emptyDir: {}
- name: configmap
configMap:
name: {{ template "chainquery.fullname" . }}
{{- end }}
{{- end }}