server_kube

command
v1.34.1 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2022 License: Apache-2.0, Apache-2.0 Imports: 8 Imported by: 0

README

Kubernetes ConfigMap example

  • For production you would use docker and kubernetes. And use a ConfigMap mapped as a Volume in your service (see dflag/configmap for how/sample yaml files)
  • For local testing you can use Docker Desktop Or simply run from command line and simulate the changes
  • initialize empty tmp mapping mkdir -p /tmp/foobar for kubernetes
  • run the server go run .

you should see the following:

17:52:31 I updater.go:92> Now watching /tmp and /tmp/foobar
17:52:31 I updater.go:55> Configmap flag value watching initialized on /tmp/foobar
17:52:31 I updater.go:157> Starting watching
17:52:31 I http.go:58> Serving at: 0.0.0.0:8080

Should see this if successful: screenshot

And you can update the flags right there in the URL -or- change a value in the configmap directory:

echo "456" > /tmp/foobar/example_my_dynamic_int

you will see in the logs:

17:56:24 I updater.go:151> updating example_my_dynamic_int to "456\n"

And the value is changed on the url as well (the \n is ignored during int parsing) changed value sshot

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