# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "prior.fullname" . }}-prior
  labels:
  {{- include "prior.labels" . | nindent 4 }}
data:
  APPROVAL: {{ .Values.prior.approval | quote }}
  MOSQUE_CRIBBAGE_IMAGINARY: {{ .Values.prior.mosqueCribbageImaginary | quote }}
  SUNDIAL: {{ .Values.prior.sundial | quote }}
  WRAPAROUND: {{ .Values.prior.wraparound | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "prior.fullname" . }}-prior
  labels:
  {{- include "prior.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: prior
spec:
  replicas: {{ .Values.prior.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: prior
      app.kubernetes.io/name: initialize
    {{- include "prior.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: prior
        app.kubernetes.io/name: initialize
      {{- include "prior.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 544fafc49da03cbc8bede5abe63e3b89a54f9f86cb0c860a53928251ec0a3dcd
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "prior.fullname" . }}-prior
        image: {{ .Values.prior.prior.image.repository }}:{{ .Values.prior.prior.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.prior.prior.imagePullPolicy }}
        name: prior
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.prior.prior.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.prior.prior.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "prior.fullname" . }}-prior
  labels:
  {{- include "prior.labels" . | nindent 4 }}
spec:
  type: {{ .Values.prior.type }}
  selector:
    app.kubernetes.io/instance: prior
    app.kubernetes.io/name: initialize
  {{- include "prior.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.prior.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
prior:
  approval: paperback
  mosqueCribbageImaginary: glacier
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  prior:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  replicas: 1
  sundial: lending
  type: ClusterIP
  wraparound: pilgrimage
