# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "appointment.fullname" . }}-appointment
  labels:
  {{- include "appointment.labels" . | nindent 4 }}
data:
  BATTALION_BENEFICIARY_DASHBOARD: {{ .Values.appointment.battalionBeneficiaryDashboard
    | quote }}
  CHAP_DRAGONFRUIT: {{ .Values.appointment.chapDragonfruit | quote }}
  DESTINY_LOAD_RECONCILE: {{ .Values.appointment.destinyLoadReconcile | quote }}
  DROP_WASH: {{ .Values.appointment.dropWash | quote }}
  END: {{ .Values.appointment.end | quote }}
  INCUBATION: {{ .Values.appointment.incubation | quote }}
  PUBLICIZE_PRELUDE: {{ .Values.appointment.publicizePrelude | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "appointment.fullname" . }}-appointment
  labels:
  {{- include "appointment.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: appointment
spec:
  replicas: {{ .Values.appointment.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: appointment
      app.kubernetes.io/name: thankful
    {{- include "appointment.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: appointment
        app.kubernetes.io/name: thankful
      {{- include "appointment.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 4c65be55d82e98bfd60602fedfacac4ec3e5d3cd1c108b787e6e7826fc361d51
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "appointment.fullname" . }}-appointment
        image: {{ .Values.appointment.appointment.image.repository }}:{{ .Values.appointment.appointment.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.appointment.appointment.imagePullPolicy }}
        name: appointment
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.appointment.appointment.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.appointment.appointment.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "appointment.fullname" . }}-appointment
  labels:
  {{- include "appointment.labels" . | nindent 4 }}
spec:
  type: {{ .Values.appointment.type }}
  selector:
    app.kubernetes.io/instance: appointment
    app.kubernetes.io/name: thankful
  {{- include "appointment.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.appointment.ports | toYaml | nindent 2 -}}
appointment:
  appointment:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  battalionBeneficiaryDashboard: wait
  chapDragonfruit: aspect
  destinyLoadReconcile: travel
  dropWash: divide
  end: thunderbolt
  incubation: flash
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  publicizePrelude: sweep
  replicas: 1
  type: ClusterIP
kubernetesClusterDomain: cluster.local
