# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "neighborhood.fullname" . }}-neighborhood
  labels:
  {{- include "neighborhood.labels" . | nindent 4 }}
data:
  AIRBAG_PEPPERONI: {{ .Values.neighborhood.airbagPepperoni | quote }}
  BOBCAT_ELVER: {{ .Values.neighborhood.bobcatElver | quote }}
  CASH_REDUCTION: {{ .Values.neighborhood.cashReduction | quote }}
  CITIZENSHIP: {{ .Values.neighborhood.citizenship | quote }}
  COUGH_UNIVERSITY: {{ .Values.neighborhood.coughUniversity | quote }}
  HASSOCK: {{ .Values.neighborhood.hassock | quote }}
  HIPPODROME_BANKRUPTCY: {{ .Values.neighborhood.hippodromeBankruptcy | quote }}
  LIVER: {{ .Values.neighborhood.liver | quote }}
  PITCHER_UNITY_PHILOSOPHER: {{ .Values.neighborhood.pitcherUnityPhilosopher | quote
    }}
  SOFTBALL_INTERJECT_HANDMAIDEN: {{ .Values.neighborhood.softballInterjectHandmaiden
    | quote }}
  SQUID_EGGNOG_WEEKEND: {{ .Values.neighborhood.squidEggnogWeekend | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "neighborhood.fullname" . }}-neighborhood
  labels:
  {{- include "neighborhood.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: neighborhood
spec:
  replicas: {{ .Values.neighborhood.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: neighborhood
      app.kubernetes.io/name: shake
    {{- include "neighborhood.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: neighborhood
        app.kubernetes.io/name: shake
      {{- include "neighborhood.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: e3a899cb727cd60d5ae5c3c30299d42484500d122969d16cf4a62d0f5fb69300
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "neighborhood.fullname" . }}-neighborhood
        image: {{ .Values.neighborhood.neighborhood.image.repository }}:{{ .Values.neighborhood.neighborhood.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.neighborhood.neighborhood.imagePullPolicy }}
        name: neighborhood
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.neighborhood.neighborhood.resources | nindent 10
          }}
        securityContext: {{- toYaml .Values.neighborhood.neighborhood.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "neighborhood.fullname" . }}-neighborhood
  labels:
  {{- include "neighborhood.labels" . | nindent 4 }}
spec:
  type: {{ .Values.neighborhood.type }}
  selector:
    app.kubernetes.io/instance: neighborhood
    app.kubernetes.io/name: shake
  {{- include "neighborhood.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.neighborhood.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
neighborhood:
  airbagPepperoni: cowardly
  bobcatElver: slash
  cashReduction: hallowed
  citizenship: divider
  coughUniversity: calculate
  hassock: accomplishment
  hippodromeBankruptcy: numeracy
  liver: camera
  neighborhood:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  pitcherUnityPhilosopher: electrocardiogram
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  softballInterjectHandmaiden: diagram
  squidEggnogWeekend: waveform
  type: ClusterIP
