Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add workload example for spot scaling from 0 with MNG #941

Merged
merged 1 commit into from
Sep 9, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 35 additions & 1 deletion examples/node-groups/managed-node-groups/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,43 @@ This following command used to update the `kubeconfig` in your local machine whe

$ kubectl get pods -n kube-system

#### Step 8: Deploy a pod on the spots nodegroups (spot_2vcpu_8mem and spot_4vcpu_16mem)

Remember:

- we created the spot_2vcpu_8mem nodegroup with a desired of 1 a min of 1 and a max of 2.
- we created the spot_4vcpu_16mem nodegroup with a desired of 0 a min of 0 and a max of 3.
- cluster-autoscaler is configured with priority expander with a priority on spot_2vcpu_8mem and then on spot_4vcpu_16mem and then any matching nodegroup

Create a deployment with kubernetes/nginx-spot.yaml, which request spot instance through it's node selector and tolerate them:

```bash
kubectl apply -f kubernetes/nginx-spot.yaml
```

If we scale the deployment, it will fullfill first the 2 nodes in the nodegroup spot_2vcpu_8mem

```bash
kubectl scale deployment/nginx-spot --replicas=10
```

If we scale again, it will need more nodes and will scale the nodegroup spot_4vcpu_16mem from 0.

```bash
kubectl scale deployment/nginx-spot --replicas=20
```

## Cleanup

To clean up your environment, destroy the Terraform modules in reverse order.
To clean up your environment, first remove your workloads:

```bash
kubectl delete -f kubernetes/nginx-spot.yaml
```

Node group spot_2vcpu_8mem will scale down to 1 and node group spot_2vcpu_16mem will scale down to 0.

then destroy the Terraform modules in reverse order.

Destroy the Kubernetes Add-ons, EKS cluster with Node groups and VPC

Expand Down