# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "attain.fullname" . }}-attain
  labels:
  {{- include "attain.labels" . | nindent 4 }}
data:
  COUNTY_CURLER_MORPHOLOGY: {{ .Values.attain.countyCurlerMorphology | quote }}
  FROWN_DENTIST: {{ .Values.attain.frownDentist | quote }}
  UNDRESS_ROBOT_ARBITRATE: {{ .Values.attain.undressRobotArbitrate | quote }}
  ZEPHYR_FONDUE: {{ .Values.attain.zephyrFondue | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "attain.fullname" . }}-attain
  labels:
  {{- include "attain.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: attain
spec:
  replicas: {{ .Values.attain.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: attain
      app.kubernetes.io/name: tinkle
    {{- include "attain.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: attain
        app.kubernetes.io/name: tinkle
      {{- include "attain.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: d2e20584fe06f9ef2ddfcd4f3e570c35b91152ff04bd6fe20c1a739154f215b5
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "attain.fullname" . }}-attain
        image: {{ .Values.attain.attain.image.repository }}:{{ .Values.attain.attain.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.attain.attain.imagePullPolicy }}
        name: attain
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.attain.attain.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.attain.attain.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "attain.fullname" . }}-attain
  labels:
  {{- include "attain.labels" . | nindent 4 }}
spec:
  type: {{ .Values.attain.type }}
  selector:
    app.kubernetes.io/instance: attain
    app.kubernetes.io/name: tinkle
  {{- include "attain.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.attain.ports | toYaml | nindent 2 -}}
attain:
  attain:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  countyCurlerMorphology: pajamas
  frownDentist: spread
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  type: ClusterIP
  undressRobotArbitrate: valentine
  zephyrFondue: election
kubernetesClusterDomain: cluster.local
