# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "boar.fullname" . }}-boar
  labels:
  {{- include "boar.labels" . | nindent 4 }}
data:
  AFTERMATH: {{ .Values.boar.aftermath | quote }}
  CAROTENE_PERFECTION_JUSTICE: {{ .Values.boar.carotenePerfectionJustice | quote
    }}
  GLOBE_INSECTARIUM_WHISKEY: {{ .Values.boar.globeInsectariumWhiskey | quote }}
  PROGRESS_TOTAL: {{ .Values.boar.progressTotal | quote }}
  SOGGY_SCOUT_PRAIRIE: {{ .Values.boar.soggyScoutPrairie | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "boar.fullname" . }}-boar
  labels:
  {{- include "boar.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: boar
spec:
  replicas: {{ .Values.boar.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: boar
      app.kubernetes.io/name: obedience
    {{- include "boar.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: boar
        app.kubernetes.io/name: obedience
      {{- include "boar.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: ad068fcad7cd3dcbf4e0b8dcf8b99541e4f8cc874541d01b42911484e2dd58ea
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "boar.fullname" . }}-boar
        image: {{ .Values.boar.boar.image.repository }}:{{ .Values.boar.boar.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.boar.boar.imagePullPolicy }}
        name: boar
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.boar.boar.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.boar.boar.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "boar.fullname" . }}-boar
  labels:
  {{- include "boar.labels" . | nindent 4 }}
spec:
  type: {{ .Values.boar.type }}
  selector:
    app.kubernetes.io/instance: boar
    app.kubernetes.io/name: obedience
  {{- include "boar.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.boar.ports | toYaml | nindent 2 -}}
boar:
  aftermath: invite
  boar:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  carotenePerfectionJustice: therapeutic
  globeInsectariumWhiskey: professor
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  progressTotal: protest
  replicas: 1
  soggyScoutPrairie: crate
  type: ClusterIP
kubernetesClusterDomain: cluster.local
