# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "cloister.fullname" . }}-cloister
  labels:
  {{- include "cloister.labels" . | nindent 4 }}
data:
  CHOLESTEROL: {{ .Values.cloister.cholesterol | quote }}
  FIERCE: {{ .Values.cloister.fierce | quote }}
  GUILTLESS_POSSIBLE: {{ .Values.cloister.guiltlessPossible | quote }}
  INTENSIFY: {{ .Values.cloister.intensify | quote }}
  KEYBOARD_ASTONISHING_WARRANT: {{ .Values.cloister.keyboardAstonishingWarrant |
    quote }}
  MINISTER_ASTRONOMY: {{ .Values.cloister.ministerAstronomy | quote }}
  OUTCOME_NURSERY_SNOB: {{ .Values.cloister.outcomeNurserySnob | quote }}
  PAPAYA: {{ .Values.cloister.papaya | quote }}
  STOP_LOW: {{ .Values.cloister.stopLow | quote }}
  VAST_NOISELESS_CHAP: {{ .Values.cloister.vastNoiselessChap | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "cloister.fullname" . }}-cloister
  labels:
  {{- include "cloister.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: cloister
spec:
  replicas: {{ .Values.cloister.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: cloister
      app.kubernetes.io/name: attainment
    {{- include "cloister.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: cloister
        app.kubernetes.io/name: attainment
      {{- include "cloister.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: c60579782c017ba62a9aef401613e3fd7dad72f931580f591e96a2179c96e957
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "cloister.fullname" . }}-cloister
        image: {{ .Values.cloister.cloister.image.repository }}:{{ .Values.cloister.cloister.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.cloister.cloister.imagePullPolicy }}
        name: cloister
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.cloister.cloister.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.cloister.cloister.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "cloister.fullname" . }}-cloister
  labels:
  {{- include "cloister.labels" . | nindent 4 }}
spec:
  type: {{ .Values.cloister.type }}
  selector:
    app.kubernetes.io/instance: cloister
    app.kubernetes.io/name: attainment
  {{- include "cloister.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.cloister.ports | toYaml | nindent 2 -}}
cloister:
  cholesterol: warm-up
  cloister:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  fierce: zone
  guiltlessPossible: withhold
  intensify: thoughtful
  keyboardAstonishingWarrant: availability
  ministerAstronomy: bagel
  outcomeNurserySnob: colt
  papaya: holiday
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  stopLow: badger
  type: ClusterIP
  vastNoiselessChap: arrow
kubernetesClusterDomain: cluster.local
