# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "upper.fullname" . }}-upper
  labels:
  {{- include "upper.labels" . | nindent 4 }}
data:
  BASELINE_YARD_LAYER: {{ .Values.upper.baselineYardLayer | quote }}
  BUD_WAITRESS: {{ .Values.upper.budWaitress | quote }}
  INDEPENDENT_SHIN: {{ .Values.upper.independentShin | quote }}
  SPRINKLES: {{ .Values.upper.sprinkles | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "upper.fullname" . }}-upper
  labels:
  {{- include "upper.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: upper
spec:
  replicas: {{ .Values.upper.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: upper
      app.kubernetes.io/name: birdhouse
    {{- include "upper.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: upper
        app.kubernetes.io/name: birdhouse
      {{- include "upper.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 61a3057a2a694121700eabd776a10aa40069b1d3ec111b04539a2c070b25c2c1
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "upper.fullname" . }}-upper
        image: {{ .Values.upper.upper.image.repository }}:{{ .Values.upper.upper.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.upper.upper.imagePullPolicy }}
        name: upper
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.upper.upper.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.upper.upper.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "upper.fullname" . }}-upper
  labels:
  {{- include "upper.labels" . | nindent 4 }}
spec:
  type: {{ .Values.upper.type }}
  selector:
    app.kubernetes.io/instance: upper
    app.kubernetes.io/name: birdhouse
  {{- include "upper.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.upper.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
upper:
  baselineYardLayer: going
  budWaitress: tale
  independentShin: recession
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  sprinkles: chateau
  type: ClusterIP
  upper:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
