# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "parser.fullname" . }}-parser
  labels:
  {{- include "parser.labels" . | nindent 4 }}
data:
  COMMUNICATE_MUDDLE_BROOK: {{ .Values.parser.communicateMuddleBrook | quote }}
  DETERMINED: {{ .Values.parser.determined | quote }}
  HAND_SCREENWRITING: {{ .Values.parser.handScreenwriting | quote }}
  HYSTERICAL_VERDANT: {{ .Values.parser.hystericalVerdant | quote }}
  OTTER: {{ .Values.parser.otter | quote }}
  SEW: {{ .Values.parser.sew | quote }}
  SURNAME: {{ .Values.parser.surname | quote }}
  THEATER_VEGETARIAN_RECOVERY: {{ .Values.parser.theaterVegetarianRecovery | quote
    }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "parser.fullname" . }}-parser
  labels:
  {{- include "parser.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: parser
spec:
  replicas: {{ .Values.parser.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: parser
      app.kubernetes.io/name: agriculture
    {{- include "parser.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: parser
        app.kubernetes.io/name: agriculture
      {{- include "parser.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 0abbfdf2dae1a0be276e118f50ce45e20af24a6e32dbe9f2f4e07dc81e942fe9
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "parser.fullname" . }}-parser
        image: {{ .Values.parser.parser.image.repository }}:{{ .Values.parser.parser.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.parser.parser.imagePullPolicy }}
        name: parser
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.parser.parser.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.parser.parser.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "parser.fullname" . }}-parser
  labels:
  {{- include "parser.labels" . | nindent 4 }}
spec:
  type: {{ .Values.parser.type }}
  selector:
    app.kubernetes.io/instance: parser
    app.kubernetes.io/name: agriculture
  {{- include "parser.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.parser.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
parser:
  communicateMuddleBrook: hacienda
  determined: reasoning
  handScreenwriting: dandelion
  hystericalVerdant: neck
  otter: fetus
  parser:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  sew: bunkhouse
  surname: figurine
  theaterVegetarianRecovery: furtive
  type: ClusterIP
