Skip to content

refactor: use admin API for node discovery in kubeadm-deployer#91

Merged
STRRL merged 1 commit intomasterfrom
deployer-with-admin-api
Mar 11, 2026
Merged

refactor: use admin API for node discovery in kubeadm-deployer#91
STRRL merged 1 commit intomasterfrom
deployer-with-admin-api

Conversation

@STRRL
Copy link
Copy Markdown
Owner

@STRRL STRRL commented Feb 23, 2026

Summary

  • Replace wondersdk (user-level /api/v1/nodes) with direct admin API calls (/admin/api/v1/wonder-nets/{id}/nodes) in the kubeadm-deployer Go binary
  • CLI flags changed from --api-key to --admin-token + --wonder-net-id
  • Remove API key creation step from run-demo.sh since admin token is already available
  • Update README to reflect the new flags and usage

Test plan

  • go build ./examples/kubeadm-deployer/... passes
  • go vet ./examples/kubeadm-deployer/... passes
  • run-demo.sh e2e test passes — 3-node Kubernetes cluster bootstrapped successfully

Replace wondersdk (user-level API) with direct admin API calls in the
kubeadm-deployer Go binary. The deployer now takes --admin-token and
--wonder-net-id flags instead of --api-key, and calls
GET /admin/api/v1/wonder-nets/{id}/nodes to discover mesh nodes.

This simplifies the demo flow by removing the API key creation step
from run-demo.sh, since the admin token is already available.
Copilot AI review requested due to automatic review settings February 23, 2026 06:03
@STRRL
Copy link
Copy Markdown
Owner Author

STRRL commented Feb 23, 2026

@codex PTAL

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the kubeadm-deployer example to use the Admin API directly instead of the wondersdk client library. This simplifies the authentication flow by using an admin token directly rather than requiring an intermediate API key creation step. The changes enable the deployer to discover nodes using admin privileges, which is appropriate for this administrative deployment use case.

Changes:

  • Replaced wondersdk client with direct HTTP calls to the Admin API for node discovery
  • Changed CLI authentication from --api-key to --admin-token + --wonder-net-id
  • Removed the API key creation step from the demo script, simplifying the setup process

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
examples/kubeadm-deployer/run-demo.sh Removed API key creation logic and updated kubeadm-deployer invocation to use new flags
examples/kubeadm-deployer/main.go Updated CLI flags from --api-key to --admin-token and --wonder-net-id, updated Config struct
examples/kubeadm-deployer/deployer/deployer.go Replaced wondersdk client with http.Client, added direct admin API implementation for health checks and node listing, updated Node struct definition
examples/kubeadm-deployer/README.md Updated documentation to reflect new API-based authentication flow and removed SDK usage examples

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@STRRL
Copy link
Copy Markdown
Owner Author

STRRL commented Feb 23, 2026

@codex review please

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@STRRL STRRL merged commit a11fee9 into master Mar 11, 2026
10 checks passed
@STRRL STRRL deleted the deployer-with-admin-api branch March 11, 2026 04:15
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.

2 participants