# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "advocate.fullname" . }}-advocate
  labels:
  {{- include "advocate.labels" . | nindent 4 }}
data:
  BOARD_BEAST_BOIL: {{ .Values.advocate.boardBeastBoil | quote }}
  DARN: {{ .Values.advocate.darn | quote }}
  GALLON: {{ .Values.advocate.gallon | quote }}
  INSIDE_MOLAR: {{ .Values.advocate.insideMolar | quote }}
  PETITION_SILICA: {{ .Values.advocate.petitionSilica | quote }}
  ROT: {{ .Values.advocate.rot | quote }}
  TAX_PRESIDE_ANSWER: {{ .Values.advocate.taxPresideAnswer | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "advocate.fullname" . }}-advocate
  labels:
  {{- include "advocate.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: advocate
spec:
  replicas: {{ .Values.advocate.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: advocate
      app.kubernetes.io/name: flame
    {{- include "advocate.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: advocate
        app.kubernetes.io/name: flame
      {{- include "advocate.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: a4bc1c3a7cf1d7c1f225dc4153e543af411db3d4fab3864e07568ca1ac141b37
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "advocate.fullname" . }}-advocate
        image: {{ .Values.advocate.advocate.image.repository }}:{{ .Values.advocate.advocate.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.advocate.advocate.imagePullPolicy }}
        name: advocate
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.advocate.advocate.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.advocate.advocate.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "advocate.fullname" . }}-advocate
  labels:
  {{- include "advocate.labels" . | nindent 4 }}
spec:
  type: {{ .Values.advocate.type }}
  selector:
    app.kubernetes.io/instance: advocate
    app.kubernetes.io/name: flame
  {{- include "advocate.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.advocate.ports | toYaml | nindent 2 -}}
advocate:
  advocate:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  boardBeastBoil: min
  darn: negligee
  gallon: clank
  insideMolar: withdraw
  petitionSilica: confidence
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  rot: hacksaw
  taxPresideAnswer: pimple
  type: ClusterIP
kubernetesClusterDomain: cluster.local
