# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "contact.fullname" . }}-contact
  labels:
  {{- include "contact.labels" . | nindent 4 }}
data:
  ACCELERATE_HEALTH_TELL: {{ .Values.contact.accelerateHealthTell | quote }}
  APPROVAL_TRADING: {{ .Values.contact.approvalTrading | quote }}
  AROMATIC_RIDER: {{ .Values.contact.aromaticRider | quote }}
  FENNEL_APP: {{ .Values.contact.fennelApp | quote }}
  GANDER_CIRCUMSTANCE_LANDFORM: {{ .Values.contact.ganderCircumstanceLandform | quote
    }}
  GIG: {{ .Values.contact.gig | quote }}
  MEDIUM_SNUCK_FORAGER: {{ .Values.contact.mediumSnuckForager | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "contact.fullname" . }}-contact
  labels:
  {{- include "contact.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: contact
spec:
  replicas: {{ .Values.contact.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: contact
      app.kubernetes.io/name: music-box
    {{- include "contact.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: contact
        app.kubernetes.io/name: music-box
      {{- include "contact.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 7e76a170745d919644ee438da39a869de51e043c5755b97c25a0da7c75408b2b
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "contact.fullname" . }}-contact
        image: {{ .Values.contact.contact.image.repository }}:{{ .Values.contact.contact.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.contact.contact.imagePullPolicy }}
        name: contact
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.contact.contact.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.contact.contact.containerSecurityContext |
          nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "contact.fullname" . }}-contact
  labels:
  {{- include "contact.labels" . | nindent 4 }}
spec:
  type: {{ .Values.contact.type }}
  selector:
    app.kubernetes.io/instance: contact
    app.kubernetes.io/name: music-box
  {{- include "contact.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.contact.ports | toYaml | nindent 2 -}}
contact:
  accelerateHealthTell: recorder
  approvalTrading: spank
  aromaticRider: relation
  contact:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  fennelApp: tandem
  ganderCircumstanceLandform: beck
  gig: tiresome
  mediumSnuckForager: kiosk
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  type: ClusterIP
kubernetesClusterDomain: cluster.local
