# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "parched.fullname" . }}-parched
  labels:
  {{- include "parched.labels" . | nindent 4 }}
data:
  FRACTION: {{ .Values.parched.fraction | quote }}
  HOPE: {{ .Values.parched.hope | quote }}
  SCENARIO_PANTRY: {{ .Values.parched.scenarioPantry | quote }}
  SIGNAL_CONFUSE: {{ .Values.parched.signalConfuse | quote }}
  SKELETON_RIBBON_REFUND: {{ .Values.parched.skeletonRibbonRefund | quote }}
  YELLOW_BACON_ZONKED: {{ .Values.parched.yellowBaconZonked | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "parched.fullname" . }}-parched
  labels:
  {{- include "parched.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: parched
spec:
  replicas: {{ .Values.parched.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: parched
      app.kubernetes.io/name: willing
    {{- include "parched.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: parched
        app.kubernetes.io/name: willing
      {{- include "parched.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 9c56142f44d0a23bc31bfdd512f1387123993e3801f36f2968631d185481061a
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "parched.fullname" . }}-parched
        image: {{ .Values.parched.parched.image.repository }}:{{ .Values.parched.parched.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.parched.parched.imagePullPolicy }}
        name: parched
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.parched.parched.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.parched.parched.containerSecurityContext |
          nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "parched.fullname" . }}-parched
  labels:
  {{- include "parched.labels" . | nindent 4 }}
spec:
  type: {{ .Values.parched.type }}
  selector:
    app.kubernetes.io/instance: parched
    app.kubernetes.io/name: willing
  {{- include "parched.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.parched.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
parched:
  fraction: surgeon
  hope: intestine
  parched:
    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
  scenarioPantry: glasses
  signalConfuse: cave
  skeletonRibbonRefund: digging
  type: ClusterIP
  yellowBaconZonked: torso
