# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "divider.fullname" . }}-divider
  labels:
  {{- include "divider.labels" . | nindent 4 }}
data:
  CLIFF_DECAY: {{ .Values.divider.cliffDecay | quote }}
  DISTINCT_DAWN_PLAGIARISM: {{ .Values.divider.distinctDawnPlagiarism | quote }}
  INVENTION_RETHINKING_PRIESTHOOD: {{ .Values.divider.inventionRethinkingPriesthood
    | quote }}
  LOQUAT_ISOGLOSS_CHECKROOM: {{ .Values.divider.loquatIsoglossCheckroom | quote }}
  MANIFESTATION_FOURTHS: {{ .Values.divider.manifestationFourths | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "divider.fullname" . }}-divider
  labels:
  {{- include "divider.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: divider
spec:
  replicas: {{ .Values.divider.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: divider
      app.kubernetes.io/name: cactus
    {{- include "divider.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: divider
        app.kubernetes.io/name: cactus
      {{- include "divider.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: dbf8ace62e3cc2beacbe5669cfb4886d1155d8439d819c8f306bceedc74d0cc5
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "divider.fullname" . }}-divider
        image: {{ .Values.divider.divider.image.repository }}:{{ .Values.divider.divider.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.divider.divider.imagePullPolicy }}
        name: divider
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.divider.divider.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.divider.divider.containerSecurityContext |
          nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "divider.fullname" . }}-divider
  labels:
  {{- include "divider.labels" . | nindent 4 }}
spec:
  type: {{ .Values.divider.type }}
  selector:
    app.kubernetes.io/instance: divider
    app.kubernetes.io/name: cactus
  {{- include "divider.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.divider.ports | toYaml | nindent 2 -}}
divider:
  cliffDecay: software
  distinctDawnPlagiarism: soak
  divider:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  inventionRethinkingPriesthood: key
  loquatIsoglossCheckroom: numeracy
  manifestationFourths: ecclesia
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  type: ClusterIP
kubernetesClusterDomain: cluster.local
