Skip to content

Metrics & Monitoring

1. Overview

HostSpace Kubernetes Engine (HKE) provides robust metrics and monitoring capabilities to ensure the performance and health of the Kubernetes clusters. This documentation focuses on automated scaling, monitoring, and high availability for DevOps engineers and platform administrators.

2. Key Features/Components

  • Prometheus: Default monitoring system for collecting metrics.
  • Grafana: Visualization tool for monitoring Prometheus metrics.
  • Horizontal Pod Autoscaler (HPA): Automatic scaling based on CPU and memory metrics.
  • Cluster-level monitoring: Monitoring cluster-wide resources and components.

3. Step-by-step Instructions or Configuration Details

  1. Enabling Prometheus Metrics:

    Update the cluster configuration to enable Prometheus metrics scraping:

    apiVersion: v1
    kind: Service
    metadata:
    annotations:
    prometheus.io/scrape: "true"
    prometheus.io/port: "8080"
  2. Setting up Horizontal Pod Autoscaler:

    Create an HPA for a deployment:

    Terminal window
    kubectl autoscale deployment <deployment-name> --cpu-percent=50 --min=1 --max=10

4. Best Practices and Recommendations

  • Regularly review and adjust HPA configurations based on workload patterns.
  • Use Grafana dashboards to visualize key metrics and identify performance bottlenecks.
  • kubectl top nodes - View resource usage at the node level.
  • kubectl top pods - Check resource consumption by pods.
  • Kubernetes Metrics API documentation for detailed API references.

6. Common Pitfalls and Solutions

This documentation provides a comprehensive guide to leveraging metrics and monitoring in HostSpace Kubernetes Engine for efficient cluster management.