# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "checkout.fullname" . }}-checkout
  labels:
  {{- include "checkout.labels" . | nindent 4 }}
data:
  AGONIZING: {{ .Values.checkout.agonizing | quote }}
  CANDIDACY: {{ .Values.checkout.candidacy | quote }}
  COORDINATE_ZIP_DRAG: {{ .Values.checkout.coordinateZipDrag | quote }}
  DISPROVE_CO-PRODUCER_RESCUE: {{ .Values.checkout.disproveCoProducerRescue | quote
    }}
  FORAGER: {{ .Values.checkout.forager | quote }}
  HERMIT_DENSITY: {{ .Values.checkout.hermitDensity | quote }}
  MATERNITY: {{ .Values.checkout.maternity | quote }}
  RESOURCE: {{ .Values.checkout.resource | quote }}
  SECRETARY: {{ .Values.checkout.secretary | quote }}
  SHIPPER: {{ .Values.checkout.shipper | quote }}
  TIRED_WALRUS_INTERVAL: {{ .Values.checkout.tiredWalrusInterval | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "checkout.fullname" . }}-checkout
  labels:
  {{- include "checkout.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: checkout
spec:
  replicas: {{ .Values.checkout.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: checkout
      app.kubernetes.io/name: tabulate
    {{- include "checkout.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: checkout
        app.kubernetes.io/name: tabulate
      {{- include "checkout.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 3437b5c4a8cdf37513aaf6aa86f2674a638854c28611ecb7e7a647b5512c94f1
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "checkout.fullname" . }}-checkout
        image: {{ .Values.checkout.checkout.image.repository }}:{{ .Values.checkout.checkout.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.checkout.checkout.imagePullPolicy }}
        name: checkout
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.checkout.checkout.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.checkout.checkout.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "checkout.fullname" . }}-checkout
  labels:
  {{- include "checkout.labels" . | nindent 4 }}
spec:
  type: {{ .Values.checkout.type }}
  selector:
    app.kubernetes.io/instance: checkout
    app.kubernetes.io/name: tabulate
  {{- include "checkout.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.checkout.ports | toYaml | nindent 2 -}}
checkout:
  agonizing: snake
  candidacy: vascular
  checkout:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  coordinateZipDrag: trachoma
  disproveCoProducerRescue: busy
  forager: arcade
  hermitDensity: granola
  maternity: wrapping
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  resource: marble
  secretary: pecan
  shipper: quilt
  tiredWalrusInterval: vulture
  type: ClusterIP
kubernetesClusterDomain: cluster.local
