# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "mixture.fullname" . }}-mixture
  labels:
  {{- include "mixture.labels" . | nindent 4 }}
data:
  DEMON: {{ .Values.mixture.demon | quote }}
  EMPIRE_ATTIC: {{ .Values.mixture.empireAttic | quote }}
  MERCURY: {{ .Values.mixture.mercury | quote }}
  NOSY_EUPHONIUM_ABORTION: {{ .Values.mixture.nosyEuphoniumAbortion | quote }}
  PROGRAMMING: {{ .Values.mixture.programming | quote }}
  SAXOPHONE_ZOOLOGIST_TOMATO: {{ .Values.mixture.saxophoneZoologistTomato | quote
    }}
  TEAM: {{ .Values.mixture.team | quote }}
  WAMPUM: {{ .Values.mixture.wampum | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "mixture.fullname" . }}-mixture
  labels:
  {{- include "mixture.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: mixture
spec:
  replicas: {{ .Values.mixture.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: mixture
      app.kubernetes.io/name: SUV
    {{- include "mixture.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: mixture
        app.kubernetes.io/name: SUV
      {{- include "mixture.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 32e76305e403dfd9608a0858ddfa384a89ed8b88d7c934163e9d0bb694979328
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "mixture.fullname" . }}-mixture
        image: {{ .Values.mixture.mixture.image.repository }}:{{ .Values.mixture.mixture.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.mixture.mixture.imagePullPolicy }}
        name: mixture
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.mixture.mixture.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.mixture.mixture.containerSecurityContext |
          nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "mixture.fullname" . }}-mixture
  labels:
  {{- include "mixture.labels" . | nindent 4 }}
spec:
  type: {{ .Values.mixture.type }}
  selector:
    app.kubernetes.io/instance: mixture
    app.kubernetes.io/name: SUV
  {{- include "mixture.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.mixture.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
mixture:
  demon: anguish
  empireAttic: antechamber
  mercury: fang
  mixture:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  nosyEuphoniumAbortion: dividend
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  programming: journalism
  replicas: 1
  saxophoneZoologistTomato: orator
  team: investor
  type: ClusterIP
  wampum: clergyman
