# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "fact.fullname" . }}-fact
  labels:
  {{- include "fact.labels" . | nindent 4 }}
data:
  ALTERATION: {{ .Values.fact.alteration | quote }}
  DISCOVERY: {{ .Values.fact.discovery | quote }}
  DRIVE_PICKAX: {{ .Values.fact.drivePickax | quote }}
  ENZYME_DIABETES: {{ .Values.fact.enzymeDiabetes | quote }}
  PATRIARCH_GRAB: {{ .Values.fact.patriarchGrab | quote }}
  PENSION_TIDE_COLLATERAL: {{ .Values.fact.pensionTideCollateral | quote }}
  QUESTION: {{ .Values.fact.question | quote }}
  ROUTE_PULLEY_HUBCAP: {{ .Values.fact.routePulleyHubcap | quote }}
  SAVE: {{ .Values.fact.save | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "fact.fullname" . }}-fact
  labels:
  {{- include "fact.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: fact
spec:
  replicas: {{ .Values.fact.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: fact
      app.kubernetes.io/name: codling
    {{- include "fact.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: fact
        app.kubernetes.io/name: codling
      {{- include "fact.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 1266f739ab596e018f764885c24af3cf954f5189e551fef26a98960237f3dc6c
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "fact.fullname" . }}-fact
        image: {{ .Values.fact.fact.image.repository }}:{{ .Values.fact.fact.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.fact.fact.imagePullPolicy }}
        name: fact
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.fact.fact.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.fact.fact.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "fact.fullname" . }}-fact
  labels:
  {{- include "fact.labels" . | nindent 4 }}
spec:
  type: {{ .Values.fact.type }}
  selector:
    app.kubernetes.io/instance: fact
    app.kubernetes.io/name: codling
  {{- include "fact.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.fact.ports | toYaml | nindent 2 -}}
fact:
  alteration: prelude
  discovery: step-grandmother
  drivePickax: tambourine
  enzymeDiabetes: pleat
  fact:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  patriarchGrab: hunter
  pensionTideCollateral: eyeliner
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  question: glove
  replicas: 1
  routePulleyHubcap: outhouse
  save: hubcap
  type: ClusterIP
kubernetesClusterDomain: cluster.local
