# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "clinic.fullname" . }}-clinic
  labels:
  {{- include "clinic.labels" . | nindent 4 }}
data:
  DISTURBED_SETBACK_INTERPRETER: {{ .Values.clinic.disturbedSetbackInterpreter |
    quote }}
  FUR_MUSKRAT: {{ .Values.clinic.furMuskrat | quote }}
  GOAT_CASSOCK_YUMMY: {{ .Values.clinic.goatCassockYummy | quote }}
  PERFUME_THRIVE: {{ .Values.clinic.perfumeThrive | quote }}
  POPSICLE_HURDLE_UNIFORMITY: {{ .Values.clinic.popsicleHurdleUniformity | quote
    }}
  SHALLOT_FUTURE: {{ .Values.clinic.shallotFuture | quote }}
  SILO_PALACE: {{ .Values.clinic.siloPalace | quote }}
  THOUGHTFUL: {{ .Values.clinic.thoughtful | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "clinic.fullname" . }}-clinic
  labels:
  {{- include "clinic.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: clinic
spec:
  replicas: {{ .Values.clinic.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: clinic
      app.kubernetes.io/name: qualify
    {{- include "clinic.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: clinic
        app.kubernetes.io/name: qualify
      {{- include "clinic.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: d0a5ef90bac72531a414320995024261bfa3e34ddf28bb0ae6fd7e799f09f61c
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "clinic.fullname" . }}-clinic
        image: {{ .Values.clinic.clinic.image.repository }}:{{ .Values.clinic.clinic.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.clinic.clinic.imagePullPolicy }}
        name: clinic
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.clinic.clinic.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.clinic.clinic.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "clinic.fullname" . }}-clinic
  labels:
  {{- include "clinic.labels" . | nindent 4 }}
spec:
  type: {{ .Values.clinic.type }}
  selector:
    app.kubernetes.io/instance: clinic
    app.kubernetes.io/name: qualify
  {{- include "clinic.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.clinic.ports | toYaml | nindent 2 -}}
clinic:
  clinic:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  disturbedSetbackInterpreter: warden
  furMuskrat: dashboard
  goatCassockYummy: snobbish
  perfumeThrive: flax
  popsicleHurdleUniformity: smell
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  shallotFuture: uniformity
  siloPalace: tremble
  thoughtful: teach
  type: ClusterIP
kubernetesClusterDomain: cluster.local
