Thor
Thor

Reputation: 345

How to give flags and env variables in k3s Airgap installation

I am trying to convert my k3s script installation via curl -sfL

curl -sfL https://get.k3s.io | K3S_KUBECONFIG_MODE="644" INSTALL_K3S_EXEC="--flannel-backend=none --cluster-cidr="$cluster_cidr" --disable=traefik" sh -

to Airgap installation with command: INSTALL_K3S_SKIP_DOWNLOAD=true /usr/local/bin/install.sh in shell script.

I want to pass same flags and env var K3S_KUBECONFIG_MODE="644" INSTALL_K3S_EXEC="--flannel-backend=none --cluster-cidr="$cluster_cidr" --disable=traefik" sh - in INSTALL_K3S_SKIP_DOWNLOAD installation the same way as I am giving in top most curl command ?

The top most curl command is working, but after replacing curl with SKIP_DOWNLOAD its failing.

PS: This is failing to set the flags and variables:

INSTALL_K3S_SKIP_DOWNLOAD=true /usr/local/bin/install.sh | K3S_KUBECONFIG_MODE="644" INSTALL_K3S_EXEC="--flannel-backend=none --cluster-cidr="$cluster_cidr" --disable=traefik" sh -

can someone help me here ?

Upvotes: 1

Views: 488

Answers (1)

Slickwarren
Slickwarren

Reputation: 11

There was a recent fix in k3s, which may be what you were seeing: https://github.com/k3s-io/k3s/issues/9570

I'd recommend using the latest version and trying again, as your install command looks correct to me.

One more point, I would recommend referring to k3s docs directly instead of through Rancher. In this case I think you were fine, but sometimes Rancher docs get out of sync with other docs like K3s.

Upvotes: 0

Related Questions