# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "jail.fullname" . }}-jail
  labels:
  {{- include "jail.labels" . | nindent 4 }}
data:
  CACAO_COLLECTOR: {{ .Values.jail.cacaoCollector | quote }}
  CITRUS_EXTENT: {{ .Values.jail.citrusExtent | quote }}
  COMIC: {{ .Values.jail.comic | quote }}
  CONVICTION_COMMAND_CAVIAR: {{ .Values.jail.convictionCommandCaviar | quote }}
  DYNASTY: {{ .Values.jail.dynasty | quote }}
  FORMICARIUM_DRAWER_PANCREAS: {{ .Values.jail.formicariumDrawerPancreas | quote
    }}
  INVOICE: {{ .Values.jail.invoice | quote }}
  SHED_SCRAPER: {{ .Values.jail.shedScraper | quote }}
  SUPREME_PUDDLE_BRUSHING: {{ .Values.jail.supremePuddleBrushing | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "jail.fullname" . }}-jail
  labels:
  {{- include "jail.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: jail
spec:
  replicas: {{ .Values.jail.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: jail
      app.kubernetes.io/name: confidentiality
    {{- include "jail.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: jail
        app.kubernetes.io/name: confidentiality
      {{- include "jail.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 752a01ecbd52a843078fa284c742dd44230e9bd9b891bc1e1e20d5ddae59ff4a
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "jail.fullname" . }}-jail
        image: {{ .Values.jail.jail.image.repository }}:{{ .Values.jail.jail.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.jail.jail.imagePullPolicy }}
        name: jail
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.jail.jail.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.jail.jail.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "jail.fullname" . }}-jail
  labels:
  {{- include "jail.labels" . | nindent 4 }}
spec:
  type: {{ .Values.jail.type }}
  selector:
    app.kubernetes.io/instance: jail
    app.kubernetes.io/name: confidentiality
  {{- include "jail.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.jail.ports | toYaml | nindent 2 -}}
jail:
  cacaoCollector: macro
  citrusExtent: cardigan
  comic: willingness
  convictionCommandCaviar: awareness
  dynasty: practitioner
  formicariumDrawerPancreas: spend
  invoice: disruption
  jail:
    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
  shedScraper: idiom
  supremePuddleBrushing: disclosure
  type: ClusterIP
kubernetesClusterDomain: cluster.local
