# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "ecclesia.fullname" . }}-ecclesia
  labels:
  {{- include "ecclesia.labels" . | nindent 4 }}
data:
  BATTING: {{ .Values.ecclesia.batting | quote }}
  CYGNET_EXHAUST: {{ .Values.ecclesia.cygnetExhaust | quote }}
  DISTORTION: {{ .Values.ecclesia.distortion | quote }}
  DOCUMENTATION_ORDINARY: {{ .Values.ecclesia.documentationOrdinary | quote }}
  FAT: {{ .Values.ecclesia.fat | quote }}
  KEYBOARDING_LION_CANDELABRA: {{ .Values.ecclesia.keyboardingLionCandelabra | quote
    }}
  OLDIE_MICRONUTRIENT: {{ .Values.ecclesia.oldieMicronutrient | quote }}
  PRESENCE: {{ .Values.ecclesia.presence | quote }}
  PROMOTION_SECRET_BALALAIKA: {{ .Values.ecclesia.promotionSecretBalalaika | quote
    }}
  SITAR_SKULLDUGGERY_PATROLLER: {{ .Values.ecclesia.sitarSkullduggeryPatroller |
    quote }}
  SPATULA_SOW_INJUSTICE: {{ .Values.ecclesia.spatulaSowInjustice | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "ecclesia.fullname" . }}-ecclesia
  labels:
  {{- include "ecclesia.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: ecclesia
spec:
  replicas: {{ .Values.ecclesia.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: ecclesia
      app.kubernetes.io/name: scale
    {{- include "ecclesia.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: ecclesia
        app.kubernetes.io/name: scale
      {{- include "ecclesia.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 72ad31b08ddd856142ae505c497e8ee99805c51809ec9f9b9704c4146101bd11
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "ecclesia.fullname" . }}-ecclesia
        image: {{ .Values.ecclesia.ecclesia.image.repository }}:{{ .Values.ecclesia.ecclesia.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.ecclesia.ecclesia.imagePullPolicy }}
        name: ecclesia
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.ecclesia.ecclesia.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.ecclesia.ecclesia.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "ecclesia.fullname" . }}-ecclesia
  labels:
  {{- include "ecclesia.labels" . | nindent 4 }}
spec:
  type: {{ .Values.ecclesia.type }}
  selector:
    app.kubernetes.io/instance: ecclesia
    app.kubernetes.io/name: scale
  {{- include "ecclesia.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.ecclesia.ports | toYaml | nindent 2 -}}
ecclesia:
  batting: till
  cygnetExhaust: tolerance
  distortion: crepe
  documentationOrdinary: outfit
  ecclesia:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  fat: mini
  keyboardingLionCandelabra: known
  oldieMicronutrient: lie
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  presence: savannah
  promotionSecretBalalaika: pagoda
  replicas: 1
  sitarSkullduggeryPatroller: forget
  spatulaSowInjustice: heirloom
  type: ClusterIP
kubernetesClusterDomain: cluster.local
