This page describes how to create cluster via ssh with “sudo” password or with “su” command.
By default, kublr creates a cluster over an ssh connection with a certificate and without the password from “sudo” command. But sometimes you need to create a cluster of kubernetes over an ssh connection using a username and password. This article provides knowledge on how to use Kublr to create on-premises kubernetes cluster in the following configuration:
Do the following:
On the left menu, click Credentials.
Create new credentials with the “Usrename/Password” type.
On the left menu, click Clusters.
Click ADD CLUSTER.
Enter a basic cluster information.
Click CUSTOMIZE SPECIFICATION.
For “master” and “nodes”, set:
Example:
spec:
locations:
- name: bare-metal1
baremetal: {}
master:
locations:
- baremetal:
hosts:
- address: 192.168.8.13
username: ubuntu
sshUserPassSecretRef: ssh-user-pass
locationRef: bare-metal1
minNodes: 1
name: master
nodes:
- locations:
- baremetal:
hosts:
- address: 192.168.8.14
- address: 192.168.8.15
- address: 192.168.8.17
username: ubuntu
sshUserPassSecretRef: ssh-user-pass
locationRef: bare-metal1
minNodes: 3
name: default
For the “sudo” command, the same password as for the ssh connection will be used.
Do the following:
Example:
spec:
locations:
- name: bare-metal1
baremetal: {}
master:
locations:
- baremetal:
hosts:
- address: 192.168.8.13
username: ubuntu
sshUserPassSecretRef: ssh-user-pass
suUserPassSecretRef: su-user-pass
locationRef: bare-metal1
minNodes: 1
name: master
nodes:
- locations:
- baremetal:
hosts:
- address: 192.168.8.14
- address: 192.168.8.15
- address: 192.168.8.17
username: ubuntu
sshUserPassSecretRef: ssh-user-pass
suUserPassSecretRef: su-user-pass
locationRef: bare-metal1
minNodes: 3
name: default
Do the following:
Example:
spec:
locations:
- name: bare-metal1
baremetal: {}
master:
locations:
- baremetal:
hosts:
- address: 192.168.8.13
username: ubuntu
sshKeySecretRef: ssh-private-key
sshUserPassSecretRef: ssh-user-pass
locationRef: bare-metal1
minNodes: 1
name: master
nodes:
- locations:
- baremetal:
hosts:
- address: 192.168.8.14
- address: 192.168.8.15
- address: 192.168.8.17
username: ubuntu
sshKeySecretRef: ssh-private-key
sshUserPassSecretRef: ssh-user-pass
locationRef: bare-metal1
minNodes: 3
name: default
Do the following:
Example:
spec:
locations:
- name: bare-metal1
baremetal: {}
master:
locations:
- baremetal:
hosts:
- address: 192.168.8.13
username: ubuntu
sshKeySecretRef: ssh-private-key
suUserPassSecretRef: su-user-pass
locationRef: bare-metal1
minNodes: 1
name: master
nodes:
- locations:
- baremetal:
hosts:
- address: 192.168.8.14
- address: 192.168.8.15
- address: 192.168.8.17
username: ubuntu
sshKeySecretRef: ssh-private-key
suUserPassSecretRef: su-user-pass
locationRef: bare-metal1
minNodes: 3
name: default