# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "reserve.fullname" . }}-reserve
  labels:
  {{- include "reserve.labels" . | nindent 4 }}
data:
  ADJOINING_SMELLY: {{ .Values.reserve.adjoiningSmelly | quote }}
  BEGONIA_NIGHTLIGHT: {{ .Values.reserve.begoniaNightlight | quote }}
  IMITATION_FRIENDLY: {{ .Values.reserve.imitationFriendly | quote }}
  LEVERAGE_CANDY: {{ .Values.reserve.leverageCandy | quote }}
  POVERTY_ADJUSTMENT: {{ .Values.reserve.povertyAdjustment | quote }}
  THANKFUL: {{ .Values.reserve.thankful | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "reserve.fullname" . }}-reserve
  labels:
  {{- include "reserve.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: reserve
spec:
  replicas: {{ .Values.reserve.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: reserve
      app.kubernetes.io/name: porter
    {{- include "reserve.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: reserve
        app.kubernetes.io/name: porter
      {{- include "reserve.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: d501a075f34432ce6209d5a2e5c8c4702bc18e8d75964ebd3110a953130cbda6
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "reserve.fullname" . }}-reserve
        image: {{ .Values.reserve.reserve.image.repository }}:{{ .Values.reserve.reserve.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.reserve.reserve.imagePullPolicy }}
        name: reserve
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.reserve.reserve.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.reserve.reserve.containerSecurityContext |
          nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "reserve.fullname" . }}-reserve
  labels:
  {{- include "reserve.labels" . | nindent 4 }}
spec:
  type: {{ .Values.reserve.type }}
  selector:
    app.kubernetes.io/instance: reserve
    app.kubernetes.io/name: porter
  {{- include "reserve.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.reserve.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
reserve:
  adjoiningSmelly: grate
  begoniaNightlight: flare
  imitationFriendly: bring
  leverageCandy: redhead
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  povertyAdjustment: great
  replicas: 1
  reserve:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  thankful: consulate
  type: ClusterIP
