MCPcopy Index your code
hub / github.com/GoogleCloudPlatform/konlet

github.com/GoogleCloudPlatform/konlet @v.0.13.5

Chat with this repo
repository ↗ · DeepWiki ↗ · release v.0.13.5 ↗ · + Follow
201 symbols 602 edges 17 files 24 documented · 12%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Compute Engine Container Startup Agent

The Compute Engine container startup agent starts a container deployed on a VM instance using Deploying Containers on VMs and Managed Instance Groups method.

The agent parses container declaration that is stored in VM instance metadata under gce-container-declaration key and starts the container with the declared configuration options.

The agent is bundled with Container-Optimized OS image, version 62 or higher.

Building the agent

Container startup agent is deployed as a Docker container and is hosted in Container Registry: gcr.io/gce-containers/konlet.

To build the agent using bazel run this command from the repository root:

$ bazel build gce-containers-startup

Export your GCP project name to an environment variable:

$ export MY_PROJECT=your-project-name

To build a Docker image, copy the build binary to the 'docker' directory and invoke the docker build command:

$ cp bazel-bin/gce-containers-startup/gce-containers-startup docker/
$ docker build docker/ -t gcr.io/$MY_PROJECT/gce-containers-startup

To push resulting Docker image to Google Container Registry you can use gcloud command:

$ gcloud docker -- push gcr.io/$MY_PROJECT/gce-containers-startup

Usage

If you would like to install the container startup agent on your VM, copy its systemd service definition and scripts:

  • Copy systemd service definition konlet-startup.service into systemd services directory, e.g. /usr/lib/systemd/system.

  • Copy get_metadata_value script to /usr/share/google directory.

  • Copy konlet-startup script to /var/lib/google directory

You can also those scripts directly by a startup script, cloud-init or rc.d scripts.

License

Compute Engine container startup agent is licensed under Apache License 2.0. The license is available in the LICENSE file.

You can find out more about the Apache License 2.0 at: http://www.apache.org/licenses/LICENSE-2.0.

Extension points exported contracts — how you extend this code

AuthProvider (Interface)
(no doc) [2 implementers]
gce-containers-startup/utils/auth.go
OsCommandRunner (Interface)
(no doc) [2 implementers]
gce-containers-startup/volumes/volumes.go
Provider (Interface)
(no doc) [2 implementers]
gce-containers-startup/metadata/provider.go
OsCommandRunner (Interface)
(no doc) [2 implementers]
gce-containers-startup/runtime/runtime.go
FileWriterInterface (Interface)
(no doc) [2 implementers]
gce-containers-startup/utils/welcome-message.go
DockerApiClient (Interface)
(no doc) [1 implementers]
gce-containers-startup/runtime/runtime.go
LoggerInterface (Interface)
(no doc) [2 implementers]
gce-containers-startup/utils/welcome-message.go

Core symbols most depended-on inside this repo

OutputOnCall
called by 67
gce-containers-startup/command/mock_runner.go
RegisterMkdirAll
called by 14
gce-containers-startup/command/mock_runner.go
PrepareVolumesAndGetBindings
called by 13
gce-containers-startup/volumes/volumes.go
RegisterDeviceForStat
called by 12
gce-containers-startup/command/mock_runner.go
AssertAllCalled
called by 10
gce-containers-startup/command/mock_runner.go
Print
called by 9
gce-containers-startup/utils/welcome-message.go
AssertEqual
called by 8
gce-containers-startup/utils/testing.go
Run
called by 8
gce-containers-startup/runtime/runtime.go

Shape

Function 92
Method 72
Struct 28
Interface 7
FuncType 1
TypeAlias 1

Languages

Go100%

Modules by API surface

gce-containers-startup/gce-containers-startup_test.go37 symbols
gce-containers-startup/volumes/volumes.go30 symbols
gce-containers-startup/runtime/runtime.go25 symbols
gce-containers-startup/command/mock_runner.go21 symbols
gce-containers-startup/volumes/volumes_test.go18 symbols
gce-containers-startup/utils/utils_test.go14 symbols
gce-containers-startup/utils/welcome-message.go11 symbols
gce-containers-startup/types/api.go9 symbols
gce-containers-startup/utils/auth.go7 symbols
gce-containers-startup/metadata/provider.go7 symbols
gce-containers-startup/utils/testing.go4 symbols
gce-containers-startup/utils/iptables.go4 symbols

For agents

$ claude mcp add konlet \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact