# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "chaplain.fullname" . }}-chaplain
  labels:
  {{- include "chaplain.labels" . | nindent 4 }}
data:
  APPEAL_GRANOLA: {{ .Values.chaplain.appealGranola | quote }}
  BOUNDARY_SOUVENIR: {{ .Values.chaplain.boundarySouvenir | quote }}
  CHEESECAKE_FAMILIAR_PIPELINE: {{ .Values.chaplain.cheesecakeFamiliarPipeline |
    quote }}
  DASH_PAVILION: {{ .Values.chaplain.dashPavilion | quote }}
  EICOSANOID: {{ .Values.chaplain.eicosanoid | quote }}
  EMBARRASSMENT_CALL: {{ .Values.chaplain.embarrassmentCall | quote }}
  EPOXY_LANAI_OPPONENT: {{ .Values.chaplain.epoxyLanaiOpponent | quote }}
  HURRIED: {{ .Values.chaplain.hurried | quote }}
  ILLEGAL_USAGE: {{ .Values.chaplain.illegalUsage | quote }}
  LINE: {{ .Values.chaplain.line | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "chaplain.fullname" . }}-chaplain
  labels:
  {{- include "chaplain.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: chaplain
spec:
  replicas: {{ .Values.chaplain.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: chaplain
      app.kubernetes.io/name: foam
    {{- include "chaplain.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: chaplain
        app.kubernetes.io/name: foam
      {{- include "chaplain.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 82a850e76f381f560901b6d5f5f967e55217c98a201ac58b4d51d4a683e626ad
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "chaplain.fullname" . }}-chaplain
        image: {{ .Values.chaplain.chaplain.image.repository }}:{{ .Values.chaplain.chaplain.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.chaplain.chaplain.imagePullPolicy }}
        name: chaplain
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.chaplain.chaplain.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.chaplain.chaplain.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "chaplain.fullname" . }}-chaplain
  labels:
  {{- include "chaplain.labels" . | nindent 4 }}
spec:
  type: {{ .Values.chaplain.type }}
  selector:
    app.kubernetes.io/instance: chaplain
    app.kubernetes.io/name: foam
  {{- include "chaplain.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.chaplain.ports | toYaml | nindent 2 -}}
chaplain:
  appealGranola: issue
  boundarySouvenir: ex-wife
  chaplain:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  cheesecakeFamiliarPipeline: nit
  dashPavilion: mRNA
  eicosanoid: adorable
  embarrassmentCall: flavor
  epoxyLanaiOpponent: fail
  hurried: blight
  illegalUsage: look
  line: tandem
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  type: ClusterIP
kubernetesClusterDomain: cluster.local
