# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "descent.fullname" . }}-descent
  labels:
  {{- include "descent.labels" . | nindent 4 }}
data:
  AIRPLANE_MERCHANDISE_LILAC: {{ .Values.descent.airplaneMerchandiseLilac | quote
    }}
  CHEQUE_CONFLICT_FRIGHTEN: {{ .Values.descent.chequeConflictFrighten | quote }}
  CONTROL: {{ .Values.descent.control | quote }}
  FORMAT: {{ .Values.descent.format | quote }}
  HARDCOVER_COUNSELOR_NAIVE: {{ .Values.descent.hardcoverCounselorNaive | quote }}
  HERO_PET_BAT: {{ .Values.descent.heroPetBat | quote }}
  MEATLOAF: {{ .Values.descent.meatloaf | quote }}
  ROCK: {{ .Values.descent.rock | quote }}
  SHAMPOO_HIGHLAND: {{ .Values.descent.shampooHighland | quote }}
  TROOP_BOTTLE: {{ .Values.descent.troopBottle | quote }}
  WRAPAROUND_RAIMENT: {{ .Values.descent.wraparoundRaiment | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "descent.fullname" . }}-descent
  labels:
  {{- include "descent.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: descent
spec:
  replicas: {{ .Values.descent.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: descent
      app.kubernetes.io/name: sensitive
    {{- include "descent.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: descent
        app.kubernetes.io/name: sensitive
      {{- include "descent.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 76fdd911b375c137b61c2356301eabb29866d31b502f480b68e3241d0ac5cf1d
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "descent.fullname" . }}-descent
        image: {{ .Values.descent.descent.image.repository }}:{{ .Values.descent.descent.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.descent.descent.imagePullPolicy }}
        name: descent
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.descent.descent.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.descent.descent.containerSecurityContext |
          nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "descent.fullname" . }}-descent
  labels:
  {{- include "descent.labels" . | nindent 4 }}
spec:
  type: {{ .Values.descent.type }}
  selector:
    app.kubernetes.io/instance: descent
    app.kubernetes.io/name: sensitive
  {{- include "descent.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.descent.ports | toYaml | nindent 2 -}}
descent:
  airplaneMerchandiseLilac: beet
  chequeConflictFrighten: peer
  control: psychoanalyst
  descent:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  format: hurdler
  hardcoverCounselorNaive: cameo
  heroPetBat: cookie
  meatloaf: tab
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  rock: angle
  shampooHighland: hydrocarb
  troopBottle: rid
  type: ClusterIP
  wraparoundRaiment: proctor
kubernetesClusterDomain: cluster.local
