# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "minority.fullname" . }}-minority
  labels:
  {{- include "minority.labels" . | nindent 4 }}
data:
  CELLAR_SICK_EXHAUST: {{ .Values.minority.cellarSickExhaust | quote }}
  DIVIDE: {{ .Values.minority.divide | quote }}
  EVASIVE: {{ .Values.minority.evasive | quote }}
  MELODIC: {{ .Values.minority.melodic | quote }}
  PLANULA_ALPHA: {{ .Values.minority.planulaAlpha | quote }}
  PROVIDE: {{ .Values.minority.provide | quote }}
  REBEL_ENTREPRENEUR_SHOES: {{ .Values.minority.rebelEntrepreneurShoes | quote }}
  REBOOT_ARMY: {{ .Values.minority.rebootArmy | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "minority.fullname" . }}-minority
  labels:
  {{- include "minority.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: minority
spec:
  replicas: {{ .Values.minority.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: minority
      app.kubernetes.io/name: semicircle
    {{- include "minority.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: minority
        app.kubernetes.io/name: semicircle
      {{- include "minority.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 5b3a0935d6ff1767b456d1de7b7a3dcf52ab10eaa3067dbd714d83a80307feb0
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "minority.fullname" . }}-minority
        image: {{ .Values.minority.minority.image.repository }}:{{ .Values.minority.minority.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.minority.minority.imagePullPolicy }}
        name: minority
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.minority.minority.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.minority.minority.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "minority.fullname" . }}-minority
  labels:
  {{- include "minority.labels" . | nindent 4 }}
spec:
  type: {{ .Values.minority.type }}
  selector:
    app.kubernetes.io/instance: minority
    app.kubernetes.io/name: semicircle
  {{- include "minority.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.minority.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
minority:
  cellarSickExhaust: horst
  divide: enclosure
  evasive: release
  melodic: stag
  minority:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  planulaAlpha: upstairs
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  provide: infinite
  rebelEntrepreneurShoes: messy
  rebootArmy: verification
  replicas: 1
  type: ClusterIP
