# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "gale.fullname" . }}-gale
  labels:
  {{- include "gale.labels" . | nindent 4 }}
data:
  APPETIZER_FLEDGLING: {{ .Values.gale.appetizerFledgling | quote }}
  MANATEE: {{ .Values.gale.manatee | quote }}
  MONOPOLY_ARCH: {{ .Values.gale.monopolyArch | quote }}
  POUND_BUMPY_PROTECTIVE: {{ .Values.gale.poundBumpyProtective | quote }}
  RUNAWAY_STICKER_POCKET: {{ .Values.gale.runawayStickerPocket | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "gale.fullname" . }}-gale
  labels:
  {{- include "gale.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: gale
spec:
  replicas: {{ .Values.gale.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: gale
      app.kubernetes.io/name: knot
    {{- include "gale.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: gale
        app.kubernetes.io/name: knot
      {{- include "gale.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: f3516b13d2aa8fb3fa282ac895021d813dd8e58dce1edc54facc181ea890264b
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "gale.fullname" . }}-gale
        image: {{ .Values.gale.gale.image.repository }}:{{ .Values.gale.gale.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.gale.gale.imagePullPolicy }}
        name: gale
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.gale.gale.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.gale.gale.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "gale.fullname" . }}-gale
  labels:
  {{- include "gale.labels" . | nindent 4 }}
spec:
  type: {{ .Values.gale.type }}
  selector:
    app.kubernetes.io/instance: gale
    app.kubernetes.io/name: knot
  {{- include "gale.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.gale.ports | toYaml | nindent 2 -}}
gale:
  appetizerFledgling: cloudburst
  gale:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  manatee: controversy
  monopolyArch: marten
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  poundBumpyProtective: melted
  replicas: 1
  runawayStickerPocket: gasket
  type: ClusterIP
kubernetesClusterDomain: cluster.local
