# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "shore.fullname" . }}-shore
  labels:
  {{- include "shore.labels" . | nindent 4 }}
data:
  COVERALL_PRESERVATION_CARP: {{ .Values.shore.coverallPreservationCarp | quote }}
  EXHIBITION_CAVE_DENSITY: {{ .Values.shore.exhibitionCaveDensity | quote }}
  OBI_TEMPO_KIMONO: {{ .Values.shore.obiTempoKimono | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "shore.fullname" . }}-shore
  labels:
  {{- include "shore.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: shore
spec:
  replicas: {{ .Values.shore.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: shore
      app.kubernetes.io/name: aquifer
    {{- include "shore.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: shore
        app.kubernetes.io/name: aquifer
      {{- include "shore.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 4b961d14e7ea9fc2d9f37b83ab26a3124eed60e87003f4863e21408e6f124577
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "shore.fullname" . }}-shore
        image: {{ .Values.shore.shore.image.repository }}:{{ .Values.shore.shore.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.shore.shore.imagePullPolicy }}
        name: shore
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.shore.shore.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.shore.shore.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "shore.fullname" . }}-shore
  labels:
  {{- include "shore.labels" . | nindent 4 }}
spec:
  type: {{ .Values.shore.type }}
  selector:
    app.kubernetes.io/instance: shore
    app.kubernetes.io/name: aquifer
  {{- include "shore.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.shore.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
shore:
  coverallPreservationCarp: broken
  exhibitionCaveDensity: storage
  obiTempoKimono: cohort
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  shore:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  type: ClusterIP
