promenade/charts/haproxy/templates/daemonset.yaml

88 lines
3.0 KiB
YAML

{{/*
Copyright 2018 AT&T Intellectual Property. All other rights reserved.
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.
*/}}
{{- $envAll := . }}
---
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
name: haproxy-anchor
annotations:
{{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }}
spec:
{{ tuple $envAll "haproxy_anchor" | include "helm-toolkit.snippets.kubernetes_upgrades_daemonset" | indent 2 }}
template:
metadata:
labels:
{{ tuple $envAll "kubernetes" "haproxy-anchor" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }}
annotations:
scheduler.alpha.kubernetes.io/critical-pod: ''
spec:
tolerations:
- key: node-role.kubernetes.io/master
effect: NoSchedule
- key: CriticalAddonsOnly
operator: Exists
terminationGracePeriodSeconds: {{ .Values.pod.lifecycle.termination_grace_period.haproxy_anchor.timeout }}
serviceAccountName: haproxy-anchor
containers:
- name: anchor
image: {{ .Values.images.tags.anchor }}
imagePullPolicy: {{ .Values.images.pull_policy }}
env:
- name: HAPROXY_HEADER
value: /tmp/etc/haproxy.cfg.header
- name: HAPROXY_CONF
value: /host{{ .Values.conf.haproxy.host_config_dir }}/haproxy.cfg
- name: NEXT_HAPROXY_CONF
value: "$(HAPROXY_CONF)-next"
- name: HAPROXY_SERVER_OPTS
value: {{ .Values.conf.haproxy.server_opts | quote }}
- name: KUBE_CA
value: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
- name: KUBE_TOKEN
value: /var/run/secrets/kubernetes.io/serviceaccount/token
- name: KUBE_URL
value: {{ .Values.conf.anchor.kubernetes_url | quote }}
command:
- /tmp/bin/anchor.sh
lifecycle:
preStop:
exec:
command:
- /tmp/bin/pre_stop.sh
volumeMounts:
- name: haproxy-bin
mountPath: /tmp/bin
- name: haproxy-etc
mountPath: /tmp/etc
- name: host
mountPath: /host
securityContext:
readOnlyRootFilesystem: true
volumes:
- name: haproxy-bin
configMap:
name: haproxy-bin
defaultMode: 0555
- name: haproxy-etc
configMap:
name: haproxy-etc
defaultMode: 0444
- name: host
hostPath:
path: /