# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "inflation.fullname" . }}-inflation
  labels:
  {{- include "inflation.labels" . | nindent 4 }}
data:
  ESSENCE_SOOTHSAY: {{ .Values.inflation.essenceSoothsay | quote }}
  SEEDER_SNORER_COMMITMENT: {{ .Values.inflation.seederSnorerCommitment | quote }}
  WHACK_BOOKEND: {{ .Values.inflation.whackBookend | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "inflation.fullname" . }}-inflation
  labels:
  {{- include "inflation.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: inflation
spec:
  replicas: {{ .Values.inflation.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: inflation
      app.kubernetes.io/name: painstaking
    {{- include "inflation.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: inflation
        app.kubernetes.io/name: painstaking
      {{- include "inflation.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: e8bf10c8c5d70ff2022665893079611fa0974f391a16d9d64c11ece191b143d2
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "inflation.fullname" . }}-inflation
        image: {{ .Values.inflation.inflation.image.repository }}:{{ .Values.inflation.inflation.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.inflation.inflation.imagePullPolicy }}
        name: inflation
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.inflation.inflation.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.inflation.inflation.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "inflation.fullname" . }}-inflation
  labels:
  {{- include "inflation.labels" . | nindent 4 }}
spec:
  type: {{ .Values.inflation.type }}
  selector:
    app.kubernetes.io/instance: inflation
    app.kubernetes.io/name: painstaking
  {{- include "inflation.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.inflation.ports | toYaml | nindent 2 -}}
inflation:
  essenceSoothsay: patient
  inflation:
    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
  seederSnorerCommitment: condor
  type: ClusterIP
  whackBookend: kill
kubernetesClusterDomain: cluster.local
