# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "eicosanoid.fullname" . }}-eicosanoid
  labels:
  {{- include "eicosanoid.labels" . | nindent 4 }}
data:
  ESPALIER_MANATEE_FIGURE: {{ .Values.eicosanoid.espalierManateeFigure | quote }}
  FERRY: {{ .Values.eicosanoid.ferry | quote }}
  HEALTHY: {{ .Values.eicosanoid.healthy | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "eicosanoid.fullname" . }}-eicosanoid
  labels:
  {{- include "eicosanoid.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: eicosanoid
spec:
  replicas: {{ .Values.eicosanoid.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: eicosanoid
      app.kubernetes.io/name: epoch
    {{- include "eicosanoid.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: eicosanoid
        app.kubernetes.io/name: epoch
      {{- include "eicosanoid.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 0fd57e0c50e5af1d6bd146635035e2fe715153385d0ec4801f5cd74e42ce3f40
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "eicosanoid.fullname" . }}-eicosanoid
        image: {{ .Values.eicosanoid.eicosanoid.image.repository }}:{{ .Values.eicosanoid.eicosanoid.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.eicosanoid.eicosanoid.imagePullPolicy }}
        name: eicosanoid
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.eicosanoid.eicosanoid.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.eicosanoid.eicosanoid.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "eicosanoid.fullname" . }}-eicosanoid
  labels:
  {{- include "eicosanoid.labels" . | nindent 4 }}
spec:
  type: {{ .Values.eicosanoid.type }}
  selector:
    app.kubernetes.io/instance: eicosanoid
    app.kubernetes.io/name: epoch
  {{- include "eicosanoid.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.eicosanoid.ports | toYaml | nindent 2 -}}
eicosanoid:
  eicosanoid:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  espalierManateeFigure: soup
  ferry: average
  healthy: shed
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  type: ClusterIP
kubernetesClusterDomain: cluster.local
