# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "step-son.fullname" . }}-step-son
  labels:
  {{- include "step-son.labels" . | nindent 4 }}
data:
  RECLINER_PARROT_ULTIMATUM: {{ .Values.stepSon.reclinerParrotUltimatum | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "step-son.fullname" . }}-step-son
  labels:
  {{- include "step-son.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: step-son
spec:
  replicas: {{ .Values.stepSon.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: step-son
      app.kubernetes.io/name: necessity
    {{- include "step-son.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: step-son
        app.kubernetes.io/name: necessity
      {{- include "step-son.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 7d6c12fb247fa9f1c0cf29516a4729877f57fbdd8096013f243d4bbdb93142c0
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "step-son.fullname" . }}-step-son
        image: {{ .Values.stepSon.stepSon.image.repository }}:{{ .Values.stepSon.stepSon.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.stepSon.stepSon.imagePullPolicy }}
        name: step-son
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.stepSon.stepSon.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.stepSon.stepSon.containerSecurityContext |
          nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "step-son.fullname" . }}-step-son
  labels:
  {{- include "step-son.labels" . | nindent 4 }}
spec:
  type: {{ .Values.stepSon.type }}
  selector:
    app.kubernetes.io/instance: step-son
    app.kubernetes.io/name: necessity
  {{- include "step-son.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.stepSon.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
stepSon:
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  reclinerParrotUltimatum: sucker
  replicas: 1
  stepSon:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  type: ClusterIP
