# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "pit.fullname" . }}-pit
  labels:
  {{- include "pit.labels" . | nindent 4 }}
data:
  COUNTER-FORCE_ITCH_TOURISM: {{ .Values.pit.counterForceItchTourism | quote }}
  VELDT_EVOCATION: {{ .Values.pit.veldtEvocation | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "pit.fullname" . }}-pit
  labels:
  {{- include "pit.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: pit
spec:
  replicas: {{ .Values.pit.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: pit
      app.kubernetes.io/name: cast
    {{- include "pit.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: pit
        app.kubernetes.io/name: cast
      {{- include "pit.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 52bc7e06a9f59f5e3c70eed14a685329c103ca66cbbcf9e20cad12bd7f32cb05
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "pit.fullname" . }}-pit
        image: {{ .Values.pit.pit.image.repository }}:{{ .Values.pit.pit.image.tag | default
          .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.pit.pit.imagePullPolicy }}
        name: pit
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.pit.pit.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.pit.pit.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "pit.fullname" . }}-pit
  labels:
  {{- include "pit.labels" . | nindent 4 }}
spec:
  type: {{ .Values.pit.type }}
  selector:
    app.kubernetes.io/instance: pit
    app.kubernetes.io/name: cast
  {{- include "pit.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.pit.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
pit:
  counterForceItchTourism: bury
  pit:
    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
  replicas: 1
  type: ClusterIP
  veldtEvocation: participate
