High Availability Kubecost
Running Kubecost in high availabilit (HA) mode is a feature that relies on multiple Kubecost replica pods implementing the ETL Bucket Backup feature combined with a Leader/Follower implementation which ensures that there always exists exactly one leader across all replicas.
Note: HA mode is only available in Kubecost Enterprise.
The Leader/Follower implementation leverages a
Leaseresource to manage the election of a leader when necessary. To control access of the backup from the ETL pipelines, a
RWStorageControlleris implemented to ensure the following:
- Followers block on all backup reads, and poll bucket storage for any backup reads every 30 seconds.
- Followers no-op on any backup writes.
- Followers which receive Queries into a backup store will not stack on pending reads, preventing external queries from blocking.
- Followers promoted to Leader will drop all locks and receive write privileges.
- Leaders behave identically to a single Kubecost install.
In order to enable the leader/follower and HA features, the following must also be configured:
- Replicas are set to a value greater than 1
- ETL FileStore is Enabled (enabled by default)
For example, using our Helm chart, the following is an acceptable configuration:
helm install --name kubecost --namespace kubecost \
--set kubecostDeployment.leaderFollower.enabled=true \
--set kubecostDeployment.replicas=5 \
This can also be done in the
values.yamlfile within the chart:
# ETL should be enabled with etlFileStoreEnabled: true
# ETL Bucket Backup should be configured by passing the configuration secret name
# Used for HA mode in Business & Enterprise tier
# Select a number of replicas of Kubecost pods to run
# Enable Leader/Follower Election