# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "class.fullname" . }}-class
  labels:
  {{- include "class.labels" . | nindent 4 }}
data:
  ANGSTROM_MAJOR: {{ .Values.class.angstromMajor | quote }}
  ARCHITECT: {{ .Values.class.architect | quote }}
  ELK: {{ .Values.class.elk | quote }}
  FEDELINI_COMMERCE_CAPITAL: {{ .Values.class.fedeliniCommerceCapital | quote }}
  FOAMY_GROAN: {{ .Values.class.foamyGroan | quote }}
  TREATMENT_FRONTIER_COTTAGE: {{ .Values.class.treatmentFrontierCottage | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "class.fullname" . }}-class
  labels:
  {{- include "class.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: class
spec:
  replicas: {{ .Values.class.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: class
      app.kubernetes.io/name: enquiry
    {{- include "class.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: class
        app.kubernetes.io/name: enquiry
      {{- include "class.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 0f0a03509746d288bfa2b402ad470095572f045b9ad84f82c25ee0869d53f324
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "class.fullname" . }}-class
        image: {{ .Values.class.class.image.repository }}:{{ .Values.class.class.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.class.class.imagePullPolicy }}
        name: class
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.class.class.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.class.class.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "class.fullname" . }}-class
  labels:
  {{- include "class.labels" . | nindent 4 }}
spec:
  type: {{ .Values.class.type }}
  selector:
    app.kubernetes.io/instance: class
    app.kubernetes.io/name: enquiry
  {{- include "class.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.class.ports | toYaml | nindent 2 -}}
class:
  angstromMajor: trial
  architect: circadian
  class:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  elk: precision
  fedeliniCommerceCapital: biosphere
  foamyGroan: audience
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  treatmentFrontierCottage: spokeswoman
  type: ClusterIP
kubernetesClusterDomain: cluster.local
