Skip to content

Deploy Prometheus and MinIO using Helm

Cesar Celis Hernandez edited this page Apr 5, 2022 · 1 revision
  1. Kill any previous cluster to start clean
kind delete clusters kind
  1. Create new cluster
kind create cluster --config ~/operator/testing/kind-config.yaml
  1. Create Operator:
kubectl apply -k ~/operator/resources
  1. Add Prometheus in ~/operator/helm/tenant/templates/tenant.yaml
  ## Prometheus setup for MinIO Tenant.
  {{ if dig "prometheus" "diskCapacityGB" false . }}
  prometheus:
    image: {{ .prometheus.image | quote }}
    sidecarimage: {{ .prometheus.sidecarimage | quote }}
    initimage: {{ .prometheus.initimage | quote }}
    diskCapacityGB: {{ .prometheus.diskCapacityGB | int }}
    storageClassName: {{ .prometheus.storageClassName }}
    {{- with (dig "annotations" (dict) .) }}
    annotations:
      {{ toYaml . | nindent 4 }}
    {{- end }}
    {{- with (dig "labels" (dict) .) }}
    labels:
      {{ toYaml . | nindent 4 }}
    {{- end }}
    {{- with (dig "nodeSelector" (dict) .) }}
    nodeSelector:
      {{ toYaml . | nindent 4 }}
    {{- end }}
    affinity:
      nodeAffinity: { }
      podAffinity: { }
      podAntiAffinity: { }
    {{- with (dig "resources" (dict) .) }}
    resources:
      {{ toYaml . | nindent 4 }}
    {{- end }}
    serviceAccountName: {{ .prometheus.serviceAccountName | quote }}
    securityContext:
      runAsUser: {{ .prometheus.securityContext.runAsUser | int }}
      runAsGroup: {{ .prometheus.securityContext.runAsGroup | int }}
      runAsNonRoot: {{ .prometheus.securityContext.runAsNonRoot }}
      fsGroup: {{ .prometheus.securityContext.fsGroup | int }}
  {{ end }}
  1. Put the values in ~/operator/helm/tenant/values.yaml
    ## Prometheus setup for MinIO Tenant.
    prometheus:
      image: "" # defaults to quay.io/prometheus/prometheus:latest
      sidecarimage: "" # defaults to alpine
      initimage: "" # defaults to busybox:1.33.1
      diskCapacityGB: 1
      storageClassName: standard
      annotations: { }
      labels: { }
      nodeSelector: { }
      affinity:
        nodeAffinity: { }
        podAffinity: { }
        podAntiAffinity: { }
      resources: { }
      serviceAccountName: ""
      securityContext:
        runAsUser: 1000
        runAsGroup: 1000
        runAsNonRoot: true
        fsGroup: 1000
  1. Install tenant using helm:
cd ~/operator/helm
helm install --debug --namespace tenant-ns \
  --create-namespace tenant ./tenant \
  -f ~/operator/helm/tenant/values.yaml