# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "microwave.fullname" . }}-microwave
  labels:
  {{- include "microwave.labels" . | nindent 4 }}
data:
  CHRONICLE_BACKPACK: {{ .Values.microwave.chronicleBackpack | quote }}
  EMBARRASSED_PROJECT: {{ .Values.microwave.embarrassedProject | quote }}
  FORTNIGHT: {{ .Values.microwave.fortnight | quote }}
  LLAMA_ALPENHORN_BROOD: {{ .Values.microwave.llamaAlpenhornBrood | quote }}
  PLANTER_EXPLODE: {{ .Values.microwave.planterExplode | quote }}
  RHETORIC_AUDIT: {{ .Values.microwave.rhetoricAudit | quote }}
  RUBBER_MONK_BEANSTALK: {{ .Values.microwave.rubberMonkBeanstalk | quote }}
  RUSH_SHANTY: {{ .Values.microwave.rushShanty | quote }}
  SLOW_COMICS: {{ .Values.microwave.slowComics | quote }}
  SQUID_DUPLEXER: {{ .Values.microwave.squidDuplexer | quote }}
  WASABI: {{ .Values.microwave.wasabi | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "microwave.fullname" . }}-microwave
  labels:
  {{- include "microwave.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: microwave
spec:
  replicas: {{ .Values.microwave.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: microwave
      app.kubernetes.io/name: antigen
    {{- include "microwave.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: microwave
        app.kubernetes.io/name: antigen
      {{- include "microwave.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 26c3eed7e7de35469bd4e751c039847b6571c894db72dcae51379c302e9beebf
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "microwave.fullname" . }}-microwave
        image: {{ .Values.microwave.microwave.image.repository }}:{{ .Values.microwave.microwave.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.microwave.microwave.imagePullPolicy }}
        name: microwave
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.microwave.microwave.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.microwave.microwave.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "microwave.fullname" . }}-microwave
  labels:
  {{- include "microwave.labels" . | nindent 4 }}
spec:
  type: {{ .Values.microwave.type }}
  selector:
    app.kubernetes.io/instance: microwave
    app.kubernetes.io/name: antigen
  {{- include "microwave.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.microwave.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
microwave:
  chronicleBackpack: developmental
  embarrassedProject: billowy
  fortnight: angora
  llamaAlpenhornBrood: maid
  microwave:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  planterExplode: bee
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  rhetoricAudit: yahoo
  rubberMonkBeanstalk: antiquity
  rushShanty: emergent
  slowComics: athlete
  squidDuplexer: flexibility
  type: ClusterIP
  wasabi: sell
