# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "domineering.fullname" . }}-domineering
  labels:
  {{- include "domineering.labels" . | nindent 4 }}
data:
  DIRECTOR_WESTERN_STORM: {{ .Values.domineering.directorWesternStorm | quote }}
  MAT: {{ .Values.domineering.mat | quote }}
  SKIN_PLAUSIBLE: {{ .Values.domineering.skinPlausible | quote }}
  TENT: {{ .Values.domineering.tent | quote }}
  TINY_STORAGE_INCLUSION: {{ .Values.domineering.tinyStorageInclusion | quote }}
  WARN: {{ .Values.domineering.warn | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "domineering.fullname" . }}-domineering
  labels:
  {{- include "domineering.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: domineering
spec:
  replicas: {{ .Values.domineering.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: domineering
      app.kubernetes.io/name: correspondent
    {{- include "domineering.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: domineering
        app.kubernetes.io/name: correspondent
      {{- include "domineering.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 2f51b7b9a1350f3557f5336662d638a5bed41858b1a8ad0da2a270f6287bad0c
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "domineering.fullname" . }}-domineering
        image: {{ .Values.domineering.domineering.image.repository }}:{{ .Values.domineering.domineering.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.domineering.domineering.imagePullPolicy }}
        name: domineering
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.domineering.domineering.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.domineering.domineering.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "domineering.fullname" . }}-domineering
  labels:
  {{- include "domineering.labels" . | nindent 4 }}
spec:
  type: {{ .Values.domineering.type }}
  selector:
    app.kubernetes.io/instance: domineering
    app.kubernetes.io/name: correspondent
  {{- include "domineering.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.domineering.ports | toYaml | nindent 2 -}}
domineering:
  directorWesternStorm: tsunami
  domineering:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  mat: collagen
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  skinPlausible: participation
  tent: plastic
  tinyStorageInclusion: shopping
  type: ClusterIP
  warn: sugar
kubernetesClusterDomain: cluster.local
