# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "brainy.fullname" . }}-brainy
  labels:
  {{- include "brainy.labels" . | nindent 4 }}
data:
  BATTING_REPRESENT_BASSINET: {{ .Values.brainy.battingRepresentBassinet | quote
    }}
  DUSTY: {{ .Values.brainy.dusty | quote }}
  HIRE_NEUROBIOLOGIST_BEEF: {{ .Values.brainy.hireNeurobiologistBeef | quote }}
  LINEN_MEASUREMENT_LIMIT: {{ .Values.brainy.linenMeasurementLimit | quote }}
  UNSIGHTLY_UNDERWEAR: {{ .Values.brainy.unsightlyUnderwear | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "brainy.fullname" . }}-brainy
  labels:
  {{- include "brainy.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: brainy
spec:
  replicas: {{ .Values.brainy.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: brainy
      app.kubernetes.io/name: cloistered
    {{- include "brainy.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: brainy
        app.kubernetes.io/name: cloistered
      {{- include "brainy.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 2b88fecd91a561209bb34f43d834550d29bf07c2f84b1a6ccf91f6d2b07890ef
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "brainy.fullname" . }}-brainy
        image: {{ .Values.brainy.brainy.image.repository }}:{{ .Values.brainy.brainy.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.brainy.brainy.imagePullPolicy }}
        name: brainy
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.brainy.brainy.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.brainy.brainy.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "brainy.fullname" . }}-brainy
  labels:
  {{- include "brainy.labels" . | nindent 4 }}
spec:
  type: {{ .Values.brainy.type }}
  selector:
    app.kubernetes.io/instance: brainy
    app.kubernetes.io/name: cloistered
  {{- include "brainy.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.brainy.ports | toYaml | nindent 2 -}}
brainy:
  battingRepresentBassinet: embellishment
  brainy:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  dusty: bleed
  hireNeurobiologistBeef: profile
  linenMeasurementLimit: harp
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  type: ClusterIP
  unsightlyUnderwear: secure
kubernetesClusterDomain: cluster.local
