# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "sail.fullname" . }}-sail
  labels:
  {{- include "sail.labels" . | nindent 4 }}
data:
  ARROGANCE_ASH: {{ .Values.sail.arroganceAsh | quote }}
  HELO_BONFIRE: {{ .Values.sail.heloBonfire | quote }}
  WORKING: {{ .Values.sail.working | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "sail.fullname" . }}-sail
  labels:
  {{- include "sail.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: sail
spec:
  replicas: {{ .Values.sail.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: sail
      app.kubernetes.io/name: grumpy
    {{- include "sail.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: sail
        app.kubernetes.io/name: grumpy
      {{- include "sail.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 2156b1ecdade24f60f868520071a74d285e31ab75e1d7e7823c7234e2b655309
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "sail.fullname" . }}-sail
        image: {{ .Values.sail.sail.image.repository }}:{{ .Values.sail.sail.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.sail.sail.imagePullPolicy }}
        name: sail
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.sail.sail.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.sail.sail.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "sail.fullname" . }}-sail
  labels:
  {{- include "sail.labels" . | nindent 4 }}
spec:
  type: {{ .Values.sail.type }}
  selector:
    app.kubernetes.io/instance: sail
    app.kubernetes.io/name: grumpy
  {{- include "sail.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.sail.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
sail:
  arroganceAsh: ill
  heloBonfire: develop
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  sail:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  type: ClusterIP
  working: platelet
