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