This folder contains configuration and installation instructions to install Prometheus and Grafana as part of kube-prometheus via the kube-prometheus-stack Helm chart.
Furthermore, it contains additional Kubernetes manifests to apply in folder manifests
Check the values.yaml file and verify the configuration. You can find all default values of the kube-prometheus-stack here.
Pay special attention to the storage configuration, especially the storageClassName
values.
This might need to be adapted depending on available storage classes on the cluster.
Get available storage classes with:
kubectl get storageclass
Also consider the storage size. You might want to use more than the pre-configured 10GB.
With the default configuration, neither Prometheus nor Grafana are exposed outside the cluster. This means the API respectively Web UI cannot be accessed without port forwarding using kubectl.
The values.yaml file in this folder only contains the default values because required configuration differs based on the used ingress provider (e.g. NGinX) and further properties of the cluster (i.e. domain, TLS certificate handling).
Also note that the Prometheus API and Web UI do not require any credentials and, thus, can be queried by anyone when this is exposed publicly.
Using GKE, no additional configuration for the cluster was needed for the stack to work out of the box. Nevertheless, briefly check the prerequisites of kube-prometheus.
The tools kubectl and Helm are required to execute the installation. Kubectl needs to be configured to point to the desired Kubernetes cluster.
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo update
# With Grafana admin password from values file or default
helm install kube-prometheus-stack prometheus-community/kube-prometheus-stack \
--version 60.2.0 --namespace kube-prometheus-stack --create-namespace \
--values values.yaml
# With custom Grafana admin password only provided at install time
# Replace PASSWORD with your custom password.
helm install kube-prometheus-stack prometheus-community/kube-prometheus-stack \
--version 60.2.0 --namespace kube-prometheus-stack --create-namespace \
--values values.yaml
--set grafana.adminPassword=PASSWORD
helm upgrade kube-prometheus-stack prometheus-community/kube-prometheus-stack \
--version 60.2.0 --namespace kube-prometheus-stack \
--values values.yaml
The additional manifests contain a Grafana dashboard custom-made for showing Theia Cloud parameters. The pod selector required for the dashboard to work is also included.
Note: The manifests assume default namespaces for both the Theia Cloud (theiacloud
) and the Prometheus (kube-prometheus-stack
) installations. If those namespaces do not match your installation, you have to adapt the manifests as follows.
The custom Grafana dashboard dashboard-theiacloud.yaml is minified and contains the hard-coded namespaces in its data
property.
- Replace all occurences of
namespace=\"theiacloud\"
withnamespace=\"<your-theiacloud-namespace>\"
. - Replace all occurences of
kube-prometheus-stack
with<your-prometheus-namespace>
including the namespace definition in the metadata.
The pod selector pod-selector-theia-cloud-sessions.yaml takes care of monitoring and creating reports for all running Theia sessions.
- Replace
kube-prometheus-stack
in the metadata with<your-prometheus-namespace>
. - Replace
theiacloud
inspec.namespaceSelector.matchNames
with<your-theiacloud-namespace>
.
kubectl apply -f manifests