# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "dashing.fullname" . }}-dashing
  labels:
  {{- include "dashing.labels" . | nindent 4 }}
data:
  CHOOSE_HUNTING_STRAWMAN: {{ .Values.dashing.chooseHuntingStrawman | quote }}
  DEBATE_ROOMMATE_WETSUIT: {{ .Values.dashing.debateRoommateWetsuit | quote }}
  FLUKE: {{ .Values.dashing.fluke | quote }}
  INFUSION_CLIFF: {{ .Values.dashing.infusionCliff | quote }}
  LOSE_ROLL_HEARSAY: {{ .Values.dashing.loseRollHearsay | quote }}
  PATROLLER: {{ .Values.dashing.patroller | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "dashing.fullname" . }}-dashing
  labels:
  {{- include "dashing.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: dashing
spec:
  replicas: {{ .Values.dashing.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: dashing
      app.kubernetes.io/name: fairy
    {{- include "dashing.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: dashing
        app.kubernetes.io/name: fairy
      {{- include "dashing.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 3deffc3d1dd613082d42fd9b7ef761b9e5d19fc77e85511db6b078859d308eaf
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "dashing.fullname" . }}-dashing
        image: {{ .Values.dashing.dashing.image.repository }}:{{ .Values.dashing.dashing.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.dashing.dashing.imagePullPolicy }}
        name: dashing
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.dashing.dashing.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.dashing.dashing.containerSecurityContext |
          nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "dashing.fullname" . }}-dashing
  labels:
  {{- include "dashing.labels" . | nindent 4 }}
spec:
  type: {{ .Values.dashing.type }}
  selector:
    app.kubernetes.io/instance: dashing
    app.kubernetes.io/name: fairy
  {{- include "dashing.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.dashing.ports | toYaml | nindent 2 -}}
dashing:
  chooseHuntingStrawman: stimulation
  dashing:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  debateRoommateWetsuit: decision-making
  fluke: succeed
  infusionCliff: lollipop
  loseRollHearsay: dickey
  patroller: elevator
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  type: ClusterIP
kubernetesClusterDomain: cluster.local
