Skip to content
GreenKube

Installation

The recommended way to deploy GreenKube in a production Kubernetes cluster.

  1. Add the Helm repository

    Terminal window
    helm repo add greenkube https://GreenKubeCloud.github.io/GreenKube
    helm repo update
  2. Create a values file

    Create my-values.yaml to customize your deployment:

    my-values.yaml
    secrets:
    # Get your API token from https://www.electricitymaps.com/
    electricityMapsToken: "YOUR_TOKEN_HERE"
    config:
    cloudProvider: aws # aws, gcp, azure, ovh, scaleway
    defaultZone: FR # Fallback carbon zone (ISO 3166-1)
    # Uncomment to manually set Prometheus URL
    # prometheus:
    # url: "http://prometheus-k8s.monitoring.svc.cluster.local:9090"
    # Uncomment to manually set OpenCost URL
    # opencost:
    # url: "http://opencost.opencost.svc.cluster.local:9003"
    db:
    type: postgres # postgres (recommended), sqlite, elasticsearch
    postgres:
    enabled: true
    persistence:
    enabled: true
    size: 5Gi
  3. Install the chart

    Terminal window
    helm install greenkube greenkube/greenkube \
    -f my-values.yaml \
    -n greenkube \
    --create-namespace
  4. Verify the installation

    Terminal window
    kubectl get all -n greenkube
Terminal window
helm repo update
helm upgrade greenkube greenkube/greenkube \
-f my-values.yaml \
-n greenkube
Terminal window
helm uninstall greenkube -n greenkube
kubectl delete namespace greenkube
ServicePurposeHow to Install
PrometheusMetrics collection (CPU, memory, network, disk)kube-prometheus-stack
OpenCostCost allocation dataOpenCost Helm Chart

GreenKube automatically discovers Prometheus and OpenCost services in your cluster by probing common service names and namespaces. If auto-discovery fails (custom naming or namespace), set the URLs manually:

# In your values.yaml
config:
prometheus:
url: "http://prometheus-server.monitoring.svc.cluster.local:9090"
opencost:
url: "http://opencost.opencost.svc.cluster.local:9003"

The Helm chart deploys the following resources:

ResourceDescription
DeploymentGreenKube application (collector + API + dashboard)
ServiceExposes the API on port 8000
ConfigMapNon-sensitive configuration
SecretAPI tokens and database credentials
ServiceAccountIdentity for pod RBAC
ClusterRoleRead access to nodes, pods, namespaces
ClusterRoleBindingBinds ClusterRole to ServiceAccount
StatefulSetPostgreSQL database (if enabled)
PersistentVolumeClaimDatabase storage (if persistence enabled)
Job (post-install hook)Database schema initialization
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: 500m
memory: 512Mi
resources:
requests:
cpu: 250m
memory: 256Mi
limits:
cpu: 1000m
memory: 1Gi

The API server listens on port 8000 by default. Access methods:

  • Port-forward (development): kubectl port-forward svc/greenkube-api 8000:8000 -n greenkube
  • LoadBalancer: Set service.type: LoadBalancer in values.yaml
  • Ingress: Configure an Ingress resource pointing to the service
  • NodePort: Set service.type: NodePort for direct node access