Kubernetes: Difference between revisions

From PedrosBrainDump
Created page with "K3s install curl -sfL <nowiki>https://get.k3s.io</nowiki> | K3S_KUBECONFIG_MODE="644" sh -s - Adding node to the cluster get the token from the master with cat /var/lib/rancher/k3s/server/node-token then to install run curl -sfL <nowiki>https://get.k3s.io</nowiki> | K3S_TOKEN="YOUR TOKEN" K3S_URL="<nowiki>https://yourserver:6443</nowiki>" K3S_NODE_NAME="servername" sh -s -"
 
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 6: Line 6:
  cat /var/lib/rancher/k3s/server/node-token
  cat /var/lib/rancher/k3s/server/node-token
then to install run
then to install run
  curl -sfL <nowiki>https://get.k3s.io</nowiki> | K3S_TOKEN="YOUR TOKEN" K3S_URL="<nowiki>https://yourserver:6443</nowiki>" K3S_NODE_NAME="servername" sh -s -
  curl -sfL <nowiki>https://get.k3s.io</nowiki> | K3S_TOKEN="YOUR TOKEN" K3S_URL="<nowiki>https://yourserver:6443</nowiki>" K3S_NODE_NAME="servername" sh -
To install rancher
 
go in the master server and create the file
/etc/rancher/rke2/config.yaml
the content of this file is
 
token: <anything>
tls-san:
  - <server ip>
then run
curl -sfL <nowiki>https://get.rancher.io</nowiki> | sh -
then enable and start the service
 
systemctl enable rancherd-server.service
systemctl start rancherd-server.service
then reset your adm password
rancherd reset-admin
if you get some error like "FATA[0000] cluster and rancher are not ready." wait a little more, because your cluster is not ready yet.

Latest revision as of 21:57, 18 October 2024

K3s install

curl -sfL https://get.k3s.io | K3S_KUBECONFIG_MODE="644" sh -s - 

Adding node to the cluster

get the token from the master with

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

then to install run

curl -sfL https://get.k3s.io | K3S_TOKEN="YOUR TOKEN" K3S_URL="https://yourserver:6443" K3S_NODE_NAME="servername" sh -

To install rancher

go in the master server and create the file

/etc/rancher/rke2/config.yaml

the content of this file is

token: <anything>
tls-san:
  - <server ip>

then run

curl -sfL https://get.rancher.io | sh -

then enable and start the service

systemctl enable rancherd-server.service
systemctl start rancherd-server.service

then reset your adm password

rancherd reset-admin

if you get some error like "FATA[0000] cluster and rancher are not ready." wait a little more, because your cluster is not ready yet.