# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "attract.fullname" . }}-attract
  labels:
  {{- include "attract.labels" . | nindent 4 }}
data:
  ARMOIRE: {{ .Values.attract.armoire | quote }}
  CARBOXYL_SUBSEQUENT: {{ .Values.attract.carboxylSubsequent | quote }}
  CONTRARY_WARLOCK: {{ .Values.attract.contraryWarlock | quote }}
  FARM_DEAREST_AUDIENCE: {{ .Values.attract.farmDearestAudience | quote }}
  HEARING_FAMILY: {{ .Values.attract.hearingFamily | quote }}
  LEG_PATIO_GLOCKENSPIEL: {{ .Values.attract.legPatioGlockenspiel | quote }}
  RAISIN: {{ .Values.attract.raisin | quote }}
  SEAWEED: {{ .Values.attract.seaweed | quote }}
  SUBSIDY: {{ .Values.attract.subsidy | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "attract.fullname" . }}-attract
  labels:
  {{- include "attract.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: attract
spec:
  replicas: {{ .Values.attract.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: attract
      app.kubernetes.io/name: overload
    {{- include "attract.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: attract
        app.kubernetes.io/name: overload
      {{- include "attract.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: c6adfe3ab197c354c2f431f876047141a50dd6a12ee1c79764ba087103d56ea3
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "attract.fullname" . }}-attract
        image: {{ .Values.attract.attract.image.repository }}:{{ .Values.attract.attract.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.attract.attract.imagePullPolicy }}
        name: attract
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.attract.attract.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.attract.attract.containerSecurityContext |
          nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "attract.fullname" . }}-attract
  labels:
  {{- include "attract.labels" . | nindent 4 }}
spec:
  type: {{ .Values.attract.type }}
  selector:
    app.kubernetes.io/instance: attract
    app.kubernetes.io/name: overload
  {{- include "attract.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.attract.ports | toYaml | nindent 2 -}}
attract:
  armoire: kilt
  attract:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  carboxylSubsequent: acrylic
  contraryWarlock: tights
  farmDearestAudience: vampire
  hearingFamily: headrest
  legPatioGlockenspiel: dividend
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  raisin: athlete
  replicas: 1
  seaweed: slipper
  subsidy: risk
  type: ClusterIP
kubernetesClusterDomain: cluster.local
