example-controller

command module
v0.0.0-...-f7aa2fe Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 3, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

README

Example Controller

A simple example of a Kubernetes controller written in Golang.

What it does is whenever a new Deployment is created in "default" namespace, it will expose the Deployment by creating a Service and an Ingress.

Kubernetes Controller Diagram

See also: client-go under the hood

How to run?

go build -o bin/example-controller

bin/example-controller \
    --kubeconfig=$HOME/.kube/config \
    --workers 2 \
    --namespace default

Open another terminal and create a Deployment:

kubectl create -f ./example/deployment.yaml

Watch the logs of the controller.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL