Skip to content

Commit

Permalink
update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
iloveicedgreentea committed Oct 1, 2021
1 parent 677c872 commit bfe6265
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 19 deletions.
12 changes: 9 additions & 3 deletions cloudfunctions/backup/Readme.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
BACKUP_FILE_NAME - The basename of the backup file. Assumes zip. Don't include file extension.
BUCKET_NAME - the destination backup bucket
BUCKET_NAME_DR - secondary bucket to write to for DR. The valheim SA should not have access to this
# Backup

This CF will perform a daily backup and optionally copy it to a secondary bucket.

## Env Vars

* BACKUP_FILE_NAME - The basename of the backup file. Assumes zip. Don't include file extension.
* BUCKET_NAME - the destination backup bucket
* BUCKET_NAME_DR - secondary bucket to write to for DR. The valheim SA should not have access to this
19 changes: 8 additions & 11 deletions cloudfunctions/scaledown/Readme.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
# GKE Scaler

Scales a node pool to 0 when it is inactive based on cluster metrics
Scales a node pool to 0 when it is inactive based on pod CPU metrics

## Requirements

a baseline of metrics (typical metrics when cluster is idle, cpu/mem)
cluster name
node pool name
desired scale up (1 for stateful services like games)
* You must gather a baseline of CPU metrics - it is expressed in CPU/s e.g `0.2`

## Env vars
"CLUSTER_NAME"
"PROJECT_ID"
"NODEPOOL_NAME"
"LOCATION"
CONTAINER_NAME
METRICS_BASELINE - This number should be a float which is the value when your server is idle based on the avg last 10 min. Use metrics explorer to find the cpu usage for an avg of 10m when no players are on. The upper bound should be the avg when 1 player is on. E.g "0.2" which means scale down the node pool to 0 when the pod CPU usage is 0.2 for last 10 min
* CLUSTER_NAME
* PROJECT_ID
* NODEPOOL_NAME
* LOCATION
* CONTAINER_NAME
* METRICS_BASELINE - This number should be a float which is the value when your server is idle based on the avg last 10 min. Use metrics explorer to find the cpu usage for an avg of 10m when no players are on. The upper bound should be the avg when 1 player is on. E.g "0.2" which means scale down the node pool to 0 when the pod CPU usage is 0.2 for last 10 min
10 changes: 5 additions & 5 deletions cloudfunctions/scaleup/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

Scales the cluster up based on invocation.

If invoked, and the cluster is at 0, it will scale it to 1. Could be event driven or HTTP based cloudfunction.
If invoked, and the cluster is at 0, it will scale it to 1.


## Env vars
"CLUSTER_NAME"
"PROJECT_ID"
"NODEPOOL_NAME"
"LOCATION"
* CLUSTER_NAME
* PROJECT_ID
* NODEPOOL_NAME
* LOCATION

0 comments on commit bfe6265

Please sign in to comment.