Concepts
Overview
Consul is a highly available, open-source service networking solution that provides service discovery, health checking, key/value storage, and multi-datacenter support. It is widely used for dynamic service registration, configuration management, and secure service-to-service communication.
When deployed using Portworx Data Services (PDS) on Kubernetes, Consul gains enhanced automation, persistent storage, integrated scaling, and simplified management through Kubernetes-native workflows. PDS streamlines deployment and operations for Consul across development and production environments.
PDS tracks upstream Consul Community Edition releases and ensures timely support for stable versions. Supported versions can be found here.
Like all PDS-managed services, Consul is deployed as a Kubernetes custom resource (consul) managed by the PDS Deployments Operator.
Clustering
Consul is deployed in clustered mode by default in PDS, ensuring high availability and consistency.
Key cluster benefits in PDS:
-
Nodes form a Gossip-based cluster and automatically discover each other using Kubernetes DNS and StatefulSets.
-
The RAFT protocol is used for consensus across server nodes.
-
PDS manages leader election and cluster health automatically.
Replication
Consul supports both data consistency and multi-node resilience:
Application-Level Replication
-
Key/value store and service catalog data is replicated across all server nodes using Raft consensus.
-
Leader writes are propagated safely to follower nodes, maintaining consistency.
Storage-Level Replication
-
PDS uses Portworx volumes to persist Consul’s data directory (/consul/data).
-
Volumes are replicated across Kubernetes nodes, ensuring data durability.
-
Enables rapid recovery and automatic failover if a pod or node fails.
This dual-layered approach enhances availability and reduces recovery time.
Configuration
Consul deployments in PDS can be configured flexibly through templates and environment variables. All configurations are handled declaratively and managed through PDS with no manual overhead. For a full list of configurable parameters, refer to the PDS Consul Configuration Reference.
Scaling
Consul in PDS supports both vertical and horizontal scaling:
Vertical Scaling
-
CPU and memory limits for each Consul pod can be adjusted dynamically.
-
Changes are rolled out automatically while preserving cluster health.
Horizontal Scaling
-
Add more server or client nodes to handle increased load.
-
Server nodes automatically participate in Raft consensus; client nodes connect seamlessly to the cluster.
PDS makes it easy to scale Consul clusters based on your infrastructure and application needs.
Connectivity
Consul pods in PDS are exposed via consistent and stable Kubernetes services:
Endpoints
Service Name | Details |
---|---|
con-<name>-<namespace>-<pod-id>-vip | Endpoint for each pod |
con-<name>-<namespace>-rr | Round Robin Endpoint to all pods |
-
The default pds user is created for API and UI access, and credentials are available in the PDS UI.
-
The Consul UI and HTTP API are exposed for management and automation purposes.
Consul supports integration with external services and workloads running both inside and outside the Kubernetes cluster.
Backups and Restore
PDS enables backup and restore of Consul data using volume-based snapshots.
Backups
-
Backups are created via Portworx snapshots of Consul’s persistent volume.
-
Backups can be scheduled or triggered on demand.
-
Snapshots are automatically copied to remote object storage, enabling offsite protection.
Restores
-
Restores are performed out-of-place.
-
A new Consul cluster is provisioned.
-
The snapshot is restored to the new instance, ensuring data safety and easy cloning.
This model supports flexible disaster recovery and test environment provisioning.
Monitoring
Consul deployments in PDS include built-in Prometheus exporters for rich observability. For the complete list of supported metrics and example usage, refer to the PDS Consul Metrics Reference.