# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "marketer.fullname" . }}-marketer
  labels:
  {{- include "marketer.labels" . | nindent 4 }}
data:
  ARITHMETIC: {{ .Values.marketer.arithmetic | quote }}
  HAMMER_DOCTRINE_POLICY: {{ .Values.marketer.hammerDoctrinePolicy | quote }}
  HANDGUN: {{ .Values.marketer.handgun | quote }}
  HYGIENIC: {{ .Values.marketer.hygienic | quote }}
  INCISION_OBJECT_SIGNIFY: {{ .Values.marketer.incisionObjectSignify | quote }}
  KITSCH_ALUMINUM_WINDSCREEN: {{ .Values.marketer.kitschAluminumWindscreen | quote
    }}
  MAESTRO_CREATOR: {{ .Values.marketer.maestroCreator | quote }}
  PATTY_LAYER_TABLET: {{ .Values.marketer.pattyLayerTablet | quote }}
  RECEPTIVE_HOUSE_SPARROW: {{ .Values.marketer.receptiveHouseSparrow | quote }}
  SINCERE: {{ .Values.marketer.sincere | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "marketer.fullname" . }}-marketer
  labels:
  {{- include "marketer.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: marketer
spec:
  replicas: {{ .Values.marketer.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: marketer
      app.kubernetes.io/name: nectar
    {{- include "marketer.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: marketer
        app.kubernetes.io/name: nectar
      {{- include "marketer.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 1c5107cbf26d174b7d866d91ffdeabc91af5010f46e8f55518ee7aae03208755
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "marketer.fullname" . }}-marketer
        image: {{ .Values.marketer.marketer.image.repository }}:{{ .Values.marketer.marketer.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.marketer.marketer.imagePullPolicy }}
        name: marketer
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.marketer.marketer.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.marketer.marketer.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "marketer.fullname" . }}-marketer
  labels:
  {{- include "marketer.labels" . | nindent 4 }}
spec:
  type: {{ .Values.marketer.type }}
  selector:
    app.kubernetes.io/instance: marketer
    app.kubernetes.io/name: nectar
  {{- include "marketer.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.marketer.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
marketer:
  arithmetic: nightlife
  hammerDoctrinePolicy: barium
  handgun: essential
  hygienic: unequaled
  incisionObjectSignify: impostor
  kitschAluminumWindscreen: gale
  maestroCreator: platinum
  marketer:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  pattyLayerTablet: flint
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  receptiveHouseSparrow: mattress
  replicas: 1
  sincere: reporting
  type: ClusterIP
