# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "mailing.fullname" . }}-mailing
  labels:
  {{- include "mailing.labels" . | nindent 4 }}
data:
  BRUSHING: {{ .Values.mailing.brushing | quote }}
  ESTROGEN_LANDFORM: {{ .Values.mailing.estrogenLandform | quote }}
  HAIRCUT_BLEED: {{ .Values.mailing.haircutBleed | quote }}
  OVERCONFIDENT_RESEARCH_PRIESTHOOD: {{ .Values.mailing.overconfidentResearchPriesthood
    | quote }}
  OZONE_CRANE_RELIEVED: {{ .Values.mailing.ozoneCraneRelieved | quote }}
  PROMOTE_TUNIC_FOREST: {{ .Values.mailing.promoteTunicForest | quote }}
  PROTECTIVE_SNOWSTORM: {{ .Values.mailing.protectiveSnowstorm | quote }}
  WEAR_RUBY_HALF: {{ .Values.mailing.wearRubyHalf | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "mailing.fullname" . }}-mailing
  labels:
  {{- include "mailing.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: mailing
spec:
  replicas: {{ .Values.mailing.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: mailing
      app.kubernetes.io/name: settle
    {{- include "mailing.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: mailing
        app.kubernetes.io/name: settle
      {{- include "mailing.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: a1c3cf5f3c18b9f3e946b7157005889e296d1a10ec804b957edb2fe77cdc8851
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "mailing.fullname" . }}-mailing
        image: {{ .Values.mailing.mailing.image.repository }}:{{ .Values.mailing.mailing.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.mailing.mailing.imagePullPolicy }}
        name: mailing
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.mailing.mailing.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.mailing.mailing.containerSecurityContext |
          nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "mailing.fullname" . }}-mailing
  labels:
  {{- include "mailing.labels" . | nindent 4 }}
spec:
  type: {{ .Values.mailing.type }}
  selector:
    app.kubernetes.io/instance: mailing
    app.kubernetes.io/name: settle
  {{- include "mailing.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.mailing.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
mailing:
  brushing: government
  estrogenLandform: quinoa
  haircutBleed: cat
  mailing:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  overconfidentResearchPriesthood: situation
  ozoneCraneRelieved: pronoun
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  promoteTunicForest: decryption
  protectiveSnowstorm: ink
  replicas: 1
  type: ClusterIP
  wearRubyHalf: kendo
