Skip to content

[FEAT cloudctl] - bootstrap procedure #80

Description

@uwe-mayer

Priority

None

User Story

As a Greenhouse operator I need to bootstrap cloudctl, aka. I need first time connectivity to Greenhouse to be able to access all onboarded Clusters

Description

Provide a cloudctl bootstrap command for first-time Greenhouse cluster access. The command merges a Greenhouse-scoped kubeconfig into the user's local kubeconfig interactively, then suggests the next step.

The command must support two input modes so the Web UI can show both:

Mode 1 — individual flags (readable, scriptable):
```bash
cloudctl bootstrap
--greenhouse-server=https://greenhouse.example.com
--greenhouse-org=my-org
--greenhouse-token=
--greenhouse-ca-data=
```

Mode 2 — single base64 blob (one-liner, easy to copy-paste from UI):
```bash
cloudctl bootstrap --data=
```

Both modes open an interactive prompt locally: ask for the context name to use, ask whether to set it as the new default context, then write the result to the local kubeconfig.

After a successful bootstrap the command prints a next-step suggestion:
```
Bootstrap complete. Run cloudctl sync -n my-org to pull in your cluster access.
```

Acceptance Criteria

  • cloudctl bootstrap --data=<base64-blob> decodes and merges the Greenhouse kubeconfig
  • cloudctl bootstrap --greenhouse-server / --greenhouse-org / --greenhouse-token / --greenhouse-ca-data works as an alternative input mode
  • Interactive prompt asks for the context name (default: greenhouse-<org>) and whether to set it as the current context
  • Merged entry is written to the local kubeconfig (~/.kube/config by default, overridable with --kubeconfig)
  • Existing unmanaged kubeconfig entries are never overwritten
  • Command is idempotent: running it twice with the same input is safe
  • --dry-run shows what would be written without touching the file
  • After success, a next-step hint is printed: cloudctl sync -n <org>
  • It is possible to access the Greenhouse api-server for cloudctl if the user has the correct permissions and groups in the upstream IdP

Out of Scope (handled on the Greenhouse side)

Reference Issues

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

backlogReady for sprint planning; triggers project additionfeatureNew functional capabilities or significant additions to the CLI.

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions