# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "soft.fullname" . }}-soft
  labels:
  {{- include "soft.labels" . | nindent 4 }}
data:
  CARPENTER_STORY: {{ .Values.soft.carpenterStory | quote }}
  DECLARATION_TENSE: {{ .Values.soft.declarationTense | quote }}
  FENG: {{ .Values.soft.feng | quote }}
  GROUCHY_SERIAL_FLUGELHORN: {{ .Values.soft.grouchySerialFlugelhorn | quote }}
  PHYSIOLOGY_DIMENSION_MISCARRIAGE: {{ .Values.soft.physiologyDimensionMiscarriage
    | quote }}
  SESSION: {{ .Values.soft.session | quote }}
  VIABILITY_AUTOMATON_MIGHT: {{ .Values.soft.viabilityAutomatonMight | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "soft.fullname" . }}-soft
  labels:
  {{- include "soft.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: soft
spec:
  replicas: {{ .Values.soft.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: soft
      app.kubernetes.io/name: tomb
    {{- include "soft.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: soft
        app.kubernetes.io/name: tomb
      {{- include "soft.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 0f64936ef316d3b45b31929d8cc8d95064f9c107b8a485a77fe248e813ed31eb
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "soft.fullname" . }}-soft
        image: {{ .Values.soft.soft.image.repository }}:{{ .Values.soft.soft.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.soft.soft.imagePullPolicy }}
        name: soft
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.soft.soft.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.soft.soft.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "soft.fullname" . }}-soft
  labels:
  {{- include "soft.labels" . | nindent 4 }}
spec:
  type: {{ .Values.soft.type }}
  selector:
    app.kubernetes.io/instance: soft
    app.kubernetes.io/name: tomb
  {{- include "soft.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.soft.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
soft:
  carpenterStory: bartender
  declarationTense: corsage
  feng: yurt
  grouchySerialFlugelhorn: flesh
  physiologyDimensionMiscarriage: feast
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  session: spit
  soft:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  type: ClusterIP
  viabilityAutomatonMight: midnight
