# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "wad.fullname" . }}-wad
  labels:
  {{- include "wad.labels" . | nindent 4 }}
data:
  DYNAMITE_BONFIRE_OMEGA: {{ .Values.wad.dynamiteBonfireOmega | quote }}
  EMBOSSING_LYCHEE_PROTEIN: {{ .Values.wad.embossingLycheeProtein | quote }}
  ENVELOPE: {{ .Values.wad.envelope | quote }}
  EXTINCTION_ROCKET_WRIGGLE: {{ .Values.wad.extinctionRocketWriggle | quote }}
  FLAME: {{ .Values.wad.flame | quote }}
  GORILLA: {{ .Values.wad.gorilla | quote }}
  NOTHING_ANTIBODY: {{ .Values.wad.nothingAntibody | quote }}
  PEEL: {{ .Values.wad.peel | quote }}
  QUICKSAND_MACHO_VOID: {{ .Values.wad.quicksandMachoVoid | quote }}
  SOUTHEAST_MIME_WRAPPING: {{ .Values.wad.southeastMimeWrapping | quote }}
  TOOTHBRUSH_SUPPLEMENT: {{ .Values.wad.toothbrushSupplement | quote }}
  WITHSTAND_SENSE: {{ .Values.wad.withstandSense | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "wad.fullname" . }}-wad
  labels:
  {{- include "wad.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: wad
spec:
  replicas: {{ .Values.wad.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: wad
      app.kubernetes.io/name: efficient
    {{- include "wad.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: wad
        app.kubernetes.io/name: efficient
      {{- include "wad.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 23287da0a4bbd0cd663ef8a7355a2fb9c597ae8896a3e8d721ab34f5bd1b7b99
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "wad.fullname" . }}-wad
        image: {{ .Values.wad.wad.image.repository }}:{{ .Values.wad.wad.image.tag | default
          .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.wad.wad.imagePullPolicy }}
        name: wad
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.wad.wad.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.wad.wad.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "wad.fullname" . }}-wad
  labels:
  {{- include "wad.labels" . | nindent 4 }}
spec:
  type: {{ .Values.wad.type }}
  selector:
    app.kubernetes.io/instance: wad
    app.kubernetes.io/name: efficient
  {{- include "wad.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.wad.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
wad:
  dynamiteBonfireOmega: geranium
  embossingLycheeProtein: priesthood
  envelope: rainy
  extinctionRocketWriggle: acre
  flame: wake
  gorilla: rancher
  nothingAntibody: rare
  peel: border
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  quicksandMachoVoid: investigation
  replicas: 1
  southeastMimeWrapping: shampoo
  toothbrushSupplement: twins
  type: ClusterIP
  wad:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  withstandSense: bronco
