# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "nectar.fullname" . }}-nectar
  labels:
  {{- include "nectar.labels" . | nindent 4 }}
data:
  QUEST_FENCING_YELLOW: {{ .Values.nectar.questFencingYellow | quote }}
  WAX_SCENT_FLAWLESS: {{ .Values.nectar.waxScentFlawless | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "nectar.fullname" . }}-nectar
  labels:
  {{- include "nectar.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: nectar
spec:
  replicas: {{ .Values.nectar.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: nectar
      app.kubernetes.io/name: county
    {{- include "nectar.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: nectar
        app.kubernetes.io/name: county
      {{- include "nectar.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: d098b64157aed2b0b3eb8a040022fbd0549c290ed695e74b7006ec671fb7d3e1
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "nectar.fullname" . }}-nectar
        image: {{ .Values.nectar.nectar.image.repository }}:{{ .Values.nectar.nectar.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.nectar.nectar.imagePullPolicy }}
        name: nectar
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.nectar.nectar.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.nectar.nectar.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "nectar.fullname" . }}-nectar
  labels:
  {{- include "nectar.labels" . | nindent 4 }}
spec:
  type: {{ .Values.nectar.type }}
  selector:
    app.kubernetes.io/instance: nectar
    app.kubernetes.io/name: county
  {{- include "nectar.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.nectar.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
nectar:
  nectar:
    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
  questFencingYellow: infix
  replicas: 1
  type: ClusterIP
  waxScentFlawless: mule
