# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "worker.fullname" . }}-worker
  labels:
  {{- include "worker.labels" . | nindent 4 }}
data:
  DIAGNOSIS_LOOSE: {{ .Values.worker.diagnosisLoose | quote }}
  FAST_CASSOCK: {{ .Values.worker.fastCassock | quote }}
  INTENSITY_CIVILISATION_APPROVAL: {{ .Values.worker.intensityCivilisationApproval
    | quote }}
  PARTY: {{ .Values.worker.party | quote }}
  PLATE_EXPRESS_BUFFALO: {{ .Values.worker.plateExpressBuffalo | quote }}
  RACING: {{ .Values.worker.racing | quote }}
  REVENGE_SOURWOOD: {{ .Values.worker.revengeSourwood | quote }}
  SHOW_CAPITULATION_TOBACCO: {{ .Values.worker.showCapitulationTobacco | quote }}
  SKULL_TOUR: {{ .Values.worker.skullTour | quote }}
  WITHSTAND_BARRAGE: {{ .Values.worker.withstandBarrage | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "worker.fullname" . }}-worker
  labels:
  {{- include "worker.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: worker
spec:
  replicas: {{ .Values.worker.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: worker
      app.kubernetes.io/name: wriggler
    {{- include "worker.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: worker
        app.kubernetes.io/name: wriggler
      {{- include "worker.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 5200238099344c77f78857d15e9e2ef81d865ea45e084ebe9507fa2399a58795
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "worker.fullname" . }}-worker
        image: {{ .Values.worker.worker.image.repository }}:{{ .Values.worker.worker.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.worker.worker.imagePullPolicy }}
        name: worker
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.worker.worker.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.worker.worker.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "worker.fullname" . }}-worker
  labels:
  {{- include "worker.labels" . | nindent 4 }}
spec:
  type: {{ .Values.worker.type }}
  selector:
    app.kubernetes.io/instance: worker
    app.kubernetes.io/name: wriggler
  {{- include "worker.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.worker.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
worker:
  diagnosisLoose: pleasant
  fastCassock: counsellor
  intensityCivilisationApproval: bolt
  party: refusal
  plateExpressBuffalo: mule
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  racing: nestmate
  replicas: 1
  revengeSourwood: threat
  showCapitulationTobacco: perp
  skullTour: doubter
  type: ClusterIP
  withstandBarrage: encourage
  worker:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
