# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "formamide.fullname" . }}-formamide
  labels:
  {{- include "formamide.labels" . | nindent 4 }}
data:
  CRUNCH: {{ .Values.formamide.crunch | quote }}
  DIFFUSE: {{ .Values.formamide.diffuse | quote }}
  DUNGAREES_AIRCRAFT: {{ .Values.formamide.dungareesAircraft | quote }}
  EYEBROWS: {{ .Values.formamide.eyebrows | quote }}
  GIG_SEW_FONT: {{ .Values.formamide.gigSewFont | quote }}
  HOSIERY_SPARKLING: {{ .Values.formamide.hosierySparkling | quote }}
  LENTIL_SUCCINCT_CLASS: {{ .Values.formamide.lentilSuccinctClass | quote }}
  MILLET_GRASP: {{ .Values.formamide.milletGrasp | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "formamide.fullname" . }}-formamide
  labels:
  {{- include "formamide.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: formamide
spec:
  replicas: {{ .Values.formamide.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: formamide
      app.kubernetes.io/name: density
    {{- include "formamide.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: formamide
        app.kubernetes.io/name: density
      {{- include "formamide.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: bfac872a852ee408cb071dbdca2a6b1b02719a55da834b5e2c563c5bb06aa16f
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "formamide.fullname" . }}-formamide
        image: {{ .Values.formamide.formamide.image.repository }}:{{ .Values.formamide.formamide.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.formamide.formamide.imagePullPolicy }}
        name: formamide
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.formamide.formamide.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.formamide.formamide.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "formamide.fullname" . }}-formamide
  labels:
  {{- include "formamide.labels" . | nindent 4 }}
spec:
  type: {{ .Values.formamide.type }}
  selector:
    app.kubernetes.io/instance: formamide
    app.kubernetes.io/name: density
  {{- include "formamide.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.formamide.ports | toYaml | nindent 2 -}}
formamide:
  crunch: spork
  diffuse: shakedown
  dungareesAircraft: passport
  eyebrows: swanling
  formamide:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  gigSewFont: boast
  hosierySparkling: monopoly
  lentilSuccinctClass: misunderstand
  milletGrasp: minority
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  type: ClusterIP
kubernetesClusterDomain: cluster.local
