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