Skip to content

v1.0.1

Choose a tag to compare

@dark-brains dark-brains released this 16 Dec 10:00
· 4 commits to main since this release
dcb4b29

πŸ“‹ Release Notes

πŸš€ New Features

Grafana Dashboard

  • Added pre-built Grafana dashboard for comprehensive monitoring
  • Dashboard sections include:
    • Controller Overview (Leader, Ready, Healthy pods, CRD count, IP stats)
    • Leader Election History timeline
    • CRD Status Table (Health, Reserved, Attached, Unattached IPs)
    • IP Allocation (Attachment rate gauge, IP-to-node mapping)
    • Node Status (Cordoned nodes, ip.ready label status)
    • Operations & Errors (Reconciliation rate, duration percentiles, API errors)
  • ConfigMap provisioning support for Grafana sidecar auto-discovery
  • Multi-cluster filtering with optional cluster variable

Optional Cluster Label for Metrics

  • All metrics now support an optional cluster label for multi-cluster environments
  • Set CLUSTER_NAME environment variable to enable cluster labeling
  • Dashboard automatically detects and filters by cluster when available
  • Works seamlessly without cluster label if not configured

Controller Health Metric

  • Added netipallocation_controller_healthy gauge metric
  • Non-leader pods now report ready=1 and healthy=1 (standby mode)
  • Better visibility into all controller pod states

πŸ”§ Improvements

  • Metrics are now initialized on startup for all pods (leader and non-leader)
  • Leader election status is updated immediately in lease_renewal_loop()
  • Added pod_name parameter to reconcile_all() for proper metrics labeling
  • Improved metric label consistency across all metrics

πŸ“Š Observability

  • New Grafana dashboard ConfigMap for automatic provisioning
  • Dashboard supports datasource variable selection
  • All PromQL queries include optional cluster filtering (cluster=~"$cluster")

πŸ“ Documentation

  • Updated README with Grafana Dashboard section
  • Added ConfigMap provisioning instructions
  • Added dashboard preview diagram
  • Updated Project Structure to match actual layout
  • Added CLUSTER_NAME environment variable documentation
  • Added PodMonitor example for Prometheus Operator
  • Added troubleshooting for metrics and Grafana issues

⚠️ Breaking Changes

None

πŸ“¦ Dependencies

No new dependencies


v1.1.0 (2025-12-15)

πŸš€ New Features

Prometheus Metrics Integration

  • Added comprehensive Prometheus metrics for monitoring and alerting
  • New metrics endpoint available at /metrics (port 9999)
  • Metrics include:
    • netipallocation_crd_status - CRD health status
    • netipallocation_reserved_ips_total - Total reserved IPs per CRD
    • netipallocation_attached_ips_total - Currently attached IPs
    • netipallocation_unattached_ips_total - Unattached IPs
    • netipallocation_ip_attached - Per-IP attachment status
    • netipallocation_node_cordoned - Node cordon status
    • netipallocation_node_ip_ready - Node label status
    • netipallocation_controller_is_leader - Leader election status
    • netipallocation_controller_ready - Controller readiness
    • netipallocation_reconcile_total - Reconciliation counter
    • netipallocation_ip_attach_total - IP attach operations counter
    • netipallocation_ip_detach_total - IP detach operations counter
    • netipallocation_gcp_api_errors_total - GCP API error counter
    • netipallocation_reconcile_duration_seconds - Reconciliation latency histogram

Smart IP Reallocation for Cordoned Nodes

  • Controller now detects cordoned nodes and reallocates IPs intelligently
  • If a node is cordoned but deployment pods are still running, IP is preserved
  • If a node is cordoned and no deployment pods are running, IP is detached and reallocated to a healthy node
  • Prevents service disruption during node maintenance and cluster autoscaling

Enhanced Node Drain Detection

  • Improved is_node_drained() function to be deployment-aware
  • Skips system namespaces (kube-system, gke-system, istio-system)
  • Skips DaemonSet pods when checking if node is drained
  • Uses deploymentRef from CRD to check for specific deployment pods

πŸ”§ Improvements

  • Added deployment_ref parameter to detach_ip_from_node() for smarter detachment decisions
  • Better logging with detailed context for debugging
  • Added debug logs showing which nodes are being checked during reconciliation
  • Improved error handling with GCP API error tracking

πŸ“Š Observability

  • New PodMonitor support for Prometheus Operator
  • Recommended PrometheusRule alerts included in documentation
  • Example Prometheus queries provided

πŸ› Bug Fixes

  • Fixed variable shadowing issue where local node_cordoned variable conflicted with imported Prometheus metric
  • Fixed IP not being reallocated when node is cordoned but has no running pods

πŸ“ Documentation

  • Updated README with comprehensive metrics documentation
  • Added troubleshooting section
  • Added architecture diagram
  • Added cloud provider setup instructions

⚠️ Breaking Changes

None

πŸ“¦ Dependencies

  • Added prometheus-client>=0.19.0

v1.0.0 (2025-12-01)

πŸŽ‰ Initial Release

Features

  • Automatic static external IP allocation to Kubernetes nodes
  • Support for GCP cloud provider
  • Leader election using Kubernetes Lease
  • Node labeling with ip.ready=true when IP is attached
  • Pod eviction from misconfigured nodes
  • Configurable reconciliation interval per CRD
  • Health endpoints (/healthz, /readyz)

CRD Support

  • NetIPAllocation custom resource for defining IP allocation rules
  • Support for reservedIPs, deploymentRef, nodeSelector
  • Cloud provider configuration (gcp, aws, azure)
  • Strategy configuration (maxSurge, maxUnavailable)

Upgrade Guide

From v1.1.0 to v1.2.0

  1. Update the controller image:
   kubectl set image deployment/ip-address-controller \
     controller=your-registry/ip-address-controller:v1.2.0
  1. Optional: Set cluster name for multi-cluster metrics:
   env:
     - name: CLUSTER_NAME
       value: "gke-prod"  # or your cluster name
  1. Optional: Deploy Grafana dashboard:
   kubectl apply -f k8s/grafana-dashboard-configmap.yaml

From v1.0.0 to v1.1.0

  1. Update the controller image:
   kubectl set image deployment/ip-address-controller \
     controller=your-registry/ip-address-controller:v1.1.0
  1. Add metrics port to deployment (if not present):
   ports:
     - name: health
       containerPort: 8080
     - name: metrics
       containerPort: 9999
  1. Optional: Deploy PodMonitor for Prometheus Operator:
   kubectl apply -f k8s/podmonitor.yaml
  1. Optional: Deploy PrometheusRule for alerts:
   kubectl apply -f k8s/prometheusrule.yaml

Roadmap

v1.3.0 (Planned)

  • AWS support
  • Azure support
  • Webhook validation for CRD
  • Status subresource for CRD

v1.4.0 (Planned)

  • Multi-IP per node support
  • IP pool management
  • Automatic IP reservation from cloud provider
  • Custom health checks before IP reallocation