k8s-leader-election

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

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

Go to latest
Published: Dec 21, 2021 License: MIT Imports: 12 Imported by: 0

README

k8s-leader-election

Leader election example leveraging the leaderelection pkg from the k8s client.

Usage

  1. Create a k3d cluster: make cluster
  2. Deploy the leader-election app: make deploy
  3. Get the current lease holder:

kubectl get lease leader-election -o=jsonpath='{.spec.holderIdentity}'

  1. Kill the current lease holder:

kubectl delete pod $(kubectl get lease leader-election -o=jsonpath='{.spec.holderIdentity}')

  1. After waiting the leaseDuration period (60s) a new leader will be elected.

License

MIT

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