Prometheus
If you have not already done so, make sure your cluster meets the package prerequisites. Be sure to refer to the troubleshooting guide in the event of a problem.
Important
- Starting at
eksctl anywhereversionv0.12.0, packages on workload clusters are remotely managed by the management cluster. - While following this guide to install packages on a workload cluster, please make sure the
kubeconfigis pointing to the management cluster that was used to create the workload cluster. The only exception is thekubectl create namespacecommand below, which should be run withkubeconfigpointing to the workload cluster.
Install
-
Generate the package configuration
eksctl anywhere generate package prometheus --cluster <cluster-name> > prometheus.yaml -
Add the desired configuration to
prometheus.yamlPlease see complete configuration options for all configuration options and their default values.
Example package file with default configuration, which enables prometheus-server and node-exporter:
apiVersion: packages.eks.amazonaws.com/v1alpha1 kind: Package metadata: name: generated-prometheus namespace: eksa-packages-<cluster-name> spec: packageName: prometheusExample package file with prometheus-server (or node-exporter) disabled:
apiVersion: packages.eks.amazonaws.com/v1alpha1 kind: Package metadata: name: generated-prometheus namespace: eksa-packages-<cluster-name> spec: packageName: prometheus config: | # disable prometheus-server server: enabled: false # or disable node-exporter # nodeExporter: # enabled: falseExample package file with prometheus-server deployed as a statefulSet with replicaCount 2, and set scrape config to collect Prometheus-server’s own metrics only:
apiVersion: packages.eks.amazonaws.com/v1alpha1 kind: Package metadata: name: generated-prometheus namespace: eksa-packages-<cluster-name> spec: packageName: prometheus targetNamespace: observability config: | server: replicaCount: 2 statefulSet: enabled: true serverFiles: prometheus.yml: scrape_configs: - job_name: prometheus static_configs: - targets: - localhost:9090 -
Create the namespace (If overriding
targetNamespace, changeobservabilityto the value oftargetNamespace)kubectl create namespace observability -
Install prometheus
eksctl anywhere create packages -f prometheus.yaml -
Validate the installation
eksctl anywhere get packages --cluster <cluster-name>Example command output
NAMESPACE NAME PACKAGE AGE STATE CURRENTVERSION TARGETVERSION DETAIL eksa-packages-<cluster-name> generated-prometheus prometheus 17m installed 2.41.0-b53c8be243a6cc3ac2553de24ab9f726d9b851ca 2.41.0-b53c8be243a6cc3ac2553de24ab9f726d9b851ca (latest)
Update
To update package configuration, update prometheus.yaml file, and run the following command:
eksctl anywhere apply package -f prometheus.yaml
Upgrade
Prometheus will automatically be upgraded when a new bundle is activated.
Uninstall
To uninstall Prometheus, simply delete the package
eksctl anywhere delete package --cluster <cluster-name> generated-prometheus