# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "smoggy.fullname" . }}-smoggy
  labels:
  {{- include "smoggy.labels" . | nindent 4 }}
data:
  COURTHOUSE_PIMPLE_MOCCASINS: {{ .Values.smoggy.courthousePimpleMoccasins | quote
    }}
  ENGINE_WAY: {{ .Values.smoggy.engineWay | quote }}
  EXPLORATION_VENDOR_INSULATION: {{ .Values.smoggy.explorationVendorInsulation |
    quote }}
  MAINTAINER: {{ .Values.smoggy.maintainer | quote }}
  MATTRESS_BASIN_SILKWORM: {{ .Values.smoggy.mattressBasinSilkworm | quote }}
  OFFICER_KENDO: {{ .Values.smoggy.officerKendo | quote }}
  PINOT_PLATTER: {{ .Values.smoggy.pinotPlatter | quote }}
  RAVEN: {{ .Values.smoggy.raven | quote }}
  ROSTRUM_BUILDING_RECORDING: {{ .Values.smoggy.rostrumBuildingRecording | quote
    }}
  STAMINA: {{ .Values.smoggy.stamina | quote }}
  STEADFAST_HOOD_AD HOC: {{ .Values.smoggy.steadfastHoodAdHoc | quote }}
  SUBTITLE_TRAILER: {{ .Values.smoggy.subtitleTrailer | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "smoggy.fullname" . }}-smoggy
  labels:
  {{- include "smoggy.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: smoggy
spec:
  replicas: {{ .Values.smoggy.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: smoggy
      app.kubernetes.io/name: grubby
    {{- include "smoggy.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: smoggy
        app.kubernetes.io/name: grubby
      {{- include "smoggy.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 3ea72abeab3450328436a96feb230550ece3fce4cb0e279fe7e0cd3d53a991f8
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "smoggy.fullname" . }}-smoggy
        image: {{ .Values.smoggy.smoggy.image.repository }}:{{ .Values.smoggy.smoggy.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.smoggy.smoggy.imagePullPolicy }}
        name: smoggy
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.smoggy.smoggy.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.smoggy.smoggy.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "smoggy.fullname" . }}-smoggy
  labels:
  {{- include "smoggy.labels" . | nindent 4 }}
spec:
  type: {{ .Values.smoggy.type }}
  selector:
    app.kubernetes.io/instance: smoggy
    app.kubernetes.io/name: grubby
  {{- include "smoggy.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.smoggy.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
smoggy:
  courthousePimpleMoccasins: hydraulics
  engineWay: click
  explorationVendorInsulation: likeness
  maintainer: quicksand
  mattressBasinSilkworm: working
  officerKendo: march
  pinotPlatter: login
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  raven: princess
  replicas: 1
  rostrumBuildingRecording: kill
  smoggy:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  stamina: wait
  steadfastHoodAdHoc: alpaca
  subtitleTrailer: orator
  type: ClusterIP
