-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Michael Dresser <[email protected]> Co-authored-by: Steven Weber <[email protected]> Co-authored-by: Mike Murphy <[email protected]> Co-authored-by: Mike Murphy <mike@kubecost> Co-authored-by: Jason Charcalla <[email protected]> Co-authored-by: Michael Dresser <[email protected]> Co-authored-by: Thomas Nguyen <[email protected]> Co-authored-by: thomasvn <[email protected]> Co-authored-by: jesse goodier <[email protected]>
- Loading branch information
1 parent
c91c945
commit 75bf70f
Showing
46 changed files
with
821 additions
and
305 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
120 changes: 61 additions & 59 deletions
120
install-and-configure/advanced-configuration/high-availability.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,61 @@ | ||
# High Availability Kubecost | ||
|
||
{% hint style="info" %} | ||
High availability mode is only officially supported on Kubecost Enterprise plans. | ||
{% endhint %} | ||
|
||
Running Kubecost in high availability (HA) mode is a feature that relies on multiple Kubecost replica pods implementing the [ETL Bucket Backup](/install-and-configure/install/etl-backup/etl-backup.md) feature combined with a Leader/Follower implementation which ensures that there always exists exactly one leader across all replicas. | ||
|
||
## Leader + Follower | ||
|
||
The Leader/Follower implementation leverages a `coordination.k8s.io/v1` `Lease` resource to manage the election of a leader when necessary. To control access of the backup from the ETL pipelines, a `RWStorageController` is 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. | ||
|
||
![Leader/Follower](/images/leader-follower.png) | ||
|
||
## Configuring high availability | ||
|
||
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) | ||
* [ETL Bucket Backup](/install-and-configure/install/etl-backup/etl-backup.md) is configured | ||
|
||
For example, using our Helm chart, the following is an acceptable configuration: | ||
|
||
```bash | ||
helm install kubecost kubecost/cost-analyzer --namespace kubecost \ | ||
--set kubecostDeployment.leaderFollower.enabled=true \ | ||
--set kubecostDeployment.replicas=5 \ | ||
--set kubecostModel.etlBucketConfigSecret=kubecost-bucket-secret | ||
``` | ||
|
||
This can also be done in the `values.yaml` file within the chart: | ||
|
||
```yaml | ||
kubecostModel: | ||
image: "gcr.io/kubecost1/cost-model" | ||
imagePullPolicy: Always | ||
# ... | ||
# ETL should be enabled with etlFileStoreEnabled: true | ||
etl: true | ||
etlFileStoreEnabled: true | ||
# ... | ||
# ETL Bucket Backup should be configured by passing the configuration secret name | ||
etlBucketConfigSecret: kubecost-bucket-secret | ||
|
||
# Used for HA mode in Enterprise tier | ||
kubecostDeployment: | ||
# Select a number of replicas of Kubecost pods to run | ||
replicas: 5 | ||
# Enable Leader/Follower Election | ||
leaderFollower: | ||
enabled: true | ||
``` | ||
# High Availability Kubecost | ||
|
||
{% hint style="warning" %} | ||
High availability mode is no longer supported as of Kubecost 2.0. | ||
{% endhint %} | ||
|
||
{% hint style="info" %} | ||
High availability mode is only officially supported on Kubecost Enterprise plans. | ||
{% endhint %} | ||
|
||
Running Kubecost in high availability (HA) mode is a feature that relies on multiple Kubecost replica pods implementing the [ETL Bucket Backup](/install-and-configure/install/etl-backup/etl-backup.md) feature combined with a Leader/Follower implementation which ensures that there always exists exactly one leader across all replicas. | ||
|
||
## Leader + Follower | ||
|
||
The Leader/Follower implementation leverages a `coordination.k8s.io/v1` `Lease` resource to manage the election of a leader when necessary. To control access of the backup from the ETL pipelines, a `RWStorageController` is 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. | ||
|
||
## Configuring high availability | ||
|
||
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) | ||
* [ETL Bucket Backup](/install-and-configure/install/etl-backup/etl-backup.md) is configured | ||
|
||
For example, using our Helm chart, the following is an acceptable configuration: | ||
|
||
```bash | ||
helm install kubecost kubecost/cost-analyzer --namespace kubecost \ | ||
--set kubecostDeployment.leaderFollower.enabled=true \ | ||
--set kubecostDeployment.replicas=5 \ | ||
--set kubecostModel.etlBucketConfigSecret=kubecost-bucket-secret | ||
``` | ||
|
||
This can also be done in the `values.yaml` file within the chart: | ||
|
||
```yaml | ||
kubecostModel: | ||
image: "gcr.io/kubecost1/cost-model" | ||
imagePullPolicy: Always | ||
# ... | ||
# ETL should be enabled with etlFileStoreEnabled: true | ||
etl: true | ||
etlFileStoreEnabled: true | ||
# ... | ||
# ETL Bucket Backup should be configured by passing the configuration secret name | ||
etlBucketConfigSecret: kubecost-bucket-secret | ||
|
||
# Used for HA mode in Enterprise tier | ||
kubecostDeployment: | ||
# Select a number of replicas of Kubecost pods to run | ||
replicas: 5 | ||
# Enable Leader/Follower Election | ||
leaderFollower: | ||
enabled: true | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -116,7 +116,15 @@ Use [your browser's devtools](https://developer.chrome.com/docs/devtools/network | |
|
||
### Option 2: Review logs, and decode your JWT tokens | ||
|
||
If `kubecostAggregator.enabled` is `true` or unspecified in `values.yaml`: | ||
```sh | ||
kubectl logs statefulsets/kubecost-aggregator | ||
kubectl logs deploy/kubecost-cost-analyzer | ||
``` | ||
|
||
If `kubecostAggregator.enabled` is `false` in `values.yaml`: | ||
```sh | ||
kubectl logs services/kubecost-aggregator | ||
kubectl logs deploy/kubecost-cost-analyzer | ||
``` | ||
|
||
|
@@ -133,6 +141,10 @@ kubecostModel: | |
extraEnv: | ||
- name: LOG_LEVEL | ||
value: debug | ||
kubecostAggregator: | ||
extraEnv: | ||
- name: LOG_LEVEL | ||
value: debug | ||
``` | ||
|
||
For further assistance, reach out to [email protected] and provide both logs and a [HAR file](https://support.google.com/admanager/answer/10358597?hl=en). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.