# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "borrow.fullname" . }}-borrow
  labels:
  {{- include "borrow.labels" . | nindent 4 }}
data:
  BOAT: {{ .Values.borrow.boat | quote }}
  FRAMEWORK: {{ .Values.borrow.framework | quote }}
  LUNCHMEAT_PARANOIA: {{ .Values.borrow.lunchmeatParanoia | quote }}
  NEEDY_WORRY_RIPPLE: {{ .Values.borrow.needyWorryRipple | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "borrow.fullname" . }}-borrow
  labels:
  {{- include "borrow.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: borrow
spec:
  replicas: {{ .Values.borrow.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: borrow
      app.kubernetes.io/name: psychoanalyst
    {{- include "borrow.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: borrow
        app.kubernetes.io/name: psychoanalyst
      {{- include "borrow.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 70b16faeea9b4f98071e7357f58537b6b1e9b74a31f4c671f016947cae58f07e
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "borrow.fullname" . }}-borrow
        image: {{ .Values.borrow.borrow.image.repository }}:{{ .Values.borrow.borrow.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.borrow.borrow.imagePullPolicy }}
        name: borrow
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.borrow.borrow.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.borrow.borrow.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "borrow.fullname" . }}-borrow
  labels:
  {{- include "borrow.labels" . | nindent 4 }}
spec:
  type: {{ .Values.borrow.type }}
  selector:
    app.kubernetes.io/instance: borrow
    app.kubernetes.io/name: psychoanalyst
  {{- include "borrow.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.borrow.ports | toYaml | nindent 2 -}}
borrow:
  boat: footstool
  borrow:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  framework: characterization
  lunchmeatParanoia: scientific
  needyWorryRipple: peanut
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  type: ClusterIP
kubernetesClusterDomain: cluster.local
