# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "floozie.fullname" . }}-floozie
  labels:
  {{- include "floozie.labels" . | nindent 4 }}
data:
  BRIDE_NOTEPAD: {{ .Values.floozie.brideNotepad | quote }}
  DATA_BUSINESS: {{ .Values.floozie.dataBusiness | quote }}
  FENNEL: {{ .Values.floozie.fennel | quote }}
  OMNISCIENT_PEACOCK: {{ .Values.floozie.omniscientPeacock | quote }}
  REVOLUTION: {{ .Values.floozie.revolution | quote }}
  ROMAINE: {{ .Values.floozie.romaine | quote }}
  THIGH: {{ .Values.floozie.thigh | quote }}
  THUMP_VIOLENCE_RIVER: {{ .Values.floozie.thumpViolenceRiver | quote }}
  TOW-TRUCK: {{ .Values.floozie.towTruck | quote }}
  WING_MISSILE_MESSENGER: {{ .Values.floozie.wingMissileMessenger | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "floozie.fullname" . }}-floozie
  labels:
  {{- include "floozie.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: floozie
spec:
  replicas: {{ .Values.floozie.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: floozie
      app.kubernetes.io/name: opium
    {{- include "floozie.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: floozie
        app.kubernetes.io/name: opium
      {{- include "floozie.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 36aec2a766b7f29d49c58bc7d00df9039daf808cf22a2440f07b1675107a6b9c
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "floozie.fullname" . }}-floozie
        image: {{ .Values.floozie.floozie.image.repository }}:{{ .Values.floozie.floozie.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.floozie.floozie.imagePullPolicy }}
        name: floozie
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.floozie.floozie.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.floozie.floozie.containerSecurityContext |
          nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "floozie.fullname" . }}-floozie
  labels:
  {{- include "floozie.labels" . | nindent 4 }}
spec:
  type: {{ .Values.floozie.type }}
  selector:
    app.kubernetes.io/instance: floozie
    app.kubernetes.io/name: opium
  {{- include "floozie.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.floozie.ports | toYaml | nindent 2 -}}
floozie:
  brideNotepad: faculty
  dataBusiness: wiretap
  fennel: train
  floozie:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  omniscientPeacock: withhold
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  revolution: propaganda
  romaine: liquor
  thigh: stir
  thumpViolenceRiver: goodbye
  towTruck: tank
  type: ClusterIP
  wingMissileMessenger: shadowbox
kubernetesClusterDomain: cluster.local
