# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "airmail.fullname" . }}-airmail
  labels:
  {{- include "airmail.labels" . | nindent 4 }}
data:
  ATTEND_DELIGHTFUL: {{ .Values.airmail.attendDelightful | quote }}
  COFFIN: {{ .Values.airmail.coffin | quote }}
  LIKENESS_GRANDIOSE_VIGOROUS: {{ .Values.airmail.likenessGrandioseVigorous | quote
    }}
  NERVOUS_PEPPERONI_CHICK: {{ .Values.airmail.nervousPepperoniChick | quote }}
  PLUG_EPOXY_JEWELRY: {{ .Values.airmail.plugEpoxyJewelry | quote }}
  POSTFIX: {{ .Values.airmail.postfix | quote }}
  RUM: {{ .Values.airmail.rum | quote }}
  STALL: {{ .Values.airmail.stall | quote }}
  TACIT_SPOOL: {{ .Values.airmail.tacitSpool | quote }}
  WEAPON: {{ .Values.airmail.weapon | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "airmail.fullname" . }}-airmail
  labels:
  {{- include "airmail.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: airmail
spec:
  replicas: {{ .Values.airmail.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: airmail
      app.kubernetes.io/name: chaplain
    {{- include "airmail.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: airmail
        app.kubernetes.io/name: chaplain
      {{- include "airmail.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 0239ea374537126ace0e18aa633611f41655d1f9da2153b390229a61be06c365
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "airmail.fullname" . }}-airmail
        image: {{ .Values.airmail.airmail.image.repository }}:{{ .Values.airmail.airmail.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.airmail.airmail.imagePullPolicy }}
        name: airmail
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.airmail.airmail.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.airmail.airmail.containerSecurityContext |
          nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "airmail.fullname" . }}-airmail
  labels:
  {{- include "airmail.labels" . | nindent 4 }}
spec:
  type: {{ .Values.airmail.type }}
  selector:
    app.kubernetes.io/instance: airmail
    app.kubernetes.io/name: chaplain
  {{- include "airmail.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.airmail.ports | toYaml | nindent 2 -}}
airmail:
  airmail:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  attendDelightful: processing
  coffin: label
  likenessGrandioseVigorous: fretful
  nervousPepperoniChick: stir
  plugEpoxyJewelry: celery
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  postfix: allegation
  replicas: 1
  rum: baritone
  stall: aback
  tacitSpool: teriyaki
  type: ClusterIP
  weapon: talk
kubernetesClusterDomain: cluster.local
