Skip to main content
Version: v0.28.1

Kubernetes configmaps

The Kubernetes Retriever will access flags in a Kubernetes ConfigMap via the Kubernetes Go client

Example

import (
restclient "k8s.io/client-go/rest"
)

config, _ := restclient.InClusterConfig()
err = ffclient.Init(ffclient.Config{
PollingInterval: 3 * time.Second,
Retriever: &k8sretriever.Retriever{
Path: "file-example.yaml",
Namespace: "default"
ConfigMapName: "my-configmap"
Key: "somekey.yml"
ClientConfig: &config
},
})
defer ffclient.Close()

Configuration fields

To configure your retriever:

FieldDescription
NamespaceThe namespace of the ConfigMap.
ConfigMapNameThe name of the ConfigMap.
KeyThe key within the ConfigMap storing the flags.
ClientConfigThe configuration object for the Kubernetes client

Get the latest GO Feature Flag updates