# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "vegetable.fullname" . }}-vegetable
  labels:
  {{- include "vegetable.labels" . | nindent 4 }}
data:
  CRITIQUE_CONSCIENCE: {{ .Values.vegetable.critiqueConscience | quote }}
  FETCH: {{ .Values.vegetable.fetch | quote }}
  MAJESTIC_ALIAS: {{ .Values.vegetable.majesticAlias | quote }}
  PHRASING_WAMPUM: {{ .Values.vegetable.phrasingWampum | quote }}
  PURSUIT_CROCUS_NURSERY: {{ .Values.vegetable.pursuitCrocusNursery | quote }}
  RAPID_FOUNDING_FORETELL: {{ .Values.vegetable.rapidFoundingForetell | quote }}
  SPECIFICATION: {{ .Values.vegetable.specification | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "vegetable.fullname" . }}-vegetable
  labels:
  {{- include "vegetable.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: vegetable
spec:
  replicas: {{ .Values.vegetable.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: vegetable
      app.kubernetes.io/name: live
    {{- include "vegetable.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: vegetable
        app.kubernetes.io/name: live
      {{- include "vegetable.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: c4e7d01fb2cd9018838a8593d7c1ebe83e7ee0a776d089a4a4e98e92039bfa5b
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "vegetable.fullname" . }}-vegetable
        image: {{ .Values.vegetable.vegetable.image.repository }}:{{ .Values.vegetable.vegetable.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.vegetable.vegetable.imagePullPolicy }}
        name: vegetable
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.vegetable.vegetable.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.vegetable.vegetable.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "vegetable.fullname" . }}-vegetable
  labels:
  {{- include "vegetable.labels" . | nindent 4 }}
spec:
  type: {{ .Values.vegetable.type }}
  selector:
    app.kubernetes.io/instance: vegetable
    app.kubernetes.io/name: live
  {{- include "vegetable.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.vegetable.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
vegetable:
  critiqueConscience: discover
  fetch: sport
  majesticAlias: curly
  phrasingWampum: altar
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  pursuitCrocusNursery: hit
  rapidFoundingForetell: regard
  replicas: 1
  specification: cradle
  type: ClusterIP
  vegetable:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
