# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "bookmark.fullname" . }}-bookmark
  labels:
  {{- include "bookmark.labels" . | nindent 4 }}
data:
  AUNT: {{ .Values.bookmark.aunt | quote }}
  BOOTY_PINCH: {{ .Values.bookmark.bootyPinch | quote }}
  BUNGALOW: {{ .Values.bookmark.bungalow | quote }}
  RAWHIDE_RUNNER: {{ .Values.bookmark.rawhideRunner | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "bookmark.fullname" . }}-bookmark
  labels:
  {{- include "bookmark.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: bookmark
spec:
  replicas: {{ .Values.bookmark.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: bookmark
      app.kubernetes.io/name: sake
    {{- include "bookmark.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: bookmark
        app.kubernetes.io/name: sake
      {{- include "bookmark.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: eb48b611e72f0ec9e204a053f4bb7e90c4ba59baf8dd0914e13c97435807d397
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "bookmark.fullname" . }}-bookmark
        image: {{ .Values.bookmark.bookmark.image.repository }}:{{ .Values.bookmark.bookmark.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.bookmark.bookmark.imagePullPolicy }}
        name: bookmark
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.bookmark.bookmark.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.bookmark.bookmark.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "bookmark.fullname" . }}-bookmark
  labels:
  {{- include "bookmark.labels" . | nindent 4 }}
spec:
  type: {{ .Values.bookmark.type }}
  selector:
    app.kubernetes.io/instance: bookmark
    app.kubernetes.io/name: sake
  {{- include "bookmark.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.bookmark.ports | toYaml | nindent 2 -}}
bookmark:
  aunt: ski
  bookmark:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  bootyPinch: telephone
  bungalow: casket
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  rawhideRunner: internet
  replicas: 1
  type: ClusterIP
kubernetesClusterDomain: cluster.local
