# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "wok.fullname" . }}-wok
  labels:
  {{- include "wok.labels" . | nindent 4 }}
data:
  COAT_CHRYSALIS: {{ .Values.wok.coatChrysalis | quote }}
  HANGER_HIP_BASEBOARD: {{ .Values.wok.hangerHipBaseboard | quote }}
  LUNCHEONETTE: {{ .Values.wok.luncheonette | quote }}
  SUCCESSFUL_CUSTARD_CONCENTRATION: {{ .Values.wok.successfulCustardConcentration
    | quote }}
  TABERNACLE: {{ .Values.wok.tabernacle | quote }}
  UNDERSTOOD_STENCIL: {{ .Values.wok.understoodStencil | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "wok.fullname" . }}-wok
  labels:
  {{- include "wok.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: wok
spec:
  replicas: {{ .Values.wok.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: wok
      app.kubernetes.io/name: breastplate
    {{- include "wok.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: wok
        app.kubernetes.io/name: breastplate
      {{- include "wok.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 9bd138029dcca26385a287b34d9381d9b041a3dccf300c4e8a5a1971540181d8
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "wok.fullname" . }}-wok
        image: {{ .Values.wok.wok.image.repository }}:{{ .Values.wok.wok.image.tag | default
          .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.wok.wok.imagePullPolicy }}
        name: wok
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.wok.wok.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.wok.wok.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "wok.fullname" . }}-wok
  labels:
  {{- include "wok.labels" . | nindent 4 }}
spec:
  type: {{ .Values.wok.type }}
  selector:
    app.kubernetes.io/instance: wok
    app.kubernetes.io/name: breastplate
  {{- include "wok.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.wok.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
wok:
  coatChrysalis: clarify
  hangerHipBaseboard: scarecrow
  luncheonette: furniture
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  successfulCustardConcentration: bladder
  tabernacle: hospitality
  type: ClusterIP
  understoodStencil: attic
  wok:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
