# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "bar.fullname" . }}-bar
  labels:
  {{- include "bar.labels" . | nindent 4 }}
data:
  EXECUTE: {{ .Values.bar.execute | quote }}
  GOPHER_STATUE: {{ .Values.bar.gopherStatue | quote }}
  INJURY: {{ .Values.bar.injury | quote }}
  KNEEJERK: {{ .Values.bar.kneejerk | quote }}
  PARSNIP: {{ .Values.bar.parsnip | quote }}
  WET-BAR_HYPNOTIC_BATHROOM: {{ .Values.bar.wetBarHypnoticBathroom | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "bar.fullname" . }}-bar
  labels:
  {{- include "bar.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: bar
spec:
  replicas: {{ .Values.bar.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: bar
      app.kubernetes.io/name: dramatize
    {{- include "bar.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: bar
        app.kubernetes.io/name: dramatize
      {{- include "bar.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 695e81b8fa86cc93282e18300e1b42e6c62b2d42b76f85433cff709fac651071
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "bar.fullname" . }}-bar
        image: {{ .Values.bar.bar.image.repository }}:{{ .Values.bar.bar.image.tag | default
          .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.bar.bar.imagePullPolicy }}
        name: bar
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.bar.bar.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.bar.bar.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "bar.fullname" . }}-bar
  labels:
  {{- include "bar.labels" . | nindent 4 }}
spec:
  type: {{ .Values.bar.type }}
  selector:
    app.kubernetes.io/instance: bar
    app.kubernetes.io/name: dramatize
  {{- include "bar.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.bar.ports | toYaml | nindent 2 -}}
bar:
  bar:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  execute: separate
  gopherStatue: sovereignty
  injury: investment
  kneejerk: advance
  parsnip: waffle
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  type: ClusterIP
  wetBarHypnoticBathroom: checkroom
kubernetesClusterDomain: cluster.local
