# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "heat.fullname" . }}-heat
  labels:
  {{- include "heat.labels" . | nindent 4 }}
data:
  AFOUL_MALLARD_HOVERCRAFT: {{ .Values.heat.afoulMallardHovercraft | quote }}
  MIND: {{ .Values.heat.mind | quote }}
  TRUST_ESCALATOR: {{ .Values.heat.trustEscalator | quote }}
  WORKHORSE_NOODLES: {{ .Values.heat.workhorseNoodles | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "heat.fullname" . }}-heat
  labels:
  {{- include "heat.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: heat
spec:
  replicas: {{ .Values.heat.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: heat
      app.kubernetes.io/name: ornament
    {{- include "heat.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: heat
        app.kubernetes.io/name: ornament
      {{- include "heat.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 3136aa899cfc4a9f835b11b5cfc4e33bc9eec2c59fda2b3369c8be5854cfe80f
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "heat.fullname" . }}-heat
        image: {{ .Values.heat.heat.image.repository }}:{{ .Values.heat.heat.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.heat.heat.imagePullPolicy }}
        name: heat
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.heat.heat.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.heat.heat.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "heat.fullname" . }}-heat
  labels:
  {{- include "heat.labels" . | nindent 4 }}
spec:
  type: {{ .Values.heat.type }}
  selector:
    app.kubernetes.io/instance: heat
    app.kubernetes.io/name: ornament
  {{- include "heat.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.heat.ports | toYaml | nindent 2 -}}
heat:
  afoulMallardHovercraft: morbidity
  heat:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  mind: kid
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  trustEscalator: reporting
  type: ClusterIP
  workhorseNoodles: eleventh
kubernetesClusterDomain: cluster.local
