KubeOne on Bare Metal

I want to use Kubermatic Kubernetes Platform to manage the deployment of Kubernetes on Bare Metal using KubeOne for the admin cluster. Could you point me to any relevant documentation of how I can try and setup Kubeone so that it uses a Bare Metal provisioner instead of OpenStack? (I think Packet/Tinkerbell were mentioned but I have no previous experience using any of them)

Hello,

Currently, we don’t have a dedicated document showing how to use KubeOne to provision clusters on bare metal, however, it’s not so much different than for OpenStack or any other provider.

The key difference is that:

  • You need to specify the control plane hosts in .controlPlane.Hosts
  • Optionally, if you want to provision worker nodes on bare metal, you can use the static workers feature (requires v1.0.0 prereleases)
  • Use cloudProvider none instead of openstack

You can use kubeone config print --full command to get a configuration file reference.

If you have any other questions, please let us know.

I would just like to add that while Packet is officially supported by KubeOne, Tinkerbell currently isn’t officially supported. While it’s mostly like that KubeOne will work with it, there’s no support for integrating with Terraform and machine-controller, so you would have to use it like any other bare metal setup.

Could you please be a bit more specific on the structure for declaring .controlPane.Hosts ?

Currently my kubeone_config.yaml file looks like this:

apiVersion: kubeone.io/v1alpha1
kind: KubeOneCluster
versions:
  kubernetes: '1.18.0'
cloudProvider:
  name: 'none'

controlPlane:
  hosts:
  - publicAddress: '<IP>'
    privateAddress:  '<IP>'
    sshUsername: centos
    sshPrivateKeyFile: '~/.ssh/id_rsa'
    sshAgentSocket: 'env:SSH_AUTH_SOCK'
    taints:
    - key: "node-role.kubernetes.io/master"
      effect: "NoSchedule"
  - publicAddress:  '<IP>'
    privateAddress:  '<IP>'
    sshUsername: centos
    sshPrivateKeyFile: '~/.ssh/id_rsa'
    sshAgentSocket: 'env:SSH_AUTH_SOCK'
    taints:
    - key: "node-role.kubernetes.io/master"
      effect: "NoSchedule"
  - publicAddress:  '<IP>'Preformatted text
    privateAddress: ''<IP>'
    sshUsername: centos
    sshPrivateKeyFile: '~/.ssh/id_rsa'
    sshAgentSocket: 'env:SSH_AUTH_SOCK'
    taints:
    - key: "node-role.kubernetes.io/master"
      effect: "NoSchedule"

And I get the following error:

`failed to initialize State: failed to build state: failed to load cluster: unable to load a given KubeOneCluster object: strict decoder error for apiVersion: kubeone.io/v1alpha1
kind: KubeOneCluster
versions:
kubernetes: ‘1.18.0’
cloudProvider:
name: ‘none’
(…)

: v1alpha1.KubeOneCluster.ReadObject: found unknown field: controlPlane, error found in #10 byte of …|trolPlane":{“hosts”:|…, bigger context …|a1",“cloudProvider”:{“name”:“none”},“controlPlane”:{“hosts”:[{“privateAddress”:"","publ|…`

In order to use .controlPlane.Hosts you need to use the v1beta1 API. Replace apiVersion at the top of file with:

apiVersion: kubeone.io/v1beta1

Also, to use the KubeOne v1beta1 API, you need to use the v1.0.0-beta release.

Besides that, with v1beta1 API, you have to change the .cloudProvider directive. It should look like:

cloudProvider:
  none: {}

Yup. That did it.

Switching to:

apiVersion: kubeone.io/v1beta1

and

cloudProvider:
  none: {}

resolved my issue.

Thank you @marko!