# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "kindness.fullname" . }}-kindness
  labels:
  {{- include "kindness.labels" . | nindent 4 }}
data:
  BRISKET_COVERAGE_MINIMALISM: {{ .Values.kindness.brisketCoverageMinimalism | quote
    }}
  GRASSHOPPER_GRANDCHILD: {{ .Values.kindness.grasshopperGrandchild | quote }}
  IRRIGATION_FINGERNAIL_OPENING: {{ .Values.kindness.irrigationFingernailOpening
    | quote }}
  POLITICIAN_CREAM_HALLWAY: {{ .Values.kindness.politicianCreamHallway | quote }}
  SQUASH_MADAM: {{ .Values.kindness.squashMadam | quote }}
  THAW_LIGAND: {{ .Values.kindness.thawLigand | quote }}
  YAWL: {{ .Values.kindness.yawl | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "kindness.fullname" . }}-kindness
  labels:
  {{- include "kindness.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: kindness
spec:
  replicas: {{ .Values.kindness.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: kindness
      app.kubernetes.io/name: lettuce
    {{- include "kindness.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: kindness
        app.kubernetes.io/name: lettuce
      {{- include "kindness.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 2b25ae4c594d93f02d6e5e7bc5d24e03fa29709a4332e84ea77dbb1e32722eac
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "kindness.fullname" . }}-kindness
        image: {{ .Values.kindness.kindness.image.repository }}:{{ .Values.kindness.kindness.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.kindness.kindness.imagePullPolicy }}
        name: kindness
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.kindness.kindness.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.kindness.kindness.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "kindness.fullname" . }}-kindness
  labels:
  {{- include "kindness.labels" . | nindent 4 }}
spec:
  type: {{ .Values.kindness.type }}
  selector:
    app.kubernetes.io/instance: kindness
    app.kubernetes.io/name: lettuce
  {{- include "kindness.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.kindness.ports | toYaml | nindent 2 -}}
kindness:
  brisketCoverageMinimalism: wind-chime
  grasshopperGrandchild: consignment
  irrigationFingernailOpening: sucker
  kindness:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  politicianCreamHallway: zebra
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  squashMadam: jagged
  thawLigand: gloom
  type: ClusterIP
  yawl: fledgling
kubernetesClusterDomain: cluster.local
