# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "connotation.fullname" . }}-connotation
  labels:
  {{- include "connotation.labels" . | nindent 4 }}
data:
  BACKUP_GRAFT: {{ .Values.connotation.backupGraft | quote }}
  BRILLIANT: {{ .Values.connotation.brilliant | quote }}
  CAPRICIOUS: {{ .Values.connotation.capricious | quote }}
  FLOOZIE: {{ .Values.connotation.floozie | quote }}
  GENIUS_BIRD_HONESTY: {{ .Values.connotation.geniusBirdHonesty | quote }}
  INSOLENCE_BARITONE: {{ .Values.connotation.insolenceBaritone | quote }}
  PERFECTION: {{ .Values.connotation.perfection | quote }}
  RUTABAGA: {{ .Values.connotation.rutabaga | quote }}
  TRAPEZIUM_FORAY: {{ .Values.connotation.trapeziumForay | quote }}
  WHIRLWIND_TESTY: {{ .Values.connotation.whirlwindTesty | quote }}
  WRATHFUL: {{ .Values.connotation.wrathful | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "connotation.fullname" . }}-connotation
  labels:
  {{- include "connotation.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: connotation
spec:
  replicas: {{ .Values.connotation.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: connotation
      app.kubernetes.io/name: plausible
    {{- include "connotation.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: connotation
        app.kubernetes.io/name: plausible
      {{- include "connotation.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 8ebbead9167a7fb1c9a8a4ac1a87102b01f220795f870dab465c9c94bc6157fb
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "connotation.fullname" . }}-connotation
        image: {{ .Values.connotation.connotation.image.repository }}:{{ .Values.connotation.connotation.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.connotation.connotation.imagePullPolicy }}
        name: connotation
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.connotation.connotation.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.connotation.connotation.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "connotation.fullname" . }}-connotation
  labels:
  {{- include "connotation.labels" . | nindent 4 }}
spec:
  type: {{ .Values.connotation.type }}
  selector:
    app.kubernetes.io/instance: connotation
    app.kubernetes.io/name: plausible
  {{- include "connotation.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.connotation.ports | toYaml | nindent 2 -}}
connotation:
  backupGraft: mixer
  brilliant: chuck
  capricious: seeker
  connotation:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  floozie: tweezers
  geniusBirdHonesty: farming
  insolenceBaritone: beer
  perfection: slay
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  rutabaga: decorous
  trapeziumForay: forelimb
  type: ClusterIP
  whirlwindTesty: libido
  wrathful: dragon
kubernetesClusterDomain: cluster.local
