# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "saucer.fullname" . }}-saucer
  labels:
  {{- include "saucer.labels" . | nindent 4 }}
data:
  BAOBAB_WHOLESALER_ASSAULT: {{ .Values.saucer.baobabWholesalerAssault | quote }}
  CREATIONISM: {{ .Values.saucer.creationism | quote }}
  EPAULIERE_HELICOPTER_PRIVILEGE: {{ .Values.saucer.epauliereHelicopterPrivilege
    | quote }}
  LIME_ACCELERATE_DECREASE: {{ .Values.saucer.limeAccelerateDecrease | quote }}
  MUSKRAT_NYLON: {{ .Values.saucer.muskratNylon | quote }}
  SOFTWARE: {{ .Values.saucer.software | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "saucer.fullname" . }}-saucer
  labels:
  {{- include "saucer.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: saucer
spec:
  replicas: {{ .Values.saucer.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: saucer
      app.kubernetes.io/name: center
    {{- include "saucer.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: saucer
        app.kubernetes.io/name: center
      {{- include "saucer.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 6297948e756ae4e75c76057eb2294c7d5ff17a5b5ed49e6e4ec2bb29ca462986
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "saucer.fullname" . }}-saucer
        image: {{ .Values.saucer.saucer.image.repository }}:{{ .Values.saucer.saucer.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.saucer.saucer.imagePullPolicy }}
        name: saucer
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.saucer.saucer.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.saucer.saucer.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "saucer.fullname" . }}-saucer
  labels:
  {{- include "saucer.labels" . | nindent 4 }}
spec:
  type: {{ .Values.saucer.type }}
  selector:
    app.kubernetes.io/instance: saucer
    app.kubernetes.io/name: center
  {{- include "saucer.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.saucer.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
saucer:
  baobabWholesalerAssault: merchandise
  creationism: hair
  epauliereHelicopterPrivilege: smelly
  limeAccelerateDecrease: catch
  muskratNylon: trader
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  saucer:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  software: leaver
  type: ClusterIP
