Skip to content

Commit

Permalink
Merge pull request #32 from mateimicu/document-alias
Browse files Browse the repository at this point in the history
  • Loading branch information
mateimicu authored May 14, 2020
2 parents 1fbc878 + 3543575 commit 5037f8d
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 5037f8d

Please sign in to comment.