This is a reference implementation for a kubernetes controller to toggle LaunchDarkly flags via the API.
Go 1.12+ installed
Kubebuilder v2.0.0-alpha.4 - The binaries that are part of the release must be under /usr/local/kubebuilder/bin
.
You need a local or remote kubernetes cluster running. For local you can use kind
- Add the CRD definition to your cluster:
kubectly apply -f config/crd/bases/featureflags.launchdarkly.com_flagtoggles.yaml
- You need to have a LaunchDarkly API Key with
write
permissions. Once you get the key you can add it as an environment variable in your current environment with the keyLD_API_KEY
make run
will start the controller on your local machine and connect to kubernetes based on yourKUBECONFIG
environment variable.
sample-crd.yaml
is a sample that you can modify to match a field in your environment.