High Availability Kubecost
High availability mode is only officially supported on Kubecost Enterprise plans.
Running Kubecost in high availability (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.
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 who receive Queries in 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:
For example, using our Helm chart, the following is an acceptable configuration:
helm install kubecost kubecost/cost-analyzer --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 Enterprise tier
# Select a number of replicas of Kubecost pods to run
# Enable Leader/Follower Election