# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "broccoli.fullname" . }}-broccoli
  labels:
  {{- include "broccoli.labels" . | nindent 4 }}
data:
  BASEMENT_VARIANT_PLANE: {{ .Values.broccoli.basementVariantPlane | quote }}
  CLAIM_DIFFUSE: {{ .Values.broccoli.claimDiffuse | quote }}
  CONSISTENCY_JUDGE_FIG: {{ .Values.broccoli.consistencyJudgeFig | quote }}
  CYTOKINE_DRYER_SWAMP: {{ .Values.broccoli.cytokineDryerSwamp | quote }}
  EXPLODE_WALL: {{ .Values.broccoli.explodeWall | quote }}
  MARKETING: {{ .Values.broccoli.marketing | quote }}
  MARTEN: {{ .Values.broccoli.marten | quote }}
  MORALE_LEVER_TOOTHBRUSH: {{ .Values.broccoli.moraleLeverToothbrush | quote }}
  SWAMP: {{ .Values.broccoli.swamp | quote }}
  TORSO_NATION_PEARL: {{ .Values.broccoli.torsoNationPearl | quote }}
  VENTI: {{ .Values.broccoli.venti | quote }}
  WANNABE: {{ .Values.broccoli.wannabe | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "broccoli.fullname" . }}-broccoli
  labels:
  {{- include "broccoli.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: broccoli
spec:
  replicas: {{ .Values.broccoli.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: broccoli
      app.kubernetes.io/name: veil
    {{- include "broccoli.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: broccoli
        app.kubernetes.io/name: veil
      {{- include "broccoli.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: d99018c0df079bbde595dbba9c6624a7f3fe0e242c45b6f56d41d97c6bc343f5
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "broccoli.fullname" . }}-broccoli
        image: {{ .Values.broccoli.broccoli.image.repository }}:{{ .Values.broccoli.broccoli.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.broccoli.broccoli.imagePullPolicy }}
        name: broccoli
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.broccoli.broccoli.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.broccoli.broccoli.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "broccoli.fullname" . }}-broccoli
  labels:
  {{- include "broccoli.labels" . | nindent 4 }}
spec:
  type: {{ .Values.broccoli.type }}
  selector:
    app.kubernetes.io/instance: broccoli
    app.kubernetes.io/name: veil
  {{- include "broccoli.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.broccoli.ports | toYaml | nindent 2 -}}
broccoli:
  basementVariantPlane: monsoon
  broccoli:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  claimDiffuse: leadership
  consistencyJudgeFig: icy
  cytokineDryerSwamp: stingy
  explodeWall: poor
  marketing: cirrus
  marten: attorney
  moraleLeverToothbrush: anticipation
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  swamp: characteristic
  torsoNationPearl: chuck
  type: ClusterIP
  venti: male
  wannabe: grandpa
kubernetesClusterDomain: cluster.local
