From 33507fd19aa50671e5260da6dbb1e8d55bc45ba8 Mon Sep 17 00:00:00 2001 From: iwilltry42 Date: Mon, 11 Oct 2021 15:35:50 +0200 Subject: [PATCH] docs: fix missing update of k3s-server/agent-arg flag to k3s-arg + nodefilter (fixes #782) --- docs/faq/faq.md | 18 +++++++++--------- docs/usage/advanced/calico.md | 4 ++-- docs/usage/commands.md | 3 +-- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/docs/faq/faq.md b/docs/faq/faq.md index 79b36d34..4c665ec1 100644 --- a/docs/faq/faq.md +++ b/docs/faq/faq.md @@ -28,8 +28,8 @@ ```bash k3d cluster create \ - --k3s-agent-arg '--kubelet-arg=eviction-hard=imagefs.available<1%,nodefs.available<1%' \ - --k3s-agent-arg '--kubelet-arg=eviction-minimum-reclaim=imagefs.available=1%,nodefs.available=1%' + --k3s-arg '--kubelet-arg=eviction-hard=imagefs.available<1%,nodefs.available<1%@agent:*' \ + --k3s-arg '--kubelet-arg=eviction-minimum-reclaim=imagefs.available=1%,nodefs.available=1%@agent:*' ``` ## Restarting a multi-server cluster or the initializing server node fails @@ -44,7 +44,7 @@ - The Problem: Passing a feature flag to the Kubernetes API Server running inside k3s. - Example: you want to enable the EphemeralContainers feature flag in Kubernetes -- Solution: `#!bash k3d cluster create --k3s-server-arg '--kube-apiserver-arg=feature-gates=EphemeralContainers=true'` +- Solution: `#!bash k3d cluster create --k3s-arg '--kube-apiserver-arg=feature-gates=EphemeralContainers=true@server:*'` - **Note**: Be aware of where the flags require dashes (`--`) and where not. - the k3s flag (`--kube-apiserver-arg`) has the dashes - the kube-apiserver flag `feature-gates` doesn't have them (k3s adds them internally) @@ -53,10 +53,10 @@ ```bash k3d cluster create k3d-one \ - --k3s-server-arg --cluster-cidr="10.118.0.0/17" \ - --k3s-server-arg --service-cidr="10.118.128.0/17" \ - --k3s-server-arg --disable=servicelb \ - --k3s-server-arg --disable=traefik \ + --k3s-arg "--cluster-cidr=10.118.0.0/17@server:*" \ + --k3s-arg "--service-cidr=10.118.128.0/17@server:*" \ + --k3s-arg "--disable=servicelb@server:*" \ + --k3s-arg "--disable=traefik@server:*" \ --verbose ``` @@ -105,8 +105,8 @@ Some can be fixed by passing the `HTTP_PROXY` environment variables to k3d, some ```bash k3d cluster create \ - --k3s-server-arg "--kube-proxy-arg=conntrack-max-per-core=0" \ - --k3s-agent-arg "--kube-proxy-arg=conntrack-max-per-core=0" \ + --k3s-arg "--kube-proxy-arg=conntrack-max-per-core=0@server:*" \ + --k3s-arg "--kube-proxy-arg=conntrack-max-per-core=0@agent:*" \ --image rancher/k3s:v1.20.6-k3s ``` diff --git a/docs/usage/advanced/calico.md b/docs/usage/advanced/calico.md index 26a8b77d..ddb1b5a4 100644 --- a/docs/usage/advanced/calico.md +++ b/docs/usage/advanced/calico.md @@ -20,14 +20,14 @@ Or you can directly use this [calico.yaml](calico.yaml) manifest On the k3s cluster creation : -- add the flag `--flannel-backend=none`. For this, on k3d you need to forward this flag to k3s with the option `--k3s-server-arg`. +- add the flag `--flannel-backend=none`. For this, on k3d you need to forward this flag to k3s with the option `--k3s-arg`. - mount (`--volume`) the calico descriptor in the auto deploy manifest directory of k3s `/var/lib/rancher/k3s/server/manifests/` So the command of the cluster creation is (when you are at root of the k3d repository) ```bash k3d cluster create "${clustername}" \ - --k3s-server-arg '--flannel-backend=none' \ + --k3s-arg '--flannel-backend=none@server:*' \ --volume "$(pwd)/docs/usage/guides/calico.yaml:/var/lib/rancher/k3s/server/manifests/calico.yaml" ``` diff --git a/docs/usage/commands.md b/docs/usage/commands.md index 67df4ffc..295fa274 100644 --- a/docs/usage/commands.md +++ b/docs/usage/commands.md @@ -16,8 +16,7 @@ k3d -e, --env # add environment variables to the nodes (quoted string, format: 'KEY[=VALUE][@NODEFILTER[;NODEFILTER...]]', use flag multiple times) --gpus # [from docker CLI] add GPU devices to the node containers (string, e.g. 'all') -i, --image # specify which k3s image should be used for the nodes (string, default: 'docker.io/rancher/k3s:v1.20.0-k3s2', tag changes per build) - --k3s-agent-arg # add additional arguments to the k3s agent (quoted string, use flag multiple times) (see https://rancher.com/docs/k3s/latest/en/installation/install-options/agent-config/#k3s-agent-cli-help) - --k3s-server-arg # add additional arguments to the k3s server (quoted string, use flag multiple times) (see https://rancher.com/docs/k3s/latest/en/installation/install-options/server-config/#k3s-server-cli-help) + --k3s-arg # add additional arguments to the k3s server/agent (quoted string, use flag multiple times) (see https://rancher.com/docs/k3s/latest/en/installation/install-options/server-config/#k3s-server-cli-help & https://rancher.com/docs/k3s/latest/en/installation/install-options/agent-config/#k3s-agent-cli-help) --kubeconfig-switch-context # (implies --kubeconfig-update-default) automatically sets the current-context of your default kubeconfig to the new cluster's context (default: true) --kubeconfig-update-default # enable the automated update of the default kubeconfig with the details of the newly created cluster (also sets '--wait=true') (default: true) -l, --label # add (docker) labels to the node containers (format: 'KEY[=VALUE][@NODEFILTER[;NODEFILTER...]]', use flag multiple times)