Skip to content

Commit

Permalink
Merge pull request #45 from kubecost/mmd/update-to-2.0.0
Browse files Browse the repository at this point in the history
Update cluster-turndown to v2.0.0
  • Loading branch information
michaelmdresser authored May 27, 2022
2 parents 65eb360 + 7f748d5 commit 5d0057e
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
18 changes: 16 additions & 2 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Development

## Building development images

```sh
export TDTAG="dockerregistry.example.com/cluster-turndown:X.Y.Z"
docker build -t "${TDTAG}" .
docker push "${TDTAG}"

# Then update the image in your cluster
kubectl set image \
-n turndown \
deployment/cluster-turndown \
cluster-turndown="${TDTAG}"
```

## Generating turndown schedule CRD code

To re-generate the code for the defined CRDs, do the following:
Expand All @@ -11,8 +25,8 @@ The script is based on https://github.com/kubernetes/sample-controller, specific

## Cutting a release

1. Call `update-version.sh VERSION`, e.g. `./update-version.sh 1.3.0`
2. Build and push the new image to GCR (`make release`)
1. Call `update-version.sh VERSION`, e.g. `./update-version.sh X.Y.Z`
2. Build and push the new image to GCR (`make VERSION=X.Y.Z release`)
3. Merge the changes
4. Tag a new release off of `develop` for the new version
5. Manually upload `artifacts/cluster-turndown-full.yaml` and `scripts/gke-create-service-key.sh` to the GitHub Release created by the tag
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION=1.3.0
VERSION=2.0.0
REGISTRY=gcr.io
PROJECT_ID=kubecost1
APPNAME=cluster-turndown
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Cluster Turndown
Cluster Turndown is an automated scaledown and scaleup of a Kubernetes cluster's backing nodes based on a custom schedule and turndown criteria. This feature can be used to reduce spend during down hours and/or reduce surface area for security reasons. The most common use case is to scale non-prod environments (e.g. dev clusters) to zero during off hours. The project currently suppoorts clusters on GKE, EKS, and kops on AWS.

> :warning: If you are upgrading from a pre-2.0.0 version of cluster-turndown, you will have to migrate your custom resources. `turndownschedules.kubecost.k8s.io` has been changed to `turndownschedules.kubecost.com` and `finalizers.kubecost.k8s.io` has been changed to `finalizers.kubecost.com`. See https://github.com/kubecost/cluster-turndown/pull/44 for an explanation. :warning:
**Note: Cluster Turndown is currently in _ALPHA_**

### GKE Setup
Expand Down
2 changes: 1 addition & 1 deletion artifacts/cluster-turndown-full.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ spec:
spec:
containers:
- name: cluster-turndown
image: gcr.io/kubecost1/cluster-turndown:1.3.0
image: gcr.io/kubecost1/cluster-turndown:2.0.0
volumeMounts:
- name: turndown-keys
mountPath: /var/keys
Expand Down

0 comments on commit 5d0057e

Please sign in to comment.