Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

📖 More better doc of hosting context extension #252

Merged
merged 1 commit into from
May 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions docs/users.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,18 @@ to switch the context back to the hosting cluster context, you may use the `ctx`
kflex ctx
```

That command requires your kubeconfig file to hold an extension that `kflex init` created to hold the name of the hosting cluster context. See [below](#hosting-context) for more information.

To switch back to a control plane context, use the
`ctx <control plane name>` command, e.g:

```shell
kflex ctx cp1
```

If there is not currently a kubeconfig context named for that control plane then that command requires your kubeconfig file to hold an extension that `kflex init` created to hold the name of the hosting cluster context. See [below](#hosting-context) for more information.


The same result can be accomplished with kubectl by using the `ControlPlane`` CR, for example:


Expand Down Expand Up @@ -680,12 +685,12 @@ example:
kflex create cp1 -p hello --set version=0.1.0 --set message=hello
```

## Initial Context
## Hosting Context

The KubeFlex CLI (kflex) relies on the extensions field in the kubeconfig
file to store the initial context of the hosting cluster. This context is
file to store the name of the context that `kflex init` created for accessing the hosting cluster. This context is
needed for kflex to switch back to the hosting cluster when performing
lifecycle operations.
lifecycle operations and, in some cases, to lookup information about a given control plane.

If the extensions field is deleted or overwritten by other apps, you
need to restore it manually in the kubeconfig file. Otherwise, kflex
Expand Down