# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "spectacle.fullname" . }}-spectacle
  labels:
  {{- include "spectacle.labels" . | nindent 4 }}
data:
  GELATIN_SMITE_CLEANER: {{ .Values.spectacle.gelatinSmiteCleaner | quote }}
  HINT_POLARISATION: {{ .Values.spectacle.hintPolarisation | quote }}
  MILK_WANNABE_VALUE: {{ .Values.spectacle.milkWannabeValue | quote }}
  PRIVATE_RACISM_CENSUS: {{ .Values.spectacle.privateRacismCensus | quote }}
  SUBROUTINE_SLAVE_DRY: {{ .Values.spectacle.subroutineSlaveDry | quote }}
  THUNDER_CAR_PUMPERNICKEL: {{ .Values.spectacle.thunderCarPumpernickel | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "spectacle.fullname" . }}-spectacle
  labels:
  {{- include "spectacle.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: spectacle
spec:
  replicas: {{ .Values.spectacle.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: spectacle
      app.kubernetes.io/name: poppy
    {{- include "spectacle.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: spectacle
        app.kubernetes.io/name: poppy
      {{- include "spectacle.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: b90f4dbb8aec5ad3bcb856ced195ceac20a33564c1813a57aa5a403db55b0e72
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "spectacle.fullname" . }}-spectacle
        image: {{ .Values.spectacle.spectacle.image.repository }}:{{ .Values.spectacle.spectacle.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.spectacle.spectacle.imagePullPolicy }}
        name: spectacle
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.spectacle.spectacle.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.spectacle.spectacle.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "spectacle.fullname" . }}-spectacle
  labels:
  {{- include "spectacle.labels" . | nindent 4 }}
spec:
  type: {{ .Values.spectacle.type }}
  selector:
    app.kubernetes.io/instance: spectacle
    app.kubernetes.io/name: poppy
  {{- include "spectacle.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.spectacle.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
spectacle:
  gelatinSmiteCleaner: dependency
  hintPolarisation: meek
  milkWannabeValue: gum
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  privateRacismCensus: semicircle
  replicas: 1
  spectacle:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  subroutineSlaveDry: electrocardiogram
  thunderCarPumpernickel: gabby
  type: ClusterIP
