# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "redirect.fullname" . }}-redirect
  labels:
  {{- include "redirect.labels" . | nindent 4 }}
data:
  COMMANDER_DANDELION_LIMESTONE: {{ .Values.redirect.commanderDandelionLimestone
    | quote }}
  CREME BRULEE_BARBECUE: {{ .Values.redirect.cremeBruleeBarbecue | quote }}
  ELIGIBILITY_GENERATE: {{ .Values.redirect.eligibilityGenerate | quote }}
  MARIACHI_ECHIDNA: {{ .Values.redirect.mariachiEchidna | quote }}
  MOAI: {{ .Values.redirect.moai | quote }}
  PRESS_HEADQUARTERS_MILKSHAKE: {{ .Values.redirect.pressHeadquartersMilkshake |
    quote }}
  SAINT_DEEP: {{ .Values.redirect.saintDeep | quote }}
  SMELTING_COUNCILPERSON: {{ .Values.redirect.smeltingCouncilperson | quote }}
  STRAIGHT: {{ .Values.redirect.straight | quote }}
  TUB_WINDOW: {{ .Values.redirect.tubWindow | quote }}
  VICTORY_OUTRIGGER_TAIL: {{ .Values.redirect.victoryOutriggerTail | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "redirect.fullname" . }}-redirect
  labels:
  {{- include "redirect.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: redirect
spec:
  replicas: {{ .Values.redirect.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: redirect
      app.kubernetes.io/name: stance
    {{- include "redirect.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: redirect
        app.kubernetes.io/name: stance
      {{- include "redirect.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 310d2e30e44565501db06bbcc3c874306446cbf081f7e855d9911b3bbb2d91c7
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "redirect.fullname" . }}-redirect
        image: {{ .Values.redirect.redirect.image.repository }}:{{ .Values.redirect.redirect.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.redirect.redirect.imagePullPolicy }}
        name: redirect
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.redirect.redirect.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.redirect.redirect.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "redirect.fullname" . }}-redirect
  labels:
  {{- include "redirect.labels" . | nindent 4 }}
spec:
  type: {{ .Values.redirect.type }}
  selector:
    app.kubernetes.io/instance: redirect
    app.kubernetes.io/name: stance
  {{- include "redirect.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.redirect.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
redirect:
  commanderDandelionLimestone: fiber
  cremeBruleeBarbecue: bran
  eligibilityGenerate: historical
  mariachiEchidna: gasket
  moai: pacemaker
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  pressHeadquartersMilkshake: velodrome
  redirect:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  replicas: 1
  saintDeep: deposition
  smeltingCouncilperson: stucco
  straight: coupon
  tubWindow: harpsichord
  type: ClusterIP
  victoryOutriggerTail: handwrite
