GoogleCloudPlatform / GoogleCloudPlatform/konlet

Make konlet safe to re-run multiple times

Open
#54 2 comments 1 reaction 0 assignees View on GitHub
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.