# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "exchange.fullname" . }}-exchange
  labels:
  {{- include "exchange.labels" . | nindent 4 }}
data:
  ABRASIVE: {{ .Values.exchange.abrasive | quote }}
  DUMBWAITER_MITTEN: {{ .Values.exchange.dumbwaiterMitten | quote }}
  DURATION_EASEL_THAW: {{ .Values.exchange.durationEaselThaw | quote }}
  GRUB_HEAL: {{ .Values.exchange.grubHeal | quote }}
  HEADLINE_INVOICE: {{ .Values.exchange.headlineInvoice | quote }}
  KINASE: {{ .Values.exchange.kinase | quote }}
  MONOTHEISM_EARRINGS: {{ .Values.exchange.monotheismEarrings | quote }}
  OVERSHOOT_ROD: {{ .Values.exchange.overshootRod | quote }}
  RESTRUCTURE_SAC: {{ .Values.exchange.restructureSac | quote }}
  SCHOOLHOUSE_SAFARI_INEQUALITY: {{ .Values.exchange.schoolhouseSafariInequality
    | quote }}
  UNARMED_SONGBIRD_SUPERVISOR: {{ .Values.exchange.unarmedSongbirdSupervisor | quote
    }}
  WORKER_BIRD_CONTRACT: {{ .Values.exchange.workerBirdContract | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "exchange.fullname" . }}-exchange
  labels:
  {{- include "exchange.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: exchange
spec:
  replicas: {{ .Values.exchange.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: exchange
      app.kubernetes.io/name: sky
    {{- include "exchange.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: exchange
        app.kubernetes.io/name: sky
      {{- include "exchange.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 9aa30e0b504771c3e76fb91c113ca33a285b5d556ad70e28b4f4e7ef3ddaeeb8
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "exchange.fullname" . }}-exchange
        image: {{ .Values.exchange.exchange.image.repository }}:{{ .Values.exchange.exchange.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.exchange.exchange.imagePullPolicy }}
        name: exchange
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.exchange.exchange.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.exchange.exchange.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "exchange.fullname" . }}-exchange
  labels:
  {{- include "exchange.labels" . | nindent 4 }}
spec:
  type: {{ .Values.exchange.type }}
  selector:
    app.kubernetes.io/instance: exchange
    app.kubernetes.io/name: sky
  {{- include "exchange.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.exchange.ports | toYaml | nindent 2 -}}
exchange:
  abrasive: spoon
  dumbwaiterMitten: music
  durationEaselThaw: outcome
  exchange:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  grubHeal: disclosure
  headlineInvoice: compulsion
  kinase: volleyball
  monotheismEarrings: jaw
  overshootRod: secretary
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  restructureSac: thirst
  schoolhouseSafariInequality: tooth
  type: ClusterIP
  unarmedSongbirdSupervisor: twig
  workerBirdContract: crash
kubernetesClusterDomain: cluster.local
