GoogleCloudPlatform / GoogleCloudPlatform/konlet
Make konlet safe to re-run multiple times
- Dominant language
- Go
- Stars
- 88
- Forks
- 24
- PR merge metrics
- No merged PRs in 30d
Description
## The issue
Currently `konlet` successfully re-fetches and applies new config from `gce-container-declaration` when running the following command:
```
docker run --rm --privileged \
--log-driver=json-file \
--net="host" \
-v=/var/run/docker.sock:/var/run/docker.sock \
-v=/etc/profile.d:/host/etc/profile.d \
-v=/dev:/dev \
-v=/mnt:/mnt \
-v=/proc:/host_proc \
"gcr.io/gce-containers/konlet:v.0.9-latest"
```
The command has been obtained from [konlet-startup](https://github.com/GoogleCloudPlatform/konlet/blob/f441be929429d31645cdb2e1fc3ac7ed68e95395/scripts/konlet-startup) script.
But it doesn't clean up `iptables` entries set by the previous runs. So `iptables -L -n` show duplicate entries on subsequent `konlet` runs.
## The solution
Properly clean up all the resources acquired by the previous run when `konlet` is executed again. This will allow faster update of container image without the need to restart the VM instance.
Contributor guide
Research direction
Start with scripts/konlet-startup and trace how the konlet container applies configuration and creates iptables entries. Re-run the documented docker command to observe duplicate rules, then identify the resources that must be cleaned up before applying new configuration. Done means repeated runs update the configuration without leaving duplicate iptables entries.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- devops, infrastructure
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100