# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "tide.fullname" . }}-tide
  labels:
  {{- include "tide.labels" . | nindent 4 }}
data:
  EMERGENT: {{ .Values.tide.emergent | quote }}
  HANDLE_KNICKERS_PHILANTHROPY: {{ .Values.tide.handleKnickersPhilanthropy | quote
    }}
  ICING_ASK: {{ .Values.tide.icingAsk | quote }}
  JUDGE_HUNGER: {{ .Values.tide.judgeHunger | quote }}
  PANCREAS: {{ .Values.tide.pancreas | quote }}
  PECK: {{ .Values.tide.peck | quote }}
  ROCKET_BARTENDER_PEARL: {{ .Values.tide.rocketBartenderPearl | quote }}
  SINK_SETTING_MULTIMEDIA: {{ .Values.tide.sinkSettingMultimedia | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "tide.fullname" . }}-tide
  labels:
  {{- include "tide.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: tide
spec:
  replicas: {{ .Values.tide.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: tide
      app.kubernetes.io/name: distance
    {{- include "tide.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: tide
        app.kubernetes.io/name: distance
      {{- include "tide.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: c75447c4a18e7f98aa05eb6d24cd792ebb9822991289534bd659fb1d4c241ddf
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "tide.fullname" . }}-tide
        image: {{ .Values.tide.tide.image.repository }}:{{ .Values.tide.tide.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.tide.tide.imagePullPolicy }}
        name: tide
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.tide.tide.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.tide.tide.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "tide.fullname" . }}-tide
  labels:
  {{- include "tide.labels" . | nindent 4 }}
spec:
  type: {{ .Values.tide.type }}
  selector:
    app.kubernetes.io/instance: tide
    app.kubernetes.io/name: distance
  {{- include "tide.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.tide.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
tide:
  emergent: crowd
  handleKnickersPhilanthropy: turtle
  icingAsk: wisdom
  judgeHunger: departure
  pancreas: swimming
  peck: insectarium
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  rocketBartenderPearl: shoes
  sinkSettingMultimedia: reorganization
  tide:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  type: ClusterIP
