# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "doorway.fullname" . }}-doorway
  labels:
  {{- include "doorway.labels" . | nindent 4 }}
data:
  BELFRY_CUSTODY_SQUASH: {{ .Values.doorway.belfryCustodySquash | quote }}
  BROWN_CHICORY_PROCUREMENT: {{ .Values.doorway.brownChicoryProcurement | quote }}
  DREAM_CICADA_CONGRESS: {{ .Values.doorway.dreamCicadaCongress | quote }}
  HAIL: {{ .Values.doorway.hail | quote }}
  HECTARE: {{ .Values.doorway.hectare | quote }}
  HOUSEBOAT: {{ .Values.doorway.houseboat | quote }}
  TURKEY_COUNSELLING: {{ .Values.doorway.turkeyCounselling | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "doorway.fullname" . }}-doorway
  labels:
  {{- include "doorway.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: doorway
spec:
  replicas: {{ .Values.doorway.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: doorway
      app.kubernetes.io/name: intellect
    {{- include "doorway.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: doorway
        app.kubernetes.io/name: intellect
      {{- include "doorway.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 649190692eb86c553bd122ec528fa18fc992886c35a6e946ffa835fa04530806
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "doorway.fullname" . }}-doorway
        image: {{ .Values.doorway.doorway.image.repository }}:{{ .Values.doorway.doorway.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.doorway.doorway.imagePullPolicy }}
        name: doorway
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.doorway.doorway.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.doorway.doorway.containerSecurityContext |
          nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "doorway.fullname" . }}-doorway
  labels:
  {{- include "doorway.labels" . | nindent 4 }}
spec:
  type: {{ .Values.doorway.type }}
  selector:
    app.kubernetes.io/instance: doorway
    app.kubernetes.io/name: intellect
  {{- include "doorway.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.doorway.ports | toYaml | nindent 2 -}}
doorway:
  belfryCustodySquash: sulfur
  brownChicoryProcurement: electricity
  doorway:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  dreamCicadaCongress: souvenir
  hail: ruckus
  hectare: severity
  houseboat: license
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  turkeyCounselling: mailbox
  type: ClusterIP
kubernetesClusterDomain: cluster.local
