# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "mussel.fullname" . }}-mussel
  labels:
  {{- include "mussel.labels" . | nindent 4 }}
data:
  COUPON: {{ .Values.mussel.coupon | quote }}
  DICTAPHONE: {{ .Values.mussel.dictaphone | quote }}
  EXPECT_WORLD_VALIDITY: {{ .Values.mussel.expectWorldValidity | quote }}
  HANDOVER: {{ .Values.mussel.handover | quote }}
  LIGHTING_BIRD-WATCHER: {{ .Values.mussel.lightingBirdWatcher | quote }}
  MINESHAFT_SPELT: {{ .Values.mussel.mineshaftSpelt | quote }}
  PILAF: {{ .Values.mussel.pilaf | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "mussel.fullname" . }}-mussel
  labels:
  {{- include "mussel.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: mussel
spec:
  replicas: {{ .Values.mussel.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: mussel
      app.kubernetes.io/name: expectation
    {{- include "mussel.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: mussel
        app.kubernetes.io/name: expectation
      {{- include "mussel.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 73d68cf975e9da6988273b13ed215fcb20cfab7aad8daa89127bfb5e786c3674
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "mussel.fullname" . }}-mussel
        image: {{ .Values.mussel.mussel.image.repository }}:{{ .Values.mussel.mussel.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.mussel.mussel.imagePullPolicy }}
        name: mussel
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.mussel.mussel.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.mussel.mussel.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "mussel.fullname" . }}-mussel
  labels:
  {{- include "mussel.labels" . | nindent 4 }}
spec:
  type: {{ .Values.mussel.type }}
  selector:
    app.kubernetes.io/instance: mussel
    app.kubernetes.io/name: expectation
  {{- include "mussel.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.mussel.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
mussel:
  coupon: whirlwind
  dictaphone: inhibition
  expectWorldValidity: caution
  handover: turban
  lightingBirdWatcher: still
  mineshaftSpelt: effacement
  mussel:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  pilaf: domineering
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  type: ClusterIP
