View Source Kubereq.Kubeconfig.ServiceAccount (kubereq v0.1.5)
Pluggable step that builds the Kubeconfig using a Service Account's token for authentication.
When running the app inside a Kubernetes cluster, make sure RBAC is configured correctly and use this step. It reads the service account's JWC token and build the Kubeconfig accordingly.
Examples
step Kubereq.Kubeconfig.ServiceAccount
If your token is mounted at a different location than the default, pass its
location as :path_to_folder
.
step Kubereq.Kubeconfig.ServiceAccount, path_to_folder: "path/to/folder/with/token"
Options
path_to_folder
- (optional) Path to the folder where thetoken
,ca.crt
andnamespace
files of the service account are located. Defaults to"/var/run/secrets/kubernetes.io/serviceaccount"
:!
- (optional. And yes, that's a valid atom) Raise an exception if the config file is not found. Defaults tofalse
.