Files
polaris/deploy/helm/fairwinds/templates/webhook.deployment.yaml
2019-04-29 10:58:30 -04:00

76 lines
2.2 KiB
YAML

{{- if .Values.webhook.enable -}}
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
annotations:
checksum/config: '{{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}'
name: {{ include "fairwinds.fullname" . }}-webhook
namespace: {{ .Release.Namespace }}
labels:
{{- include "fairwinds.labels" . | nindent 4 }}
component: webhook
spec:
replicas: {{ .Values.webhook.replicas }}
selector:
matchLabels:
{{- include "fairwinds.selectors" . | nindent 6 }}
component: webhook
template:
metadata:
labels:
{{- include "fairwinds.selectors" . | nindent 8 }}
component: webhook
spec:
volumes:
- name: config
configMap:
name: {{ include "fairwinds.fullname" . }}
- name: secret
secret:
secretName: {{ include "fairwinds.fullname" . }}
containers:
- command:
- fairwinds
- --webhook
image: '{{.Values.webhook.image.repository}}:{{.Values.webhook.image.tag}}'
imagePullPolicy: '{{.Values.webhook.image.pullPolicy}}'
name: webhook
ports:
- containerPort: 9876
# These are fairly useless readiness/liveness probes for now
# Follow this issue for potential improvements:
# https://github.com/kubernetes-sigs/controller-runtime/issues/356
livenessProbe:
exec:
command:
- sh
- -c
- ps -ef | grep fairwinds
initialDelaySeconds: 5
periodSeconds: 5
readinessProbe:
exec:
command:
- sh
- -c
- ps -ef | grep fairwinds
initialDelaySeconds: 5
periodSeconds: 5
resources:
limits:
cpu: 100m
memory: 128Mi
requests:
cpu: 100m
memory: 128Mi
volumeMounts:
- name: config
mountPath: /opt/app/config.yaml
subPath: config.yaml
readOnly: true
- name: secret
mountPath: /tmp/cert/
readOnly: true
serviceAccountName: {{ include "fairwinds.fullname" . }}
{{- end -}}