# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "cadet.fullname" . }}-cadet
  labels:
  {{- include "cadet.labels" . | nindent 4 }}
data:
  EATING: {{ .Values.cadet.eating | quote }}
  EFFICIENCY_CENTURY: {{ .Values.cadet.efficiencyCentury | quote }}
  HARMONY_ANCHOVY: {{ .Values.cadet.harmonyAnchovy | quote }}
  ISSUE_PROSTACYCLIN_POUCH: {{ .Values.cadet.issueProstacyclinPouch | quote }}
  PREPARATION_CASCADE: {{ .Values.cadet.preparationCascade | quote }}
  REALIZE_WHISPER_PISTOL: {{ .Values.cadet.realizeWhisperPistol | quote }}
  SPADE_WANDERING: {{ .Values.cadet.spadeWandering | quote }}
  TACKLE_PRINTING: {{ .Values.cadet.tacklePrinting | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "cadet.fullname" . }}-cadet
  labels:
  {{- include "cadet.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: cadet
spec:
  replicas: {{ .Values.cadet.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: cadet
      app.kubernetes.io/name: cat
    {{- include "cadet.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: cadet
        app.kubernetes.io/name: cat
      {{- include "cadet.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: be896e9d235fe068212758dc091006c1cc05a3dc9ec3f36f1ac124ce7f6325ad
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "cadet.fullname" . }}-cadet
        image: {{ .Values.cadet.cadet.image.repository }}:{{ .Values.cadet.cadet.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.cadet.cadet.imagePullPolicy }}
        name: cadet
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.cadet.cadet.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.cadet.cadet.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "cadet.fullname" . }}-cadet
  labels:
  {{- include "cadet.labels" . | nindent 4 }}
spec:
  type: {{ .Values.cadet.type }}
  selector:
    app.kubernetes.io/instance: cadet
    app.kubernetes.io/name: cat
  {{- include "cadet.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.cadet.ports | toYaml | nindent 2 -}}
cadet:
  cadet:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  eating: beating
  efficiencyCentury: prescription
  harmonyAnchovy: helpful
  issueProstacyclinPouch: literate
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  preparationCascade: bandolier
  realizeWhisperPistol: make
  replicas: 1
  spadeWandering: deviation
  tacklePrinting: epoch
  type: ClusterIP
kubernetesClusterDomain: cluster.local
