# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "influx.fullname" . }}-influx
  labels:
  {{- include "influx.labels" . | nindent 4 }}
data:
  BOOTIE_LOGGIA: {{ .Values.influx.bootieLoggia | quote }}
  BUCK: {{ .Values.influx.buck | quote }}
  CROWDED: {{ .Values.influx.crowded | quote }}
  OAFISH_NURSING_TAILSPIN: {{ .Values.influx.oafishNursingTailspin | quote }}
  POMELO_INVENT_POD: {{ .Values.influx.pomeloInventPod | quote }}
  YAM_ABUSIVE_CALCULATION: {{ .Values.influx.yamAbusiveCalculation | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "influx.fullname" . }}-influx
  labels:
  {{- include "influx.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: influx
spec:
  replicas: {{ .Values.influx.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: influx
      app.kubernetes.io/name: potty
    {{- include "influx.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: influx
        app.kubernetes.io/name: potty
      {{- include "influx.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: a1d9c664e87be07edcd9cdcf294b42a76b8a56470b2ba18544ae823bc4a28cc1
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "influx.fullname" . }}-influx
        image: {{ .Values.influx.influx.image.repository }}:{{ .Values.influx.influx.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.influx.influx.imagePullPolicy }}
        name: influx
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.influx.influx.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.influx.influx.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "influx.fullname" . }}-influx
  labels:
  {{- include "influx.labels" . | nindent 4 }}
spec:
  type: {{ .Values.influx.type }}
  selector:
    app.kubernetes.io/instance: influx
    app.kubernetes.io/name: potty
  {{- include "influx.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.influx.ports | toYaml | nindent 2 -}}
influx:
  bootieLoggia: tab
  buck: slope
  crowded: mambo
  influx:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  oafishNursingTailspin: blight
  pomeloInventPod: disgust
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  type: ClusterIP
  yamAbusiveCalculation: mushroom
kubernetesClusterDomain: cluster.local
