# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "leader.fullname" . }}-leader
  labels:
  {{- include "leader.labels" . | nindent 4 }}
data:
  CHILI: {{ .Values.leader.chili | quote }}
  FLING_HOMELAND_CENT: {{ .Values.leader.flingHomelandCent | quote }}
  GESTURE_RUBBISH: {{ .Values.leader.gestureRubbish | quote }}
  ILLUSTRIOUS: {{ .Values.leader.illustrious | quote }}
  KITSCH_WEALTH: {{ .Values.leader.kitschWealth | quote }}
  LEGEND: {{ .Values.leader.legend | quote }}
  OBSIDIAN_AIRFORCE_STRAWBERRY: {{ .Values.leader.obsidianAirforceStrawberry | quote
    }}
  PEONY_CRASH: {{ .Values.leader.peonyCrash | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "leader.fullname" . }}-leader
  labels:
  {{- include "leader.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: leader
spec:
  replicas: {{ .Values.leader.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: leader
      app.kubernetes.io/name: tobacco
    {{- include "leader.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: leader
        app.kubernetes.io/name: tobacco
      {{- include "leader.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 4a90d2012a21298374a600f2a3db446a44eb0d739eee8584c88dad2b92221a97
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "leader.fullname" . }}-leader
        image: {{ .Values.leader.leader.image.repository }}:{{ .Values.leader.leader.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.leader.leader.imagePullPolicy }}
        name: leader
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.leader.leader.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.leader.leader.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "leader.fullname" . }}-leader
  labels:
  {{- include "leader.labels" . | nindent 4 }}
spec:
  type: {{ .Values.leader.type }}
  selector:
    app.kubernetes.io/instance: leader
    app.kubernetes.io/name: tobacco
  {{- include "leader.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.leader.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
leader:
  chili: whole
  flingHomelandCent: sneak
  gestureRubbish: landing
  illustrious: smock
  kitschWealth: moldy
  leader:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  legend: imprisonment
  obsidianAirforceStrawberry: film
  peonyCrash: tomatillo
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  type: ClusterIP
