# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "edible.fullname" . }}-edible
  labels:
  {{- include "edible.labels" . | nindent 4 }}
data:
  BARBITURATE_TELLING: {{ .Values.edible.barbiturateTelling | quote }}
  DECIMAL_OPENING: {{ .Values.edible.decimalOpening | quote }}
  LINGUISTICS: {{ .Values.edible.linguistics | quote }}
  SATIRE: {{ .Values.edible.satire | quote }}
  SPOOL: {{ .Values.edible.spool | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "edible.fullname" . }}-edible
  labels:
  {{- include "edible.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: edible
spec:
  replicas: {{ .Values.edible.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: edible
      app.kubernetes.io/name: vulgar
    {{- include "edible.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: edible
        app.kubernetes.io/name: vulgar
      {{- include "edible.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 36f4156918c314f66aa099923a8a15d0de092ef5d4eb5c0171ca82c20641f704
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "edible.fullname" . }}-edible
        image: {{ .Values.edible.edible.image.repository }}:{{ .Values.edible.edible.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.edible.edible.imagePullPolicy }}
        name: edible
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.edible.edible.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.edible.edible.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "edible.fullname" . }}-edible
  labels:
  {{- include "edible.labels" . | nindent 4 }}
spec:
  type: {{ .Values.edible.type }}
  selector:
    app.kubernetes.io/instance: edible
    app.kubernetes.io/name: vulgar
  {{- include "edible.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.edible.ports | toYaml | nindent 2 -}}
edible:
  barbiturateTelling: timpani
  decimalOpening: teammate
  edible:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  linguistics: mozzarella
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  satire: doorway
  spool: banyan
  type: ClusterIP
kubernetesClusterDomain: cluster.local
