docs: fix missing update of k3s-server/agent-arg flag to k3s-arg + nodefilter (fixes #782)

pull/754/head
iwilltry42 3 years ago
parent 1e9c20e0a9
commit 33507fd19a
No known key found for this signature in database
GPG Key ID: 7BA57AD1CFF16110
  1. 18
      docs/faq/faq.md
  2. 4
      docs/usage/advanced/calico.md
  3. 3
      docs/usage/commands.md

@ -28,8 +28,8 @@
```bash ```bash
k3d cluster create \ k3d cluster create \
--k3s-agent-arg '--kubelet-arg=eviction-hard=imagefs.available<1%,nodefs.available<1%' \ --k3s-arg '--kubelet-arg=eviction-hard=imagefs.available<1%,nodefs.available<1%@agent:*' \
--k3s-agent-arg '--kubelet-arg=eviction-minimum-reclaim=imagefs.available=1%,nodefs.available=1%' --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 ## 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. - 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 - 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. - **Note**: Be aware of where the flags require dashes (`--`) and where not.
- the k3s flag (`--kube-apiserver-arg`) has the dashes - the k3s flag (`--kube-apiserver-arg`) has the dashes
- the kube-apiserver flag `feature-gates` doesn't have them (k3s adds them internally) - the kube-apiserver flag `feature-gates` doesn't have them (k3s adds them internally)
@ -53,10 +53,10 @@
```bash ```bash
k3d cluster create k3d-one \ k3d cluster create k3d-one \
--k3s-server-arg --cluster-cidr="10.118.0.0/17" \ --k3s-arg "--cluster-cidr=10.118.0.0/17@server:*" \
--k3s-server-arg --service-cidr="10.118.128.0/17" \ --k3s-arg "--service-cidr=10.118.128.0/17@server:*" \
--k3s-server-arg --disable=servicelb \ --k3s-arg "--disable=servicelb@server:*" \
--k3s-server-arg --disable=traefik \ --k3s-arg "--disable=traefik@server:*" \
--verbose --verbose
``` ```
@ -105,8 +105,8 @@ Some can be fixed by passing the `HTTP_PROXY` environment variables to k3d, some
```bash ```bash
k3d cluster create \ k3d cluster create \
--k3s-server-arg "--kube-proxy-arg=conntrack-max-per-core=0" \ --k3s-arg "--kube-proxy-arg=conntrack-max-per-core=0@server:*" \
--k3s-agent-arg "--kube-proxy-arg=conntrack-max-per-core=0" \ --k3s-arg "--kube-proxy-arg=conntrack-max-per-core=0@agent:*" \
--image rancher/k3s:v1.20.6-k3s --image rancher/k3s:v1.20.6-k3s
``` ```

@ -20,14 +20,14 @@ Or you can directly use this [calico.yaml](calico.yaml) manifest
On the k3s cluster creation : 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/` - 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) So the command of the cluster creation is (when you are at root of the k3d repository)
```bash ```bash
k3d cluster create "${clustername}" \ 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" --volume "$(pwd)/docs/usage/guides/calico.yaml:/var/lib/rancher/k3s/server/manifests/calico.yaml"
``` ```

@ -16,8 +16,7 @@ k3d
-e, --env # add environment variables to the nodes (quoted string, format: 'KEY[=VALUE][@NODEFILTER[;NODEFILTER...]]', use flag multiple times) -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') --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) -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-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)
--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)
--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-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) --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) -l, --label # add (docker) labels to the node containers (format: 'KEY[=VALUE][@NODEFILTER[;NODEFILTER...]]', use flag multiple times)

Loading…
Cancel
Save