# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "medal.fullname" . }}-medal
  labels:
  {{- include "medal.labels" . | nindent 4 }}
data:
  ALLOW_WITHDRAW: {{ .Values.medal.allowWithdraw | quote }}
  ANGSTROM_ARROGANT: {{ .Values.medal.angstromArrogant | quote }}
  ANYWHERE: {{ .Values.medal.anywhere | quote }}
  CLIPPER: {{ .Values.medal.clipper | quote }}
  CRYSTAL_PENDULUM: {{ .Values.medal.crystalPendulum | quote }}
  DOMINEERING_BLISTER: {{ .Values.medal.domineeringBlister | quote }}
  EDUCATED: {{ .Values.medal.educated | quote }}
  HATCHET_AUCTION: {{ .Values.medal.hatchetAuction | quote }}
  MANGLE: {{ .Values.medal.mangle | quote }}
  POSSIBLE: {{ .Values.medal.possible | quote }}
  SKYLINE: {{ .Values.medal.skyline | quote }}
  SLING_EXISTENCE_CONTINGENCY: {{ .Values.medal.slingExistenceContingency | quote
    }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "medal.fullname" . }}-medal
  labels:
  {{- include "medal.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: medal
spec:
  replicas: {{ .Values.medal.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: medal
      app.kubernetes.io/name: decongestant
    {{- include "medal.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: medal
        app.kubernetes.io/name: decongestant
      {{- include "medal.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: e9526e7e23ecd1d93a6103c8b7de05e06e26d3b6e4127224a5f8d024a582d31f
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "medal.fullname" . }}-medal
        image: {{ .Values.medal.medal.image.repository }}:{{ .Values.medal.medal.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.medal.medal.imagePullPolicy }}
        name: medal
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.medal.medal.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.medal.medal.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "medal.fullname" . }}-medal
  labels:
  {{- include "medal.labels" . | nindent 4 }}
spec:
  type: {{ .Values.medal.type }}
  selector:
    app.kubernetes.io/instance: medal
    app.kubernetes.io/name: decongestant
  {{- include "medal.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.medal.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
medal:
  allowWithdraw: pour
  angstromArrogant: woman
  anywhere: platypus
  clipper: garment
  crystalPendulum: fax
  domineeringBlister: butane
  educated: form
  hatchetAuction: deliver
  mangle: staff
  medal:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  possible: unsightly
  replicas: 1
  skyline: departure
  slingExistenceContingency: tremor
  type: ClusterIP
