# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "tuition.fullname" . }}-tuition
  labels:
  {{- include "tuition.labels" . | nindent 4 }}
data:
  FLASH_OXYGEN: {{ .Values.tuition.flashOxygen | quote }}
  MOTORCYCLE_MAINSTREAM: {{ .Values.tuition.motorcycleMainstream | quote }}
  REASON: {{ .Values.tuition.reason | quote }}
  RISK: {{ .Values.tuition.risk | quote }}
  TOP-HAT_ENTER_FLAGRANT: {{ .Values.tuition.topHatEnterFlagrant | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "tuition.fullname" . }}-tuition
  labels:
  {{- include "tuition.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: tuition
spec:
  replicas: {{ .Values.tuition.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: tuition
      app.kubernetes.io/name: filthy
    {{- include "tuition.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: tuition
        app.kubernetes.io/name: filthy
      {{- include "tuition.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 51ab8e610bb01e5fce59563ae388121dfbcd167206f4086120c8e8a6e8e8a837
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "tuition.fullname" . }}-tuition
        image: {{ .Values.tuition.tuition.image.repository }}:{{ .Values.tuition.tuition.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.tuition.tuition.imagePullPolicy }}
        name: tuition
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.tuition.tuition.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.tuition.tuition.containerSecurityContext |
          nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "tuition.fullname" . }}-tuition
  labels:
  {{- include "tuition.labels" . | nindent 4 }}
spec:
  type: {{ .Values.tuition.type }}
  selector:
    app.kubernetes.io/instance: tuition
    app.kubernetes.io/name: filthy
  {{- include "tuition.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.tuition.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
tuition:
  flashOxygen: pupa
  motorcycleMainstream: prosecution
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  reason: remark
  replicas: 1
  risk: nicety
  topHatEnterFlagrant: stuff
  tuition:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  type: ClusterIP
