# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "cheddar.fullname" . }}-cheddar
  labels:
  {{- include "cheddar.labels" . | nindent 4 }}
data:
  DERBY_MONSOON: {{ .Values.cheddar.derbyMonsoon | quote }}
  EDITED_SHRIMP_ARMPIT: {{ .Values.cheddar.editedShrimpArmpit | quote }}
  HYENA: {{ .Values.cheddar.hyena | quote }}
  KNOW-HOW_GATEWAY_THIGH: {{ .Values.cheddar.knowHowGatewayThigh | quote }}
  MOB: {{ .Values.cheddar.mob | quote }}
  PIKE_GARRULOUS: {{ .Values.cheddar.pikeGarrulous | quote }}
  REGIONALISM: {{ .Values.cheddar.regionalism | quote }}
  SPANDEX_SYMBOLIZE: {{ .Values.cheddar.spandexSymbolize | quote }}
  UNBIASED: {{ .Values.cheddar.unbiased | quote }}
  YAWL_FAIRNESS: {{ .Values.cheddar.yawlFairness | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "cheddar.fullname" . }}-cheddar
  labels:
  {{- include "cheddar.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: cheddar
spec:
  replicas: {{ .Values.cheddar.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: cheddar
      app.kubernetes.io/name: embryo
    {{- include "cheddar.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: cheddar
        app.kubernetes.io/name: embryo
      {{- include "cheddar.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 423d59336458e48c9e7503c128150f52f249953c54c2cb046fc8bb87e0c0882c
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "cheddar.fullname" . }}-cheddar
        image: {{ .Values.cheddar.cheddar.image.repository }}:{{ .Values.cheddar.cheddar.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.cheddar.cheddar.imagePullPolicy }}
        name: cheddar
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.cheddar.cheddar.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.cheddar.cheddar.containerSecurityContext |
          nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "cheddar.fullname" . }}-cheddar
  labels:
  {{- include "cheddar.labels" . | nindent 4 }}
spec:
  type: {{ .Values.cheddar.type }}
  selector:
    app.kubernetes.io/instance: cheddar
    app.kubernetes.io/name: embryo
  {{- include "cheddar.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.cheddar.ports | toYaml | nindent 2 -}}
cheddar:
  cheddar:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  derbyMonsoon: pard
  editedShrimpArmpit: learned
  hyena: flick
  knowHowGatewayThigh: boundless
  mob: abortion
  pikeGarrulous: vacation
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  regionalism: madam
  replicas: 1
  spandexSymbolize: jagged
  type: ClusterIP
  unbiased: pond
  yawlFairness: dairy
kubernetesClusterDomain: cluster.local
