The Bare Metal Cloud API Provider for Kubernetes allows developers to define, deploy, and manage Bare Metal Cloud servers to provision, upgrade and operate Kubernetes clusters.
Bare Metal Cloud • Developers Portal • API Documentation • Knowledge Base • Support
You need to have a Bare Metal Cloud account to use this Kubernetes Cluster API.
- Go to the Bare Metal Cloud signup page.
- Follow the prompts to set up your account.
- Use your credentials to log in to the Bare Metal Cloud portal.
-
Install and/or configure Kubernetes cluster (1.23+). Cluster API requires an existing Kubernetes cluster accessible via kubectl.
-
Initialize BMC clusterctl management cluster. See Avoiding GitHub rate limiting if you're experiencing errors from GitHub.
export BMC_CLIENT_ID=<bmc client id> export BMC_CLIENT_SECRET=<bmc client secret> # Initialize the management cluster clusterctl init --infrastructure bmc --config clusterctl.yaml
-
Generate the cluster configuration. This creates a files called
capi-quickstart.yaml
with predefined list of Cluster API objects.export BMC_CONTROL_PLANE_MACHINE_TYPE=s2.c1.medium # server type of the control plane export BMC_LOCATION=PHX # location of cluster export BMC_NODE_TYPE=s2.c1.medium # server types of the node # Optional variables export CNI_VERSION=1.1.1 # version number for Container Network Interface (https://github.com/containernetworking/cni) export CONTAINERD_VERSION=1.4.4 # version number for Containerd (https://github.com/containerd/containerd) export CRI_VERSION=1.25.0 # version number for Kubernetes Container Runtime Interface (https://github.com/kubernetes-sigs/cri-tools/) export RUNC_VERSION=1.1.4 # version number for runc (https://github.com/opencontainers/runc) # Generate the cluster configuration clusterctl generate cluster capi-quickstart \ --kubernetes-version 1.25.0 \ --worker-machine-count=3 \ > capi-quickstart.yaml
-
Apply the cluster configuration
kubectl apply -f capi-quickstart.yaml
-
Access the workload cluster.
# The cluster will now start provisioning. You can check status with: kubectl get cluster # You can also get an “at glance” view of the cluster and its resources by running: clusterctl describe cluster capi-quickstart # To verify the first control plane is up: kubectl get kubeadmcontrolplane
-
Once the control plane is initialized, you can retrieve the workload cluster Kubeconfig.
# Control plane initialized kubectl get kubeadmcontrolplane NAME CLUSTER INITIALIZED API SERVER AVAILABLE REPLICAS READY UPDATED UNAVAILABLE AGE VERSION capi-quickstart-g2trk capi-quickstart true 1 1 1 4m7s v1.25.0
# Workload cluster Kubeconfig clusterctl get kubeconfig capi-quickstart > capi-quickstart.kubeconfig
-
Deploy a CNI solution (control plane won't be
Ready
till a CNI is installed)# Ex. deploying calico kubectl --kubeconfig=./capi-quickstart.kubeconfig \ apply -f https://raw.githubusercontent.com/projectcalico/calico/v3.24.1/manifests/calico.yaml
-
Verify nodes are in a
Ready
status.kubectl --kubeconfig=./capi-quickstart.kubeconfig get nodes NAME STATUS ROLES AGE VERSION capi-quickstart-g2trk-9xrjv Ready control-plane 12m v1.25.0 capi-quickstart-md-0-55x6t-5649968bd7-8tq9v Ready <none> 12m v1.25.0 capi-quickstart-md-0-55x6t-5649968bd7-glnjd Ready <none> 12m v1.25.0 capi-quickstart-md-0-55x6t-5649968bd7-sfzp6 Ready <none> 12m v1.25.0
-
Clean up workload cluster
kubectl delete cluster capi-quickstart
The Bare Metal Cloud Cluster API is available as a Docker image here.
- Create a GitHub annotated tag
export RELEASE_TAG=<the tag of the release to be cut>
(eg.export RELEASE_TAG=v1.0.1
)git tag -a ${RELEASE_TAG} -m ${RELEASE_TAG}
git tag test/${RELEASE_TAG}
(:warning: MUST NOT be an annotated tag)
- Push the tag to the GitHub repository. This will automatically trigger a Github Action to create a draft release.
NOTE:
origin
should be the name of the remote pointing togithub.com/phoenixnap/cluster-api-provider-bmc
git push origin ${RELEASE_TAG}
git push origin test/${RELEASE_TAG}
- Images are built by a Github Action. This pushes the image to the GitHub Packages
- Review the draft release on GitHub.
- Publish the release
- Log in to the Bare Metal Cloud portal.
- On the left side menu, click on API Credentials.
- Click the Create Credentials button.
- Fill in the Name and Description fields, select the permissions scope and click Create.
- In the table, click on Actions and select View Credentials from the dropdown.
💡 Tutorial: How to create and manage BMC credentials
Be careful moving this repository. This project is written in Go and as such uses Git repo URLs as package identifiers. If the code URL is changed the code will need to be changed appropriately.
This is a kubebuilder
project. Only minimal changes have been made to this codebase from the generated scaffolding so that maintainers can leverage as much off-the-shelf tooling and documentation as possible from the kubebuilder
project. The bulk of the application code lives in the machine and cluster controller files,controllers/bmcmachine_controller.go
and controllers/bmccluster_controller.go
. The API type definitions, defaulting and validating webhook logic live in the directory, api/v1beta1
.
Become part of the Bare Metal Cloud community to get updates on new features, help us improve the platform, and engage with developers and other users.
- Follow @phoenixNAP on Twitter
- Join the official Slack channel
- Sign up for our Developers Monthly newsletter
Get in touch with us if you have questions or need help with Bare Metal Cloud.