# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "smash.fullname" . }}-smash
  labels:
  {{- include "smash.labels" . | nindent 4 }}
data:
  BLOGGER: {{ .Values.smash.blogger | quote }}
  CARBOHYDRATE_HERITAGE: {{ .Values.smash.carbohydrateHeritage | quote }}
  ESCAPE_HANDSOME_PENICILLIN: {{ .Values.smash.escapeHandsomePenicillin | quote }}
  HUBCAP_BASS: {{ .Values.smash.hubcapBass | quote }}
  MOOSE: {{ .Values.smash.moose | quote }}
  NIECE_TRIAL_SNORE: {{ .Values.smash.nieceTrialSnore | quote }}
  PEANUT_RASPBERRY_TEACHING: {{ .Values.smash.peanutRaspberryTeaching | quote }}
  PRIVATE_PAIN_SWIVEL: {{ .Values.smash.privatePainSwivel | quote }}
  RED: {{ .Values.smash.red | quote }}
  SPLIT_SATIN: {{ .Values.smash.splitSatin | quote }}
  TRACKING: {{ .Values.smash.tracking | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "smash.fullname" . }}-smash
  labels:
  {{- include "smash.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: smash
spec:
  replicas: {{ .Values.smash.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: smash
      app.kubernetes.io/name: ape
    {{- include "smash.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: smash
        app.kubernetes.io/name: ape
      {{- include "smash.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: eee2fef792a90b2d8e156facc343239c05a2539c931d4bd7c23ca1b204c34a70
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "smash.fullname" . }}-smash
        image: {{ .Values.smash.smash.image.repository }}:{{ .Values.smash.smash.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.smash.smash.imagePullPolicy }}
        name: smash
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.smash.smash.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.smash.smash.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "smash.fullname" . }}-smash
  labels:
  {{- include "smash.labels" . | nindent 4 }}
spec:
  type: {{ .Values.smash.type }}
  selector:
    app.kubernetes.io/instance: smash
    app.kubernetes.io/name: ape
  {{- include "smash.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.smash.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
smash:
  blogger: motor
  carbohydrateHeritage: interaction
  escapeHandsomePenicillin: eyestrain
  hubcapBass: sleepy
  moose: entertain
  nieceTrialSnore: vigorous
  peanutRaspberryTeaching: cameo
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  privatePainSwivel: cheek
  red: utopian
  replicas: 1
  smash:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  splitSatin: pressurisation
  tracking: yak
  type: ClusterIP
