# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "spice.fullname" . }}-spice
  labels:
  {{- include "spice.labels" . | nindent 4 }}
data:
  APPEARANCE_HEARTH_MEANS: {{ .Values.spice.appearanceHearthMeans | quote }}
  BAKE: {{ .Values.spice.bake | quote }}
  EQUATION_SLASH_JUICY: {{ .Values.spice.equationSlashJuicy | quote }}
  MINNOW: {{ .Values.spice.minnow | quote }}
  PILOT_CENTURY_JASMINE: {{ .Values.spice.pilotCenturyJasmine | quote }}
  POWERFUL_EDGE: {{ .Values.spice.powerfulEdge | quote }}
  SCRIM_LOBOTOMY_JOG: {{ .Values.spice.scrimLobotomyJog | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "spice.fullname" . }}-spice
  labels:
  {{- include "spice.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: spice
spec:
  replicas: {{ .Values.spice.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: spice
      app.kubernetes.io/name: stamp
    {{- include "spice.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: spice
        app.kubernetes.io/name: stamp
      {{- include "spice.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 530e49418b640933b1ca8aa63432fd068a0b57eb989848072f656edda9118ac9
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "spice.fullname" . }}-spice
        image: {{ .Values.spice.spice.image.repository }}:{{ .Values.spice.spice.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.spice.spice.imagePullPolicy }}
        name: spice
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.spice.spice.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.spice.spice.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "spice.fullname" . }}-spice
  labels:
  {{- include "spice.labels" . | nindent 4 }}
spec:
  type: {{ .Values.spice.type }}
  selector:
    app.kubernetes.io/instance: spice
    app.kubernetes.io/name: stamp
  {{- include "spice.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.spice.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
spice:
  appearanceHearthMeans: fishnet
  bake: eyebrows
  equationSlashJuicy: courtroom
  minnow: suburb
  pilotCenturyJasmine: worry
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  powerfulEdge: ironclad
  replicas: 1
  scrimLobotomyJog: badger
  spice:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  type: ClusterIP
