# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "bridge.fullname" . }}-bridge
  labels:
  {{- include "bridge.labels" . | nindent 4 }}
data:
  BULK_SYMMETRY_RECOMMEND: {{ .Values.bridge.bulkSymmetryRecommend | quote }}
  FEDERATION_PARAMEDIC_ASTROLOGY: {{ .Values.bridge.federationParamedicAstrology
    | quote }}
  FLICKER_CARTEL_INCANDESCENT: {{ .Values.bridge.flickerCartelIncandescent | quote
    }}
  MEADOW: {{ .Values.bridge.meadow | quote }}
  MILLENNIUM_CHAMPIONSHIP: {{ .Values.bridge.millenniumChampionship | quote }}
  NEWSSTAND: {{ .Values.bridge.newsstand | quote }}
  SCOTCH: {{ .Values.bridge.scotch | quote }}
  SHEEP_FULL: {{ .Values.bridge.sheepFull | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "bridge.fullname" . }}-bridge
  labels:
  {{- include "bridge.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: bridge
spec:
  replicas: {{ .Values.bridge.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: bridge
      app.kubernetes.io/name: mail
    {{- include "bridge.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: bridge
        app.kubernetes.io/name: mail
      {{- include "bridge.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: b0fccbbeeb03bcb9b86cef19cf6eafab7f2ec32161a0f4d302e7313c64cbe048
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "bridge.fullname" . }}-bridge
        image: {{ .Values.bridge.bridge.image.repository }}:{{ .Values.bridge.bridge.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.bridge.bridge.imagePullPolicy }}
        name: bridge
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.bridge.bridge.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.bridge.bridge.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "bridge.fullname" . }}-bridge
  labels:
  {{- include "bridge.labels" . | nindent 4 }}
spec:
  type: {{ .Values.bridge.type }}
  selector:
    app.kubernetes.io/instance: bridge
    app.kubernetes.io/name: mail
  {{- include "bridge.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.bridge.ports | toYaml | nindent 2 -}}
bridge:
  bridge:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  bulkSymmetryRecommend: witch-hunt
  federationParamedicAstrology: pressurisation
  flickerCartelIncandescent: maelstrom
  meadow: fundraising
  millenniumChampionship: cytokine
  newsstand: abrasive
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  scotch: eraser
  sheepFull: radish
  type: ClusterIP
kubernetesClusterDomain: cluster.local
