# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "interview.fullname" . }}-interview
  labels:
  {{- include "interview.labels" . | nindent 4 }}
data:
  ENZYME_HUNGRY: {{ .Values.interview.enzymeHungry | quote }}
  LETTUCE_MATH_ALTAR: {{ .Values.interview.lettuceMathAltar | quote }}
  MASTERPIECE_POSSESS_RETAILER: {{ .Values.interview.masterpiecePossessRetailer |
    quote }}
  PERFORM_CHASSIS: {{ .Values.interview.performChassis | quote }}
  RAMBUNCTIOUS_CELERY: {{ .Values.interview.rambunctiousCelery | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "interview.fullname" . }}-interview
  labels:
  {{- include "interview.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: interview
spec:
  replicas: {{ .Values.interview.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: interview
      app.kubernetes.io/name: decision
    {{- include "interview.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: interview
        app.kubernetes.io/name: decision
      {{- include "interview.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 5a09c4d485568047167df8508d9b39e93655b9cd87a98f7a1ac0d6d1086c6573
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "interview.fullname" . }}-interview
        image: {{ .Values.interview.interview.image.repository }}:{{ .Values.interview.interview.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.interview.interview.imagePullPolicy }}
        name: interview
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.interview.interview.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.interview.interview.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "interview.fullname" . }}-interview
  labels:
  {{- include "interview.labels" . | nindent 4 }}
spec:
  type: {{ .Values.interview.type }}
  selector:
    app.kubernetes.io/instance: interview
    app.kubernetes.io/name: decision
  {{- include "interview.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.interview.ports | toYaml | nindent 2 -}}
interview:
  enzymeHungry: drinking
  interview:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  lettuceMathAltar: hair
  masterpiecePossessRetailer: stallion
  performChassis: runway
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  rambunctiousCelery: salty
  replicas: 1
  type: ClusterIP
kubernetesClusterDomain: cluster.local
