# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "tax.fullname" . }}-tax
  labels:
  {{- include "tax.labels" . | nindent 4 }}
data:
  ATTIC_MERCIFUL: {{ .Values.tax.atticMerciful | quote }}
  CHEMISTRY_MOSQUITO: {{ .Values.tax.chemistryMosquito | quote }}
  PROPHET: {{ .Values.tax.prophet | quote }}
  TAKEOVER_MANTLE: {{ .Values.tax.takeoverMantle | quote }}
  TOURNAMENT_ROOMY: {{ .Values.tax.tournamentRoomy | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "tax.fullname" . }}-tax
  labels:
  {{- include "tax.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: tax
spec:
  replicas: {{ .Values.tax.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: tax
      app.kubernetes.io/name: reproduce
    {{- include "tax.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: tax
        app.kubernetes.io/name: reproduce
      {{- include "tax.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: e1695002e97378641074326b107ccb78a09cffd6ccec1f0a9189ccc963fecd77
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "tax.fullname" . }}-tax
        image: {{ .Values.tax.tax.image.repository }}:{{ .Values.tax.tax.image.tag | default
          .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.tax.tax.imagePullPolicy }}
        name: tax
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.tax.tax.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.tax.tax.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "tax.fullname" . }}-tax
  labels:
  {{- include "tax.labels" . | nindent 4 }}
spec:
  type: {{ .Values.tax.type }}
  selector:
    app.kubernetes.io/instance: tax
    app.kubernetes.io/name: reproduce
  {{- include "tax.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.tax.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
tax:
  atticMerciful: music-box
  chemistryMosquito: monopoly
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  prophet: promise
  replicas: 1
  takeoverMantle: subtract
  tax:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  tournamentRoomy: reach
  type: ClusterIP
