# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "earthworm.fullname" . }}-earthworm
  labels:
  {{- include "earthworm.labels" . | nindent 4 }}
data:
  CEMETERY_REPRESENT: {{ .Values.earthworm.cemeteryRepresent | quote }}
  DUNE_VOLUME_OXFORD: {{ .Values.earthworm.duneVolumeOxford | quote }}
  GLUCOSE_SNEAKY_STEP-BROTHER: {{ .Values.earthworm.glucoseSneakyStepBrother | quote
    }}
  HILL_SKULLCAP_HOTEL: {{ .Values.earthworm.hillSkullcapHotel | quote }}
  KNOCK_COPPER: {{ .Values.earthworm.knockCopper | quote }}
  SCIENCE_NUMERIC_SUV: {{ .Values.earthworm.scienceNumericSuv | quote }}
  SCRAMBLED: {{ .Values.earthworm.scrambled | quote }}
  SURPLUS_LICENSE_RESERVATION: {{ .Values.earthworm.surplusLicenseReservation | quote
    }}
  TOMATILLO_HANDRAIL_BRASH: {{ .Values.earthworm.tomatilloHandrailBrash | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "earthworm.fullname" . }}-earthworm
  labels:
  {{- include "earthworm.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: earthworm
spec:
  replicas: {{ .Values.earthworm.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: earthworm
      app.kubernetes.io/name: axis
    {{- include "earthworm.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: earthworm
        app.kubernetes.io/name: axis
      {{- include "earthworm.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 56e9514988dbe7886fcca7a25c1a09a1d9ca1f92ce817c7b817bcd97e8c74873
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "earthworm.fullname" . }}-earthworm
        image: {{ .Values.earthworm.earthworm.image.repository }}:{{ .Values.earthworm.earthworm.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.earthworm.earthworm.imagePullPolicy }}
        name: earthworm
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.earthworm.earthworm.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.earthworm.earthworm.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "earthworm.fullname" . }}-earthworm
  labels:
  {{- include "earthworm.labels" . | nindent 4 }}
spec:
  type: {{ .Values.earthworm.type }}
  selector:
    app.kubernetes.io/instance: earthworm
    app.kubernetes.io/name: axis
  {{- include "earthworm.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.earthworm.ports | toYaml | nindent 2 -}}
earthworm:
  cemeteryRepresent: tow
  duneVolumeOxford: rehospitalisation
  earthworm:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  glucoseSneakyStepBrother: worshiper
  hillSkullcapHotel: wonderful
  knockCopper: oven
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  scienceNumericSuv: desktop
  scrambled: synthesize
  surplusLicenseReservation: dial
  tomatilloHandrailBrash: advice
  type: ClusterIP
kubernetesClusterDomain: cluster.local
