Developing Kubeflex
Prereqs
- go version >= go1.24.5
- git
- make
- gcc
- docker
- kind
Make sure that ${HOME}/go/bin is in your $PATH.
How to build kubeflex from source
Clone the repo, set up upstream remote, fetch tags, build the binaries and add them to your path:
# Clone your fork – command only shown for HTTPS; adjust the URL if you prefer SSH
git clone https://github.com/<your-username>/kubeflex.git
cd kubeflex
# Add the upstream repository as a remote (adjust the URL if you prefer SSH)
git remote add upstream https://github.com/kubestellar/kubeflex.git
# Fetch all tags from upstream
git fetch upstream --tags
# Build the binaries
make build-all
# Add binaries to your path
export PATH=$(pwd)/bin:$PATH
Note: Fetching tags from upstream is important as the version information for KubeFlex binaries is derived from git tags. Without the tags, commands like
kflex init -c(which initializes KubeFlex and creates a kind cluster) will not work correctly.
Setting Up a Testing Cluster for KubeFlex
To prepare a hosting cluster for testing, execute the following script. This script accomplishes several key tasks:
- Creates a new kind cluster specifically designed for the KubeFlex hosting environment.
- Configures nginx ingress with SSL passthrough capabilities to ensure secure communication.
- Builds and loads the KubeFlex Controller Manager image into the kind cluster.
- Installs a PostgreSQL database, providing the default backend for hosted API servers.
- Starts the KubeFlex controller manager.
test/e2e/setup-kubeflex.sh
Locally building cmupdate image
make ko-build-local-cmupdate
Manually building and publishing cmupdate image
LATEST_TAG=<tag used for image> make ko-build-push-cmupdate
Steps to make release
-
Delete branch “brew” from https://github.com/kubestellar/kubeflex, if there is such a branch.
-
Make sure that the
go-versionparameter ofactions/setup-goin.github/workflows/goreleaser.ymlis high enough. It is enough that its minor version is not below the ingo.mod. -
git checkout mainand make sure it (a) equalsmainin https://github.com/kubestellar/kubeflex and (b) is what you want to release. -
check existing tags e.g.,
git tag v0.1.0 v0.1.1 v0.2.0 ... v0.3.1 -
create a new tag e.g.
git tag v0.3.2 -
Push the tag upstream
git push upstream --tag v0.3.2Wait until goreleaser completes the release process.
-
Invoke the E2E test workflow on the release just made (e.g, using the GitHub web UI). See if it succeeds. If not then there is a problem that needs to be remedied and a newer release made.
-
The goreleaser workflow will also create a branch named
brewwith some changes (to the homebrew instsall script) that need to get merged intomain. Make a PR to mergebrewintomain, and get it approved and merged. -
To avoid leaving a time bomb, delete that
brewbranch after it was merged intomain(the goreleaser will fail to create the newbrewbranch if already exists).