hello-controller-golang

command
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2019 License: Apache-2.0 Imports: 16 Imported by: 0

README

hello-controller (Golang implementation)

This is an golang implementation of a controller intended to demonstrate how to use whitebox-controller as golang library.

This controller reconciles Hello resource. When create a Hello resource, this controller outputs the value of message field and update status of the resource.

Build

Build a binary and a container image.

$ CGO_ENABLED=0 GOOS=linux go build -o hello-controller .
$ docker build -t summerwind/hello-controller:golang .

Deploy

Create controller resources that includes CRD, WebhookConfiguration, and Dployment.

$ kubectl apply -f manifests/controller.yaml

Test

Create a Hello resource.

$ kubectl apply -f manifests/hello.yaml
hello.whitebox.summerwind.dev/hello created

Verify that the Hello resource has been created.

$ kubectl get hello
NAME    AGE
hello   10s

hello-controller outputs the following log:

$ kubectl logs -n kube-system hello-controller-b85467859-fk8s5
...
2019/07/13 11:09:08 message: Hello World
...

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