# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "dividend.fullname" . }}-dividend
  labels:
  {{- include "dividend.labels" . | nindent 4 }}
data:
  DECISION_LANAI_FRIENDSHIP: {{ .Values.dividend.decisionLanaiFriendship | quote
    }}
  PROCTOR: {{ .Values.dividend.proctor | quote }}
  RECLAMATION_MASK_DIALOGUE: {{ .Values.dividend.reclamationMaskDialogue | quote
    }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "dividend.fullname" . }}-dividend
  labels:
  {{- include "dividend.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: dividend
spec:
  replicas: {{ .Values.dividend.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: dividend
      app.kubernetes.io/name: imagine
    {{- include "dividend.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: dividend
        app.kubernetes.io/name: imagine
      {{- include "dividend.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: dfe4177bd89b771627539d02825d80a2cc75ce3661fa0c7f027bd8331c449c00
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "dividend.fullname" . }}-dividend
        image: {{ .Values.dividend.dividend.image.repository }}:{{ .Values.dividend.dividend.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.dividend.dividend.imagePullPolicy }}
        name: dividend
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.dividend.dividend.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.dividend.dividend.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "dividend.fullname" . }}-dividend
  labels:
  {{- include "dividend.labels" . | nindent 4 }}
spec:
  type: {{ .Values.dividend.type }}
  selector:
    app.kubernetes.io/instance: dividend
    app.kubernetes.io/name: imagine
  {{- include "dividend.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.dividend.ports | toYaml | nindent 2 -}}
dividend:
  decisionLanaiFriendship: cowboy
  dividend:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  proctor: deficit
  reclamationMaskDialogue: median
  replicas: 1
  type: ClusterIP
kubernetesClusterDomain: cluster.local
