# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "admit.fullname" . }}-admit
  labels:
  {{- include "admit.labels" . | nindent 4 }}
data:
  ASSAULT: {{ .Values.admit.assault | quote }}
  DEPEND_OCELOT_WHISTLE: {{ .Values.admit.dependOcelotWhistle | quote }}
  GRACE_CARRY_HELLISH: {{ .Values.admit.graceCarryHellish | quote }}
  KEYSTONE_SUBDUED: {{ .Values.admit.keystoneSubdued | quote }}
  SEAFOOD_SIMILARITY_DIRNDL: {{ .Values.admit.seafoodSimilarityDirndl | quote }}
  SIEGE_TEENAGER_PORTRAIT: {{ .Values.admit.siegeTeenagerPortrait | quote }}
  SPEED: {{ .Values.admit.speed | quote }}
  TWINE_DRIP_BELLIGERENT: {{ .Values.admit.twineDripBelligerent | quote }}
  VACUOUS_ALBUM_CONSPIRACY: {{ .Values.admit.vacuousAlbumConspiracy | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "admit.fullname" . }}-admit
  labels:
  {{- include "admit.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: admit
spec:
  replicas: {{ .Values.admit.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: admit
      app.kubernetes.io/name: obsidian
    {{- include "admit.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: admit
        app.kubernetes.io/name: obsidian
      {{- include "admit.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 8f9fbe3d158da5c368e9cedbe08b0a8f2f64f76f468d66aab8db2bc4b3484311
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "admit.fullname" . }}-admit
        image: {{ .Values.admit.admit.image.repository }}:{{ .Values.admit.admit.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.admit.admit.imagePullPolicy }}
        name: admit
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.admit.admit.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.admit.admit.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "admit.fullname" . }}-admit
  labels:
  {{- include "admit.labels" . | nindent 4 }}
spec:
  type: {{ .Values.admit.type }}
  selector:
    app.kubernetes.io/instance: admit
    app.kubernetes.io/name: obsidian
  {{- include "admit.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.admit.ports | toYaml | nindent 2 -}}
admit:
  admit:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  assault: squeal
  dependOcelotWhistle: night
  graceCarryHellish: hardening
  keystoneSubdued: vibraphone
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  seafoodSimilarityDirndl: prose
  siegeTeenagerPortrait: interval
  speed: fertilizer
  twineDripBelligerent: exhaustion
  type: ClusterIP
  vacuousAlbumConspiracy: book
kubernetesClusterDomain: cluster.local
