mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 17:08:53 +00:00
Add some oneliners for cleaning up fleet sandbox (#7043)
This commit is contained in:
parent
af5a1c7d2c
commit
b2d94b1cc5
1 changed files with 16 additions and 0 deletions
|
|
@ -13,3 +13,19 @@ If you require changes beyond whats described here, contact @zwinnerman-fleetdm.
|
|||
1. module.shared-infrastructure.kubernetes_manifest.targetgroupbinding is bugged sometimes, if it gives issues just comment it out
|
||||
1. on a fresh apply, module.shared-infrastructure.aws_acm_certificate.main will have to be targeted first, then a normal apply can follow
|
||||
1. If errors happen, see if applying again will fix it
|
||||
|
||||
### Maintenance commands
|
||||
#### Referesh fleet instances
|
||||
```bash
|
||||
for i in $(aws dynamodb scan --table-name sandbox-prod-lifecycle | jq -r '.Items[] | select(.State.S == "unclaimed") | .ID.S'); do helm uninstall $i; aws dynamodb delete-item --table-name sandbox-prod-lifecycle --key "{\"ID\": {\"S\": \"${i}\"}}"; done
|
||||
```
|
||||
|
||||
#### Cleanup instances that are running, but not tracked
|
||||
```bash
|
||||
for i in $((aws dynamodb scan --table-name sandbox-prod-lifecycle | jq -r '.Items[] | .ID.S'; aws dynamodb scan --table-name sandbox-prod-lifecycle | jq -r '.Items[] | .ID.S'; helm list | tail -n +2 | cut -f 1) | sort | uniq -u); do helm uninstall $i; done
|
||||
```
|
||||
|
||||
#### Cleanup instances that failed to provision
|
||||
```bash
|
||||
for i in $(aws dynamodb scan --table-name sandbox-prod-lifecycle | jq -r '.Items[] | select(.State.S == "provisioned") | .ID.S'); do helm uninstall $i; aws dynamodb delete-item --table-name sandbox-prod-lifecycle --key "{\"ID\": {\"S\": \"${i}\"}}"; done
|
||||
```
|
||||
|
|
|
|||
Loading…
Reference in a new issue