# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "admission.fullname" . }}-admission
  labels:
  {{- include "admission.labels" . | nindent 4 }}
data:
  CURTAIN_DASHING_ISCHEMIA: {{ .Values.admission.curtainDashingIschemia | quote }}
  FERRET_EASY: {{ .Values.admission.ferretEasy | quote }}
  HALLOWEEN_PROPONENT_POMELO: {{ .Values.admission.halloweenProponentPomelo | quote
    }}
  JAILHOUSE: {{ .Values.admission.jailhouse | quote }}
  LOGO_SHAWL: {{ .Values.admission.logoShawl | quote }}
  PECK: {{ .Values.admission.peck | quote }}
  PUBLISHER_WEDDING_RIGHTEOUS: {{ .Values.admission.publisherWeddingRighteous | quote
    }}
  REPUBLICAN_VEX: {{ .Values.admission.republicanVex | quote }}
  RITZY: {{ .Values.admission.ritzy | quote }}
  SHOEMAKER_SOGGY: {{ .Values.admission.shoemakerSoggy | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "admission.fullname" . }}-admission
  labels:
  {{- include "admission.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: admission
spec:
  replicas: {{ .Values.admission.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: admission
      app.kubernetes.io/name: microlending
    {{- include "admission.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: admission
        app.kubernetes.io/name: microlending
      {{- include "admission.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 707dfb70d6715db438600322644ee951cd4658b4ab97fec28428a4151d55ed11
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "admission.fullname" . }}-admission
        image: {{ .Values.admission.admission.image.repository }}:{{ .Values.admission.admission.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.admission.admission.imagePullPolicy }}
        name: admission
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.admission.admission.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.admission.admission.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "admission.fullname" . }}-admission
  labels:
  {{- include "admission.labels" . | nindent 4 }}
spec:
  type: {{ .Values.admission.type }}
  selector:
    app.kubernetes.io/instance: admission
    app.kubernetes.io/name: microlending
  {{- include "admission.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.admission.ports | toYaml | nindent 2 -}}
admission:
  admission:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  curtainDashingIschemia: circumstance
  ferretEasy: ligand
  halloweenProponentPomelo: ping
  jailhouse: territory
  logoShawl: rank
  peck: select
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  publisherWeddingRighteous: velvet
  replicas: 1
  republicanVex: sprinter
  ritzy: moccasins
  shoemakerSoggy: team
  type: ClusterIP
kubernetesClusterDomain: cluster.local
