# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "dwell.fullname" . }}-dwell
  labels:
  {{- include "dwell.labels" . | nindent 4 }}
data:
  DETAINEE_PLAY: {{ .Values.dwell.detaineePlay | quote }}
  FRUIT: {{ .Values.dwell.fruit | quote }}
  GIFT_HAPPINESS_SUNROOM: {{ .Values.dwell.giftHappinessSunroom | quote }}
  GUTTER_ROMAINE_DIFFERENT: {{ .Values.dwell.gutterRomaineDifferent | quote }}
  METRIC_CRIBBAGE: {{ .Values.dwell.metricCribbage | quote }}
  PENITENT: {{ .Values.dwell.penitent | quote }}
  SUPPORT_AMAZEMENT_DISGUSTED: {{ .Values.dwell.supportAmazementDisgusted | quote
    }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "dwell.fullname" . }}-dwell
  labels:
  {{- include "dwell.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: dwell
spec:
  replicas: {{ .Values.dwell.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: dwell
      app.kubernetes.io/name: overcoat
    {{- include "dwell.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: dwell
        app.kubernetes.io/name: overcoat
      {{- include "dwell.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 44aa904946b67d9aa0e01fa200b96984abfb483916cb939c3b37368a2006e4c3
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "dwell.fullname" . }}-dwell
        image: {{ .Values.dwell.dwell.image.repository }}:{{ .Values.dwell.dwell.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.dwell.dwell.imagePullPolicy }}
        name: dwell
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.dwell.dwell.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.dwell.dwell.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "dwell.fullname" . }}-dwell
  labels:
  {{- include "dwell.labels" . | nindent 4 }}
spec:
  type: {{ .Values.dwell.type }}
  selector:
    app.kubernetes.io/instance: dwell
    app.kubernetes.io/name: overcoat
  {{- include "dwell.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.dwell.ports | toYaml | nindent 2 -}}
dwell:
  detaineePlay: hot
  dwell:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  fruit: airbag
  giftHappinessSunroom: project
  gutterRomaineDifferent: ruthless
  metricCribbage: determination
  penitent: paragraph
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  supportAmazementDisgusted: water
  type: ClusterIP
kubernetesClusterDomain: cluster.local
