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:
sudo
command with passwordsu
command using username and passwordsudo
command with passwordsu
command using username and passwordsudo
command with passwordGo to Credentials
tab and create new credentials with Usrename/Password
type
Go to the Cluster’s tab and click Add Cluster
button
Enter the base information and then click the Customize Cluster Specification
button
and enter additional field master and nodes instance groups sshUserPassSecretRef
and username
Fields:
sshUserPassSecretRef
- is a secret reference that contains username and password credentials for instance groupusername
- is username to connect via SSH, if you do not enter this field, Kublr will use the username from sshUserPassSecretRef
secretExample:
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
The password for the sudo
command will be used the same as in the ssh connection
su
commandCredentials
tabUsrename/Password
typesu
command with Usrename/Password
typeAdd Cluster
buttonCustomize Cluster Specification
buttonsshUserPassSecretRef
additional field for instance groups master
and nodes
, where value is the name of the credentials for ssh connectionsuUserPassSecretRef
additional field for instance groups master
and nodes
, where value is the name of the credentials for su
commandFields:
sshUserPassSecretRef
- is a secret reference that contains username and password credentials for instance groupsuUserPassSecretRef
- is a secret reference containing credentials for a username and password for installation without sudo via suusername
- is username to connect via SSH, if you do not enter this field, Kublr will use the username from sshUserPassSecretRef
secretExample:
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
sudo
command with a passwordCredentials
tab and create new credentials with Usrename/Password
type for sudo
commandCluster
tab and click Add Cluster
buttonCustomize Cluster Specification
button and enter sshUserPassSecretRef
additional field for instance groups master
and nodes
Fields:
sshUserPassSecretRef
- is a secret reference that contains username and password credentials for instance groupsshKeySecretRef
- is a secret reference that contains private SSH key for instance groupusername
- is username to connect via SSHExample:
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
su
commandCredentials
tabSSH Private Key
typesu
command with Usrename/Password
typeAdd Cluster
buttonCustomize Cluster Specification
buttonsuUserPassSecretRef
additional field for instance groups master
and nodes
, where value is the name of the credentials for su
commandFields:
sshKeySecretRef
- is a secret reference that contains private SSH key for instance groupsuUserPassSecretRef
- is a secret reference containing credentials for a username and password for installation without sudo via suusername
- is username to connect via SSHExample:
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