Skip to content

Commit

Permalink
docs: Fix Kubernetes installation guide for zsh
Browse files Browse the repository at this point in the history
When running the K8s installation guide with zsh the following commands:

  EXTRA_HELM_FLAGS="--set tetragon.hostProcPath=/procHost"
  helm install tetragon ${EXTRA_HELM_FLAGS} cilium/tetragon -n kube-system

fail with:

  Error: unknown flag: --set tetragon.hostProcPath

The reason for this is that zsh does not split into words when it
expands parameters by default [2]. For example, in a zsh shell:

  EXTRA_FLAGS="--namespace kube-system"; strace -e trace=execve kubectl get pods ${EXTRA_FLAGS} 2>&1 | grep -m1 kubectl
  execve("/usr/bin/kubectl", ["kubectl", "get", "pods", "--namespace kube-system"], 0x7ffe5a984d38 /* 63 vars */) = 0

Fix this by using arrays to pass extra Helm flags which works in both
bash and zsh shells.

[1] https://linux.die.net/man/1/zshexpn

Signed-off-by: Ioannis Androulidakis <androulidakis.ioannis@gmail.com>
  • Loading branch information
ioandr authored and mtardy committed Jan 12, 2024
1 parent d12bdba commit 2a210dc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/content/en/docs/getting-started/install-k8s.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ nodes:
containerPath: /procHost
EOF
kind create cluster --config kind-config.yaml
EXTRA_HELM_FLAGS="--set tetragon.hostProcPath=/procHost" # flags for helm install
EXTRA_HELM_FLAGS=(--set tetragon.hostProcPath=/procHost) # flags for helm install
```
{{% /tab %}}

Expand All @@ -86,7 +86,7 @@ To install and deploy Tetragon, run the following commands:
```shell
helm repo add cilium https://helm.cilium.io
helm repo update
helm install tetragon ${EXTRA_HELM_FLAGS} cilium/tetragon -n kube-system
helm install tetragon ${EXTRA_HELM_FLAGS[@]} cilium/tetragon -n kube-system
kubectl rollout status -n kube-system ds/tetragon -w
```

Expand Down

0 comments on commit 2a210dc

Please sign in to comment.