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

Allow to register a cluster with one command #229

Merged
merged 1 commit into from
Apr 17, 2024

Conversation

gianlucam76
Copy link
Member

The sveltosctl register command is used to register a cluster. It requires a Kubeconfig to be passed.

If user has a kubeconfig with multiple contexts, the option fleet-cluster-context allows to specify the context for the cluster to be managed.

So with default context pointing to the management cluster, following command will:

  1. create a ServiceAccount in the managed cluster (using cluster-1 context)
  2. grant this ServiceAccount cluster-admin permission
  3. create a TokenRequest for such account and a Kubeconfig with bearer token from the TokenRequest
  4. create a SveltosCluster in the management cluster (so using default context) and a Secret with kubeconfig generated in the step above
sveltosctl register cluster --namespace=gcp --cluster=cluster-1 --fleet-cluster-context=cluster-1 --labels=k1=v1,k2=v2

The sveltosctl register command is used to register a cluster.
It requires a Kubeconfig to be passed.

If user has a kubeconfig with multiple contexts, the option __fleet-cluster-context__
allows to specify the context for the cluster to be managed.

So with default context pointing to the management cluster, following command will:
1. create a ServiceAccount in the managed cluster (using cluster-1 context)
2. grant this ServiceAccount cluster-admin permission
3. create a TokenRequest for such account and a Kubeconfig with bearer token from the TokenRequest
4. create a SveltosCluster in the management cluster (so using default context) and a Secret
with kubeconfig generated in the step above

```
sveltosctl register cluster --namespace=gcp --cluster=cluster-1 --fleet-cluster-context=cluster-1 --labels=k1=v1,k2=v2
```
@gianlucam76 gianlucam76 merged commit fa61537 into projectsveltos:dev Apr 17, 2024
2 checks passed
@gianlucam76 gianlucam76 deleted the register-generate branch April 17, 2024 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant