# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "headphones.fullname" . }}-headphones
  labels:
  {{- include "headphones.labels" . | nindent 4 }}
data:
  BATTER: {{ .Values.headphones.batter | quote }}
  CLIENT: {{ .Values.headphones.client | quote }}
  COORDINATION_BRASS_BOOTEE: {{ .Values.headphones.coordinationBrassBootee | quote
    }}
  DEBATE_MAPLE: {{ .Values.headphones.debateMaple | quote }}
  HANG: {{ .Values.headphones.hang | quote }}
  PRODUCTIVE_WASTEBASKET: {{ .Values.headphones.productiveWastebasket | quote }}
  STICKER_REPRESENT: {{ .Values.headphones.stickerRepresent | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "headphones.fullname" . }}-headphones
  labels:
  {{- include "headphones.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: headphones
spec:
  replicas: {{ .Values.headphones.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: headphones
      app.kubernetes.io/name: disguise
    {{- include "headphones.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: headphones
        app.kubernetes.io/name: disguise
      {{- include "headphones.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 1a3ce9f13df1417558f80f06be7fcaa77ae079064c0d2bb97ee21d89158454ff
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "headphones.fullname" . }}-headphones
        image: {{ .Values.headphones.headphones.image.repository }}:{{ .Values.headphones.headphones.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.headphones.headphones.imagePullPolicy }}
        name: headphones
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.headphones.headphones.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.headphones.headphones.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "headphones.fullname" . }}-headphones
  labels:
  {{- include "headphones.labels" . | nindent 4 }}
spec:
  type: {{ .Values.headphones.type }}
  selector:
    app.kubernetes.io/instance: headphones
    app.kubernetes.io/name: disguise
  {{- include "headphones.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.headphones.ports | toYaml | nindent 2 -}}
headphones:
  batter: freedom
  client: volleyball
  coordinationBrassBootee: lounge
  debateMaple: estrogen
  hang: emitter
  headphones:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  productiveWastebasket: proceedings
  replicas: 1
  stickerRepresent: appetizer
  type: ClusterIP
kubernetesClusterDomain: cluster.local
