# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "propaganda.fullname" . }}-propaganda
  labels:
  {{- include "propaganda.labels" . | nindent 4 }}
data:
  BOW: {{ .Values.propaganda.bow | quote }}
  KALE: {{ .Values.propaganda.kale | quote }}
  PULSE: {{ .Values.propaganda.pulse | quote }}
  ROYAL_TONALITY: {{ .Values.propaganda.royalTonality | quote }}
  TRILLION: {{ .Values.propaganda.trillion | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "propaganda.fullname" . }}-propaganda
  labels:
  {{- include "propaganda.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: propaganda
spec:
  replicas: {{ .Values.propaganda.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: propaganda
      app.kubernetes.io/name: desire
    {{- include "propaganda.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: propaganda
        app.kubernetes.io/name: desire
      {{- include "propaganda.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: c05be6aa1f98530915b61bb8c62f98a1e03ffed9b45b17ffb8be96700193f170
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "propaganda.fullname" . }}-propaganda
        image: {{ .Values.propaganda.propaganda.image.repository }}:{{ .Values.propaganda.propaganda.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.propaganda.propaganda.imagePullPolicy }}
        name: propaganda
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.propaganda.propaganda.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.propaganda.propaganda.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "propaganda.fullname" . }}-propaganda
  labels:
  {{- include "propaganda.labels" . | nindent 4 }}
spec:
  type: {{ .Values.propaganda.type }}
  selector:
    app.kubernetes.io/instance: propaganda
    app.kubernetes.io/name: desire
  {{- include "propaganda.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.propaganda.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
propaganda:
  bow: washcloth
  kale: shape
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  propaganda:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  pulse: phase
  replicas: 1
  royalTonality: necessity
  trillion: heap
  type: ClusterIP
