# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "caddy.fullname" . }}-caddy
  labels:
  {{- include "caddy.labels" . | nindent 4 }}
data:
  CENTURY_YAM_LOCKER: {{ .Values.caddy.centuryYamLocker | quote }}
  CREDENZA: {{ .Values.caddy.credenza | quote }}
  CUTE: {{ .Values.caddy.cute | quote }}
  DERRICK_WALLET_PORTRAIT: {{ .Values.caddy.derrickWalletPortrait | quote }}
  KINASE_NIFTY_RESEMBLANCE: {{ .Values.caddy.kinaseNiftyResemblance | quote }}
  PROBATION: {{ .Values.caddy.probation | quote }}
  STOCKINGS_STUMP_CLOUD: {{ .Values.caddy.stockingsStumpCloud | quote }}
  YELLOW_DISGUSTED: {{ .Values.caddy.yellowDisgusted | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "caddy.fullname" . }}-caddy
  labels:
  {{- include "caddy.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: caddy
spec:
  replicas: {{ .Values.caddy.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: caddy
      app.kubernetes.io/name: puffy
    {{- include "caddy.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: caddy
        app.kubernetes.io/name: puffy
      {{- include "caddy.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 4abf47dd6716fabaab0685a1849c0bb65515bbbc25c9d44fbb7a43b03ab1ba27
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "caddy.fullname" . }}-caddy
        image: {{ .Values.caddy.caddy.image.repository }}:{{ .Values.caddy.caddy.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.caddy.caddy.imagePullPolicy }}
        name: caddy
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.caddy.caddy.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.caddy.caddy.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "caddy.fullname" . }}-caddy
  labels:
  {{- include "caddy.labels" . | nindent 4 }}
spec:
  type: {{ .Values.caddy.type }}
  selector:
    app.kubernetes.io/instance: caddy
    app.kubernetes.io/name: puffy
  {{- include "caddy.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.caddy.ports | toYaml | nindent 2 -}}
caddy:
  caddy:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  centuryYamLocker: aircraft
  credenza: pantry
  cute: shadowbox
  derrickWalletPortrait: dealer
  kinaseNiftyResemblance: soccer
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  probation: result
  replicas: 1
  stockingsStumpCloud: digit
  type: ClusterIP
  yellowDisgusted: blushing
kubernetesClusterDomain: cluster.local
