# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "alligator.fullname" . }}-alligator
  labels:
  {{- include "alligator.labels" . | nindent 4 }}
data:
  COMPREHENSION_LAD: {{ .Values.alligator.comprehensionLad | quote }}
  PEAR_BABUSHKA: {{ .Values.alligator.pearBabushka | quote }}
  PRESSROOM_BLINKER: {{ .Values.alligator.pressroomBlinker | quote }}
  SNAKE_PLACEBO_HONESTY: {{ .Values.alligator.snakePlaceboHonesty | quote }}
  SNAKEBITE: {{ .Values.alligator.snakebite | quote }}
  TOURIST: {{ .Values.alligator.tourist | quote }}
  VALENTINE: {{ .Values.alligator.valentine | quote }}
  WALKING: {{ .Values.alligator.walking | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "alligator.fullname" . }}-alligator
  labels:
  {{- include "alligator.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: alligator
spec:
  replicas: {{ .Values.alligator.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: alligator
      app.kubernetes.io/name: symptom
    {{- include "alligator.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: alligator
        app.kubernetes.io/name: symptom
      {{- include "alligator.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: d43777656f1ff36e7fbf3bedd01a95954a7d98a1d74680ea433bbeda1a16b7af
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "alligator.fullname" . }}-alligator
        image: {{ .Values.alligator.alligator.image.repository }}:{{ .Values.alligator.alligator.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.alligator.alligator.imagePullPolicy }}
        name: alligator
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.alligator.alligator.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.alligator.alligator.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "alligator.fullname" . }}-alligator
  labels:
  {{- include "alligator.labels" . | nindent 4 }}
spec:
  type: {{ .Values.alligator.type }}
  selector:
    app.kubernetes.io/instance: alligator
    app.kubernetes.io/name: symptom
  {{- include "alligator.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.alligator.ports | toYaml | nindent 2 -}}
alligator:
  alligator:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  comprehensionLad: doggie
  pearBabushka: caffeine
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  pressroomBlinker: hollow
  replicas: 1
  snakePlaceboHonesty: wide-eyed
  snakebite: stable
  tourist: empowerment
  type: ClusterIP
  valentine: spice
  walking: assist
kubernetesClusterDomain: cluster.local
