# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "breathe.fullname" . }}-breathe
  labels:
  {{- include "breathe.labels" . | nindent 4 }}
data:
  FORCE_GROVE: {{ .Values.breathe.forceGrove | quote }}
  HURDLER_JALAPEÑO: {{ .Values.breathe.hurdlerJalapeo | quote }}
  PUSH_ZUCCHINI: {{ .Values.breathe.pushZucchini | quote }}
  REVELATION_CLOGS: {{ .Values.breathe.revelationClogs | quote }}
  TERRIFY: {{ .Values.breathe.terrify | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "breathe.fullname" . }}-breathe
  labels:
  {{- include "breathe.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: breathe
spec:
  replicas: {{ .Values.breathe.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: breathe
      app.kubernetes.io/name: contrail
    {{- include "breathe.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: breathe
        app.kubernetes.io/name: contrail
      {{- include "breathe.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 8e4480ddb4d2d5869afe9638ab4ff0a2b9c67001a8ff730796be47cee20c8b43
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "breathe.fullname" . }}-breathe
        image: {{ .Values.breathe.breathe.image.repository }}:{{ .Values.breathe.breathe.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.breathe.breathe.imagePullPolicy }}
        name: breathe
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.breathe.breathe.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.breathe.breathe.containerSecurityContext |
          nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "breathe.fullname" . }}-breathe
  labels:
  {{- include "breathe.labels" . | nindent 4 }}
spec:
  type: {{ .Values.breathe.type }}
  selector:
    app.kubernetes.io/instance: breathe
    app.kubernetes.io/name: contrail
  {{- include "breathe.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.breathe.ports | toYaml | nindent 2 -}}
breathe:
  breathe:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  forceGrove: beastie
  hurdlerJalapeo: sundial
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  pushZucchini: fruit
  replicas: 1
  revelationClogs: clumsy
  terrify: charset
  type: ClusterIP
kubernetesClusterDomain: cluster.local
