# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "discipline.fullname" . }}-discipline
  labels:
  {{- include "discipline.labels" . | nindent 4 }}
data:
  BARREL: {{ .Values.discipline.barrel | quote }}
  COW_CANNIBAL_CREW: {{ .Values.discipline.cowCannibalCrew | quote }}
  DWARF: {{ .Values.discipline.dwarf | quote }}
  MAINSTREAM_IMPOSTOR_GAZEBO: {{ .Values.discipline.mainstreamImpostorGazebo | quote
    }}
  NEON_SCIENTIFIC_INVESTOR: {{ .Values.discipline.neonScientificInvestor | quote
    }}
  SNUCK_ITINERARY: {{ .Values.discipline.snuckItinerary | quote }}
  TENSOR_HISTORIAN_CURVE: {{ .Values.discipline.tensorHistorianCurve | quote }}
  TUNIC_SECRETION_CURIO: {{ .Values.discipline.tunicSecretionCurio | quote }}
  VILLA_PROOFREAD_BATHER: {{ .Values.discipline.villaProofreadBather | quote }}
  WANDER_MONOPOLY: {{ .Values.discipline.wanderMonopoly | quote }}
  WING_ICEBERG_RECIPIENT: {{ .Values.discipline.wingIcebergRecipient | quote }}
  X-RAY: {{ .Values.discipline.xRay | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "discipline.fullname" . }}-discipline
  labels:
  {{- include "discipline.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: discipline
spec:
  replicas: {{ .Values.discipline.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: discipline
      app.kubernetes.io/name: notice
    {{- include "discipline.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: discipline
        app.kubernetes.io/name: notice
      {{- include "discipline.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 5ac2fa9264071d32b52e9b429f65a89a8ebf049ef211093079127b329fe278bc
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "discipline.fullname" . }}-discipline
        image: {{ .Values.discipline.discipline.image.repository }}:{{ .Values.discipline.discipline.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.discipline.discipline.imagePullPolicy }}
        name: discipline
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.discipline.discipline.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.discipline.discipline.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "discipline.fullname" . }}-discipline
  labels:
  {{- include "discipline.labels" . | nindent 4 }}
spec:
  type: {{ .Values.discipline.type }}
  selector:
    app.kubernetes.io/instance: discipline
    app.kubernetes.io/name: notice
  {{- include "discipline.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.discipline.ports | toYaml | nindent 2 -}}
discipline:
  barrel: exotic
  cowCannibalCrew: pilgrim
  discipline:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  dwarf: pour
  mainstreamImpostorGazebo: barracks
  neonScientificInvestor: armor
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  snuckItinerary: raisin
  tensorHistorianCurve: live
  tunicSecretionCurio: drab
  type: ClusterIP
  villaProofreadBather: employee
  wanderMonopoly: abrogation
  wingIcebergRecipient: rain
  xRay: junket
kubernetesClusterDomain: cluster.local
