# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "modem.fullname" . }}-modem
  labels:
  {{- include "modem.labels" . | nindent 4 }}
data:
  ASSURE_CREATURE: {{ .Values.modem.assureCreature | quote }}
  ATTACH: {{ .Values.modem.attach | quote }}
  CAPTAIN_SWEET_THONG: {{ .Values.modem.captainSweetThong | quote }}
  CLAVIER: {{ .Values.modem.clavier | quote }}
  COLLECT_HEALTHY: {{ .Values.modem.collectHealthy | quote }}
  GRASP_ABERRANT: {{ .Values.modem.graspAberrant | quote }}
  NEWSPRINT_GANG: {{ .Values.modem.newsprintGang | quote }}
  NUDGE_COURTROOM: {{ .Values.modem.nudgeCourtroom | quote }}
  PLASTERBOARD_ROSTRUM_STUFF: {{ .Values.modem.plasterboardRostrumStuff | quote }}
  TOUGH-GUY_SPELL_ADVANCE: {{ .Values.modem.toughGuySpellAdvance | quote }}
  TRANSLATION_GRASSLAND: {{ .Values.modem.translationGrassland | quote }}
  VOLCANO: {{ .Values.modem.volcano | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "modem.fullname" . }}-modem
  labels:
  {{- include "modem.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: modem
spec:
  replicas: {{ .Values.modem.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: modem
      app.kubernetes.io/name: beanie
    {{- include "modem.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: modem
        app.kubernetes.io/name: beanie
      {{- include "modem.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: a83ed2f20a09be8d0397ad63daddb569d09face6c0eaef8b9e17945269057565
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "modem.fullname" . }}-modem
        image: {{ .Values.modem.modem.image.repository }}:{{ .Values.modem.modem.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.modem.modem.imagePullPolicy }}
        name: modem
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.modem.modem.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.modem.modem.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "modem.fullname" . }}-modem
  labels:
  {{- include "modem.labels" . | nindent 4 }}
spec:
  type: {{ .Values.modem.type }}
  selector:
    app.kubernetes.io/instance: modem
    app.kubernetes.io/name: beanie
  {{- include "modem.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.modem.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
modem:
  assureCreature: detect
  attach: grandfather
  captainSweetThong: masterpiece
  clavier: listing
  collectHealthy: initial
  graspAberrant: deathwatch
  modem:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  newsprintGang: frantic
  nudgeCourtroom: bandanna
  plasterboardRostrumStuff: enrollment
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  toughGuySpellAdvance: hurried
  translationGrassland: randomisation
  type: ClusterIP
  volcano: anagram
