Skip to content

Cluster RKE2 Rancher

arquitetura

controllers/servers/workers

  • 192.168.111.210 rke-dev-alpha
  • 192.168.111.211 rke-dev-bravo
  • 192.168.111.212 rke-dev-charlie

node primário

  • 192.168.111.210

advertise address

  • 192.168.111.210

instalando nodes

node 1, k8s-rancher-alpha

crie o diretorio do rke2

mkdir -p /etc/rancher/rke2

crie o arquivo de configuração do primeiro node

vim /etc/rancher/rke2/config.yaml

insira o conteúdo abaixo

write-kubeconfig-mode: "0644"
advertise-address: 192.168.111.210
node-name: k8s-dev-alpha
tls-san:
  - ip-externo
  - 192.168.111.210
  - 192.168.111.211
  - 192.168.111.212
  - 192.168.111.213
  - 192.168.111.214
  - 192.168.111.215
  - k8s-rancher-alpha
  - k8s-rancher-bravo
  - k8s-rancher-charlie
  - rancher.local
cluster-domain: rancher.local
etcd-arg: "--quota-backend-bytes 2048000000"
etcd-snapshot-schedule-cron: "0 3 * * *"
etcd-snapshot-retention: 10

defina que esta insalando um servidor

export INSTALL_RKE2_TYPE="server"

instalando o binário

curl -sfL https://get.rke2.io | sudo sh -

inicie o servico

systemctl start rke2-server

pegue o valor do token

cat /var/lib/rancher/rke2/server/node-token

salve esse valor para usar nos outros nodes.

node 2, k8s-rancher-bravo

crie o diretorio do rke2

mkdir -p /etc/rancher/rke2

crie o arquivo de configuração dos nodes controllers secundários

vim /etc/rancher/rke2/config.yaml

adicione o conteúdo

server: https://192.168.111.210:9345
token: token
write-kubeconfig-mode: "0644"
advertise-address: 192.168.111.210
node-name: k8s-rancher-bravo
tls-san:
  - ip-externo
  - 192.168.111.210
  - 192.168.111.211
  - 192.168.111.212
  - 192.168.111.213
  - 192.168.111.214
  - 192.168.111.215
  - k8s-rancher-alpha
  - k8s-rancher-bravo
  - k8s-rancher-charlie
  - rancher.local
cluster-domain: rancher.local
etcd-arg: "--quota-backend-bytes 2048000000"
etcd-snapshot-schedule-cron: "0 3 * * *"
etcd-snapshot-retention: 10

defina que esta insalando um servidor

export INSTALL_RKE2_TYPE="server"

instalando o binário

curl -sfL https://get.rke2.io | sudo sh -

inicie o servico

systemctl start rke2-server

node 3, k8s-rancher-charlie

crie o diretorio do rke2

mkdir -p /etc/rancher/rke2

crie o arquivo de configuração dos nodes controllers secundários

vim /etc/rancher/rke2/config.yaml

adicione o conteúdo

server: https://192.168.111.210:9345
token: token
write-kubeconfig-mode: "0644"
advertise-address: 192.168.111.210
node-name: k8s-rancher-charlie
tls-san:
  - ip-externo
  - 192.168.111.210
  - 192.168.111.211
  - 192.168.111.212
  - 192.168.111.213
  - 192.168.111.214
  - 192.168.111.215
  - k8s-rancher-alpha
  - k8s-rancher-bravo
  - k8s-rancher-charlie
  - rancher.local
cluster-domain: rancher.local
etcd-arg: "--quota-backend-bytes 2048000000"
etcd-snapshot-schedule-cron: "0 3 * * *"
etcd-snapshot-retention: 10

defina que esta insalando um servidor

export INSTALL_RKE2_TYPE="server"

instalando o binário

curl -sfL https://get.rke2.io | sudo sh -

inicie o servico

systemctl start rke2-server