# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "nutrient.fullname" . }}-nutrient
  labels:
  {{- include "nutrient.labels" . | nindent 4 }}
data:
  BARBAROUS_SCRIPTURE_FERRET: {{ .Values.nutrient.barbarousScriptureFerret | quote
    }}
  FLASHY_GADGET: {{ .Values.nutrient.flashyGadget | quote }}
  FLING_PYRAMID: {{ .Values.nutrient.flingPyramid | quote }}
  FOX_SORBET_COMPETITION: {{ .Values.nutrient.foxSorbetCompetition | quote }}
  GUARDED_GYM: {{ .Values.nutrient.guardedGym | quote }}
  HAMMER: {{ .Values.nutrient.hammer | quote }}
  INVERSE: {{ .Values.nutrient.inverse | quote }}
  STATUESQUE: {{ .Values.nutrient.statuesque | quote }}
  TELESCREEN: {{ .Values.nutrient.telescreen | quote }}
  TRAIL_LEAVER_FRATRICIDE: {{ .Values.nutrient.trailLeaverFratricide | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "nutrient.fullname" . }}-nutrient
  labels:
  {{- include "nutrient.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: nutrient
spec:
  replicas: {{ .Values.nutrient.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: nutrient
      app.kubernetes.io/name: sundial
    {{- include "nutrient.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: nutrient
        app.kubernetes.io/name: sundial
      {{- include "nutrient.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: fd3f26b0ee6eea18add74b206abae122dd936ab9c231e3892c6bc656bae73824
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "nutrient.fullname" . }}-nutrient
        image: {{ .Values.nutrient.nutrient.image.repository }}:{{ .Values.nutrient.nutrient.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.nutrient.nutrient.imagePullPolicy }}
        name: nutrient
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.nutrient.nutrient.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.nutrient.nutrient.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "nutrient.fullname" . }}-nutrient
  labels:
  {{- include "nutrient.labels" . | nindent 4 }}
spec:
  type: {{ .Values.nutrient.type }}
  selector:
    app.kubernetes.io/instance: nutrient
    app.kubernetes.io/name: sundial
  {{- include "nutrient.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.nutrient.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
nutrient:
  barbarousScriptureFerret: sanction
  flashyGadget: work
  flingPyramid: bellows
  foxSorbetCompetition: corn
  guardedGym: med
  hammer: brass
  inverse: formation
  nutrient:
    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
  replicas: 1
  statuesque: guerrilla
  telescreen: citizenship
  trailLeaverFratricide: habitat
  type: ClusterIP
