# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "duel.fullname" . }}-duel
  labels:
  {{- include "duel.labels" . | nindent 4 }}
data:
  BANDWIDTH_TRAMP: {{ .Values.duel.bandwidthTramp | quote }}
  BANKING: {{ .Values.duel.banking | quote }}
  HEARING: {{ .Values.duel.hearing | quote }}
  INTELLIGENCE: {{ .Values.duel.intelligence | quote }}
  NOXIOUS_PEN_CAROTENE: {{ .Values.duel.noxiousPenCarotene | quote }}
  POSSIBILITY_UNDERWRITING: {{ .Values.duel.possibilityUnderwriting | quote }}
  PRINCIPLE_TAN: {{ .Values.duel.principleTan | quote }}
  SILENCE_SUSHI: {{ .Values.duel.silenceSushi | quote }}
  SUITE_BISCUIT_SPICY: {{ .Values.duel.suiteBiscuitSpicy | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "duel.fullname" . }}-duel
  labels:
  {{- include "duel.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: duel
spec:
  replicas: {{ .Values.duel.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: duel
      app.kubernetes.io/name: chess
    {{- include "duel.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: duel
        app.kubernetes.io/name: chess
      {{- include "duel.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 7e9e7e2f17817ea9a63ec88ce2115e5df81c06685b0db9cac82766e0c0e7dea9
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "duel.fullname" . }}-duel
        image: {{ .Values.duel.duel.image.repository }}:{{ .Values.duel.duel.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.duel.duel.imagePullPolicy }}
        name: duel
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.duel.duel.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.duel.duel.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "duel.fullname" . }}-duel
  labels:
  {{- include "duel.labels" . | nindent 4 }}
spec:
  type: {{ .Values.duel.type }}
  selector:
    app.kubernetes.io/instance: duel
    app.kubernetes.io/name: chess
  {{- include "duel.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.duel.ports | toYaml | nindent 2 -}}
duel:
  bandwidthTramp: puma
  banking: minor-league
  duel:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  hearing: snowplow
  intelligence: protocol
  noxiousPenCarotene: affiliate
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  possibilityUnderwriting: crib
  principleTan: microwave
  replicas: 1
  silenceSushi: subject
  suiteBiscuitSpicy: specify
  type: ClusterIP
kubernetesClusterDomain: cluster.local
