# `Kubereq.Kubeconfig.ServiceAccount`
[🔗](https://github.com/mruoss/kubereq/blob/v0.4.3/lib/kubereq/kubeconfig/service_account.ex#L1)

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 the `token`, `ca.crt`
  and `namespace` 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 to `false`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
