# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "allowance.fullname" . }}-allowance
  labels:
  {{- include "allowance.labels" . | nindent 4 }}
data:
  JAW_ALIVE: {{ .Values.allowance.jawAlive | quote }}
  SUBSIDENCE: {{ .Values.allowance.subsidence | quote }}
  TRANSPARENCY_PUP_DEMONIC: {{ .Values.allowance.transparencyPupDemonic | quote }}
  UNINTERESTED_INHABITANT: {{ .Values.allowance.uninterestedInhabitant | quote }}
  ZOOT-SUIT_CHAIRLIFT_IN-JOKE: {{ .Values.allowance.zootSuitChairliftInJoke | quote
    }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "allowance.fullname" . }}-allowance
  labels:
  {{- include "allowance.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: allowance
spec:
  replicas: {{ .Values.allowance.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: allowance
      app.kubernetes.io/name: orchestra
    {{- include "allowance.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: allowance
        app.kubernetes.io/name: orchestra
      {{- include "allowance.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: fcafdf665da9ab4705902e3789886bc68cbff919e73f8d6f5b56a1c20bfc8668
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "allowance.fullname" . }}-allowance
        image: {{ .Values.allowance.allowance.image.repository }}:{{ .Values.allowance.allowance.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.allowance.allowance.imagePullPolicy }}
        name: allowance
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.allowance.allowance.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.allowance.allowance.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "allowance.fullname" . }}-allowance
  labels:
  {{- include "allowance.labels" . | nindent 4 }}
spec:
  type: {{ .Values.allowance.type }}
  selector:
    app.kubernetes.io/instance: allowance
    app.kubernetes.io/name: orchestra
  {{- include "allowance.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.allowance.ports | toYaml | nindent 2 -}}
allowance:
  allowance:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  jawAlive: legacy
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  subsidence: verb
  transparencyPupDemonic: snowman
  type: ClusterIP
  uninterestedInhabitant: thinkable
  zootSuitChairliftInJoke: representative
kubernetesClusterDomain: cluster.local
