Create Single Node BareOS Cluster
This article describes the creation of a single node on-premises Kubernetes cluster using PMK.
We recommend reading What is BareOS for an understanding of BareOS and BareOS Cluster Architecture before proceeding with this document.
The PMK one-click cluster creation wizard allows you to create a single node PMK cluster very quickly. The single cluster node becomes both the master and worker node for the cluster, and has etcd deployed on that node.
Note that the cluster will not be highly available and should not be used for production workloads. Only use single master single node clusters for dev/test use cases where you can accommodate cluster downtime due to the single node going down.
Pre-requisites
- You will need a virtual machine or a physical server with a supported version of Linux operating system installed.
- Follow the Operating System Requirements and Hardware Requirements for the node you want to create the cluster with.
Create BareOS Single Node Cluster Using UI
To create a single node PMK cluster:
- Navigate to the PMK UI
Infrastructure -> Clusters - > Create Clusterand choose 'create cluster' to launch the cluster creation wizard. - Select BareOS Virtual Machine or BareOS Physical Servers option depending on where you are creating your BareOS cluster.
- Click on the 'One-click Cluster' button in the wizard
- Give the cluster a memorable name like 'my-cluster'
- Choose your Kubernetes version (if you are unsure which version to pick then always choose the latest)
- The 'Select a node' section of the wizard will initially be empty. This is because you need to download and install the Platform9 CLI on your node so it can connect to the PMK management plane and show up in your wizard.
- To achieve this, download and install the PMK CLI on your node by running the following command on the node.
bash <(curl -sL https://pmkft-assets.s3-us-west-1.amazonaws.com/pf9ctl_setup)- The command will install the CLI
- Now run the
config setcommand to configure the CLI to connect to and use your PMK deployment.
pf9ctl config setPlatform9 Account URL: <Your PMK Account URL>Username: <Your PMK User name>Password: <Your PMK password>Region [RegionOne]: <leave blank for default>Tenant [service]: <leave blank for default>Note: The default values for Region and Tenant should suffice for most PMK Free Tier users. PMK Free Tier does not have the feature enabled to create multiple Regions. So the Region field should always be left to the default value. Change the value of the Tenant field only if you created a different Tenant in PMK and you are creating a cluster within that tenant.
For PMK Enterprise users, specify the right value for the Region and Tenant within which you are creating your cluster. (Specified by the drop down selectors at the top right of your PMK UI nav bar)
- Now run the CLI prep-node command to prepare the node with required pre-requisites.
pf9ctl prep-node- The prep-node command will perform prerequisite checks for your node. If any checks fail, you will receive an output similar to the following.
✓ Loaded Config Successfully✓ Missing package(s) installed successfully✓ Removal of existing CLI✓ Existing Platform9 Packages Check✓ Required OS Packages Check✓ SudoCheck✓ CPUCheckx DiskCheck - At least 30 GB of total disk space and 15 GB of free space is needed on host. Disk Space found: 2 GBx MemoryCheck - At least 12 GB of memory is needed on host. Total memory found: 4 GB✓ PortCheck✓ Existing Kubernetes Cluster Check✓ Completed Pre-Requisite Checks successfullyOptional pre-requisite check(s) failed. Do you want to continue? (y/n)It is highly recommended that you meet all of the pre-requisites or else you may experience degraded performance among scheduled pods and/or other unforeseen issues.
If you encounter the error: Failure to prepare node, please review the pf9ctl log file for additional context.
Enterprise – Please submit a Support Request with the log attached and our team will review and work with you to onboard the node.
PMK Free Tier – Feel free to reach out to us on Slack or our Community forum to solicit some general advice and guidance with relation to the error you're seeing.
Failed to prepare node. See /root/pf9/log/pf9ctl-20210330.log or use --verbose for logs- If the prep-node command succeeds, you are now ready to create your single node cluster using PMK UI.
- Navigate back to the PMK UI one click cluster creation wizard. Your node should now show up in the wizard.
- Give you cluster a name. And select Kubernetes version for your cluster. If you are unclear about this, we recommend selecting the highest listed numeric version.
- Click
Completeto finalize and deploy the cluster! - You PMK Cluster is now deployed.
- Following is a description of the input properties, their default values set as part of the one-click cluster creation wizard, and their meaning, for your information only.
| Input parameter | Description | Default value | |
|---|---|---|---|
| Containers CIDR | The IP range that Kubernetes uses to configure containers (pods) deployed by Kubernetes | 10.20.0.0/22 | |
| Services CIDR | The IP range that Kubernetes uses to configure services deployed by Kubernetes | 10.21.0.0/22 | |
| CNI | The CNI used for this cluster. | Calico | |
| IP in IP Encapsulation Mode (Calico) | Encapsulation mode for Calico CNI. See Calico CNI for details on the network parameters. | Always | |
| NAT Outgoing (Calico) | NAT mode for Calico CNI | Enabled | |
| Block size | Block sized used by Calico CNI | 26 | |
| MTU size | MTU size used by Calico CNI | 1440 | |
| Privileged | Allows you to run containers that require privileged mode on this cluster. | Enabled | |
| Enable workloads on master | Whether a master node should also run workloads. Enabled so we can create a single node cluster. | Enabled | |
| ETCD Backup | Whether etcd data will be backed up | Enabled | |
| Storage Path | Location on the node where the etcd data will be backed up | /etc/pf9/etcd-backup | |
| Backup Interval (Minutes) | How often the etcd data will be backed up | 1440 minutes (1 day) |
Create Single Node BareOS Cluster Using REST API
You can also create a single node BareOS Kubernetes cluster using the PMK (Qbert) REST API.