go

command
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

README

Example Go Controller

This controller doesn't do anything useful. It's just an example skeleton for writing Metacontroller hooks with Go.

WARNING

There's a known issue that makes it difficult to produce JSON according to the rules that Metacontroller requires if you import the official Go structs for Kubernetes APIs. In particular, some fields will always be emitted, even if you never set them, which goes against Metacontroller's apply semantics.

Prerequisites

Install Thing Controller

kubectl apply -f thing-controller.yaml

Create a Thing

kubectl apply -f my-thing.yaml

Look at the thing:

kubectl get thing -o yaml

Look at the thing the thing created:

kubectl get pod thing-1 -a

Look at what the thing the thing created said:

kubectl logs thing-1

Clean up

kubectl delete -f thing-controller.yaml

Building

You don't need to build to run the example above, but if you make changes:

go get -u github.com/golang/dep/cmd/dep
dep ensure
go build -o thing-controller

Or just make a new container image:

docker build . -t <yourname>/thing-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