# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "boulevard.fullname" . }}-boulevard
  labels:
  {{- include "boulevard.labels" . | nindent 4 }}
data:
  AZIMUTH_TOP-HAT_LOGO: {{ .Values.boulevard.azimuthTopHatLogo | quote }}
  HUNDRED_ALPHABET: {{ .Values.boulevard.hundredAlphabet | quote }}
  LIVING: {{ .Values.boulevard.living | quote }}
  SATELLITE_GORILLA: {{ .Values.boulevard.satelliteGorilla | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "boulevard.fullname" . }}-boulevard
  labels:
  {{- include "boulevard.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: boulevard
spec:
  replicas: {{ .Values.boulevard.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: boulevard
      app.kubernetes.io/name: glutamate
    {{- include "boulevard.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: boulevard
        app.kubernetes.io/name: glutamate
      {{- include "boulevard.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 60d381cfa7e78a21f5db223db4e15f6d92657d29bf675a96355f9407aa48911f
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "boulevard.fullname" . }}-boulevard
        image: {{ .Values.boulevard.boulevard.image.repository }}:{{ .Values.boulevard.boulevard.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.boulevard.boulevard.imagePullPolicy }}
        name: boulevard
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.boulevard.boulevard.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.boulevard.boulevard.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "boulevard.fullname" . }}-boulevard
  labels:
  {{- include "boulevard.labels" . | nindent 4 }}
spec:
  type: {{ .Values.boulevard.type }}
  selector:
    app.kubernetes.io/instance: boulevard
    app.kubernetes.io/name: glutamate
  {{- include "boulevard.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.boulevard.ports | toYaml | nindent 2 -}}
boulevard:
  azimuthTopHatLogo: education
  boulevard:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  hundredAlphabet: chip
  living: motionless
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  satelliteGorilla: flick
  type: ClusterIP
kubernetesClusterDomain: cluster.local
