diff --git a/README.md b/README.md index 671bbf9..7a4db75 100644 --- a/README.md +++ b/README.md @@ -108,4 +108,13 @@ The logic is implemented [here](./internal/kubeconfig/kubeconfig.go) in `IsExpor The basic idea is: - we have a cluster in kubeconfig with the same endpoint - - that cluster is referenced in a `context` block (see [Organizing Cluster Access Using kubeconfig Files](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#context)) + - that cluster is referenced in a `context` block (see [Organizing Cluster Access Using kubeconfig Files][kubeconfig-context]) + + +### Configur context name with `--context-name-alias` + +The [kubeconfig context][kubeconfig-context] is used to identify a cluster and user pair, with the `--context-name-alias` you can provide a go template that will be +used to generate the name of the context. In the template you have access to the [Cluster struct](https://github.com/mateimicu/kdiscover/blob/master/internal/cluster/cluster.go#L23). The default template is `{{.Name}}`. + + +[kubeconfig-context]: https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#context