# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "waveform.fullname" . }}-waveform
  labels:
  {{- include "waveform.labels" . | nindent 4 }}
data:
  ABSTRACTED_PRESIDENCY_NOON: {{ .Values.waveform.abstractedPresidencyNoon | quote
    }}
  ASTERISK_BAYOU_SNUG: {{ .Values.waveform.asteriskBayouSnug | quote }}
  CHASSIS_ANYWHERE: {{ .Values.waveform.chassisAnywhere | quote }}
  IMPROVEMENT_HANDOVER: {{ .Values.waveform.improvementHandover | quote }}
  READ_ARM-REST: {{ .Values.waveform.readArmRest | quote }}
  SEED: {{ .Values.waveform.seed | quote }}
  TECHNIQUE_RAZOR: {{ .Values.waveform.techniqueRazor | quote }}
  TRAM_FROSTING_TRAVELER: {{ .Values.waveform.tramFrostingTraveler | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "waveform.fullname" . }}-waveform
  labels:
  {{- include "waveform.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: waveform
spec:
  replicas: {{ .Values.waveform.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: waveform
      app.kubernetes.io/name: associate
    {{- include "waveform.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: waveform
        app.kubernetes.io/name: associate
      {{- include "waveform.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: b075ae6f22e3d830e0bc66d7fde4a4857c1c40a8bd4dc64c72e1ec8af669eb93
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "waveform.fullname" . }}-waveform
        image: {{ .Values.waveform.waveform.image.repository }}:{{ .Values.waveform.waveform.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.waveform.waveform.imagePullPolicy }}
        name: waveform
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.waveform.waveform.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.waveform.waveform.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "waveform.fullname" . }}-waveform
  labels:
  {{- include "waveform.labels" . | nindent 4 }}
spec:
  type: {{ .Values.waveform.type }}
  selector:
    app.kubernetes.io/instance: waveform
    app.kubernetes.io/name: associate
  {{- include "waveform.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.waveform.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
waveform:
  abstractedPresidencyNoon: psychology
  asteriskBayouSnug: phenotype
  chassisAnywhere: tugboat
  improvementHandover: naive
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  readArmRest: jump
  replicas: 1
  seed: webpage
  techniqueRazor: ex-husband
  tramFrostingTraveler: major-league
  type: ClusterIP
  waveform:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
