Skip to content

Commit 9e850b7

Browse files
authored
Merge pull request #15 from vish-mv/fluent-bit
Set the Fluent Bit toleration as a Helm value in the isolation-tier guides
2 parents 253b441 + b4069be commit 9e850b7

5 files changed

Lines changed: 108 additions & 51 deletions

File tree

‎docs/guides/isolation-tiers/gvisor.mdx‎

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,13 +197,48 @@ kubectl apply -f "${AMP_DIST}/deployments/k8s/gvisor-runtimeclass.yaml"
197197
# 2. Label and taint the node (find the name with: kubectl get nodes)
198198
kubectl label node <node-name> gvisor=true --overwrite
199199
kubectl taint node <node-name> gvisor=true:NoSchedule --overwrite
200+
```
201+
202+
The label is what the RuntimeClass schedules onto; the taint keeps regular runc pods off the node.
203+
204+
The taint also keeps the Fluent Bit log collector off the node, and without it agents there produce no runtime logs. Fluent Bit is a DaemonSet rendered by the `observability-logs-opensearch` Helm chart, so its toleration is a chart value. Check whether the release stores it:
205+
206+
```bash
207+
helm get values observability-logs-opensearch -n openchoreo-observability-plane
208+
```
209+
210+
Check the release values rather than the live DaemonSet: a toleration patched onto the DaemonSet (as earlier versions of the setup scripts did) shows up on the live object, but is lost when the DaemonSet is recreated.
211+
212+
If `fluent-bit.tolerations` does not list `- operator: Exists` with no `key` or `effect`, set the value on the release:
213+
214+
```bash
215+
helm upgrade observability-logs-opensearch \
216+
oci://ghcr.io/openchoreo/helm-charts/observability-logs-opensearch \
217+
--namespace openchoreo-observability-plane \
218+
--version 0.5.3 \
219+
--reuse-values \
220+
--set "fluent-bit.tolerations[0].operator=Exists"
221+
```
222+
223+
Pass the chart version that is already installed (the `CHART` column of `helm list -n openchoreo-observability-plane`): combining `--reuse-values` with a chart version change can carry over values the new chart does not expect.
224+
225+
:::warning Keep the toleration on later upgrades
226+
The toleration is stored in the release's values, so it must be present on every upgrade that re-renders the DaemonSet. An upgrade of `observability-logs-opensearch` with `--reset-values`, or one that passes new `--set`/`-f` values without `--reuse-values`, drops it unless you pass `--set "fluent-bit.tolerations[0].operator=Exists"` again. Agents on the gVisor node then stop producing logs with no error.
227+
:::
228+
229+
<details>
230+
<summary>Logs module not installed as a Helm release</summary>
200231
201-
# 3. Let the Fluent Bit log DaemonSet tolerate the taint (so agent logs are collected)
232+
Only if `observability-logs-opensearch` is not a Helm release in your cluster, patch the DaemonSet directly:
233+
234+
```bash
202235
kubectl patch daemonset fluent-bit -n openchoreo-observability-plane --type=json \
203236
-p='[{"op":"add","path":"/spec/template/spec/tolerations","value":[{"operator":"Exists"}]}]'
204237
```
205238
206-
The label is what the RuntimeClass schedules onto; the taint keeps regular runc pods off the node.
239+
This replaces the DaemonSet's whole tolerations list, and is lost whenever the DaemonSet is recreated (a reinstall of the logs module or a namespace teardown), so re-check the toleration after any such change.
240+
241+
</details>
207242
208243
:::tip Verify
209244
```bash
@@ -325,7 +360,7 @@ The Fluent Bit DaemonSet must run on the tainted node. Check it covers the gViso
325360
kubectl get pods -n openchoreo-observability-plane -o wide | grep fluent-bit
326361
```
327362
328-
If no Fluent Bit pod is on the gVisor node, apply the toleration patch from Step 3.
363+
If no Fluent Bit pod is on the gVisor node, set the Fluent Bit toleration as described in [Step 3](#step-3-register-the-node-for-the-gvisor-tier).
329364
330365
</details>
331366

‎docs/guides/isolation-tiers/kata.mdx‎

Lines changed: 10 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Like gVisor, Kata uses a **dedicated node** labeled `kata=true` and tainted `kat
4545
| Virtualization | `/dev/kvm` present and functional (see warning above) |
4646
| Architecture | x86_64 |
4747
| OS | Ubuntu (or similar) with systemd + containerd — **not** Container-Optimized OS |
48-
| Access | kubectl access to the cluster (the installer runs from your machine, not on the node) |
48+
| Access | `kubectl` and `helm` access to the cluster (the installer runs from your machine, not on the node) |
4949

5050
## Set Up a Kata Node
5151

@@ -75,7 +75,7 @@ If your platform lets you set taints at node-pool creation, apply `kata=true:NoS
7575

7676
### Step 2: Run the installer from a machine with kubectl access
7777

78-
Unlike the gVisor installer (which runs on the node), the Kata installer runs from **any machine with kubectl access** and does everything through the Kubernetes API:
78+
Unlike the gVisor installer (which runs on the node), the Kata installer runs from **any machine with `kubectl` and `helm` access** and does everything through the Kubernetes API:
7979

8080
```bash
8181
KATA_NODES="<node-name>" bash "${AMP_DIST}/deployments/setup/install-kata.sh"
@@ -85,10 +85,10 @@ What it does:
8585

8686
1. **Pre-flights `/dev/kvm`** on every target node (via a short-lived privileged pod) and aborts if any node lacks it.
8787
2. Labels the node(s) `kata=true`.
88-
3. Applies the upstream **kata-deploy** DaemonSet, with a nodeSelector and toleration injected **before** apply — so it only ever lands on the labeled node(s); your other nodes are never reconfigured.
89-
4. **Auto-wires k3s nodes**: k3s bundles its own containerd (configured only via `config.toml.tmpl`, read at startup), which upstream kata-deploy does not handle — the installer detects k3s nodes and patches the template + restarts the k3s agent for you.
90-
5. Applies the `kata-qemu` RuntimeClass and taints the node(s) `kata=true:NoSchedule`.
91-
6. Patches the Fluent Bit log DaemonSet to tolerate the taint, so agent logs are collected.
88+
3. Installs upstream **kata-deploy** from its Helm chart (kata-containers `KATA_VERSION`, default `4.2.0`), scoped to the labeled node(s) so your other nodes are never reconfigured. The chart wires the node's containerd itself on standard Kubernetes, k3s and RKE2; the installer detects which one from the node's kubelet version. Nodes set up by the earlier manifest-based installer are migrated on the first run.
89+
4. Applies the `kata-qemu` RuntimeClass and boots a test pod under it on every target node. The installer reports success only once that pod has run in its own VM, with a kernel different from the node's.
90+
5. Taints the node(s) `kata=true:NoSchedule`. Set `KATA_TAINT=false` to leave them schedulable for other pods.
91+
6. Lets the Fluent Bit log DaemonSet tolerate the taint, so agent logs are collected. It checks the toleration stored in your `observability-logs-opensearch` Helm release and, if it is missing, sets the chart value `fluent-bit.tolerations` (a `helm upgrade --reuse-values` at the release's installed chart version). It patches the DaemonSet only when that release cannot be upgraded with Helm, and then prints the `helm upgrade` command to make it durable, because a patch is lost whenever the DaemonSet is recreated.
9292

9393
:::tip Verify
9494
```bash
@@ -98,41 +98,10 @@ kubectl get node <node-name> --show-labels # kata=true
9898
```
9999
:::
100100

101-
<details>
102-
<summary>RKE2 nodes (bundled containerd)</summary>
103-
104-
Upstream kata-deploy assumes a standalone containerd at `/etc/containerd/config.toml`, which RKE2 nodes do not have. Two extra steps are needed on each RKE2 Kata node:
105-
106-
**1. Before running the installer**, create an empty stub so the kata-deploy pod gets past its pre-flight check (it crash-loops with `cp: can't stat '/etc/containerd/config.toml'` otherwise):
107-
108-
```bash
109-
sudo mkdir -p /etc/containerd && sudo touch /etc/containerd/config.toml
110-
```
111-
112-
**2. After kata-deploy has installed the binaries into `/opt/kata`** (the node gets the `katacontainers.io/kata-runtime=true` label on success), wire the runtime through RKE2's containerd template — kata-deploy wrote its config to the stub, which RKE2 never reads:
113-
114-
```bash
115-
sudo mkdir -p /usr/local/bin
116-
sudo ln -sf /opt/kata/bin/containerd-shim-kata-v2 /usr/local/bin/containerd-shim-kata-qemu-v2
117-
sudo tee /var/lib/rancher/rke2/agent/etc/containerd/config.toml.tmpl > /dev/null <<'EOF'
118-
{{ template "base" . }}
119-
120-
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.kata-qemu]
121-
runtime_type = "io.containerd.kata-qemu.v2"
122-
privileged_without_host_devices = true
123-
pod_annotations = ["io.katacontainers.*"]
124-
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.kata-qemu.options]
125-
ConfigPath = "/opt/kata/share/defaults/kata-containers/configuration-qemu.toml"
126-
EOF
127-
sudo systemctl restart rke2-agent
128-
```
129-
130-
:::warning Rewrite, never append
131-
The template must contain `{{ template "base" . }}` exactly once. If the file already exists (e.g. it also carries a gVisor or build-related block), merge the runtime sections into one file and rewrite it wholesale; appending a duplicate template line produces an invalid containerd config and the node's kubelet will not come back after the restart — recovery then requires SSH/console access, `kubectl` cannot reach the node.
101+
:::warning Keep the Fluent Bit toleration on later upgrades
102+
The toleration is stored in the `observability-logs-opensearch` release's values, so it must be present on every upgrade that re-renders the Fluent Bit DaemonSet. An upgrade with `--reset-values`, or one that passes new `--set`/`-f` values without `--reuse-values`, drops it unless you pass `--set "fluent-bit.tolerations[0].operator=Exists"` again. Agents on the Kata node then stop producing logs with no error.
132103
:::
133104

134-
</details>
135-
136105
### Local development
137106

138107
There is no macOS-local path for Kata (no nested virtualization, and k3d node containers cannot boot Kata VMs). On a KVM-capable **Linux** host running the repository's dev k3d cluster:
@@ -200,13 +169,10 @@ The RuntimeClass exists but containerd on the node has no `kata-qemu` runtime
200169
```bash
201170
kubectl -n kube-system rollout status daemonset/kata-deploy
202171
kubectl -n kube-system logs -l name=kata-deploy
203-
204-
# on the node — confirm the runtime is in containerd's config:
205-
sudo grep -n kata-qemu /var/lib/rancher/k3s/agent/etc/containerd/config.toml # k3s nodes
206-
grep -n kata-qemu /etc/containerd/config.toml # other nodes
172+
kubectl get node <node-name> -L katacontainers.io/kata-runtime # true once kata-deploy has wired the node
207173
```
208174

209-
On k3s nodes, re-running `install-kata.sh` re-applies the containerd template wiring.
175+
Re-running `install-kata.sh` is safe: it re-applies the kata-deploy chart and boots a test pod on every target node again, failing with the reason if Kata still cannot run there.
210176

211177
</details>
212178

‎package.json‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,10 @@
127127
},
128128
"postcss-selector-not": {
129129
"postcss-selector-parser": "^7.1.4"
130-
}
130+
},
131+
"tinypool": "^2.2.0",
132+
"proxy-addr": "^2.0.8",
133+
"compression": "^1.8.2",
134+
"source-map-js": "^1.2.2"
131135
}
132136
}

‎versioned_docs/version-v1.0.0/guides/isolation-tiers/gvisor.mdx‎

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,48 @@ kubectl apply -f "${AMP_DIST}/deployments/k8s/gvisor-runtimeclass.yaml"
115115
# 2. Label and taint the node (find the name with: kubectl get nodes)
116116
kubectl label node <node-name> gvisor=true --overwrite
117117
kubectl taint node <node-name> gvisor=true:NoSchedule --overwrite
118+
```
119+
120+
The label is what the RuntimeClass schedules onto; the taint keeps regular runc pods off the node.
121+
122+
The taint also keeps the Fluent Bit log collector off the node, and without it agents there produce no runtime logs. Fluent Bit is a DaemonSet rendered by the `observability-logs-opensearch` Helm chart, so its toleration is a chart value. Check whether the release stores it:
123+
124+
```bash
125+
helm get values observability-logs-opensearch -n openchoreo-observability-plane
126+
```
127+
128+
Check the release values rather than the live DaemonSet: a toleration patched onto the DaemonSet (as earlier versions of the setup scripts did) shows up on the live object, but is lost when the DaemonSet is recreated.
129+
130+
If `fluent-bit.tolerations` does not list `- operator: Exists` with no `key` or `effect`, set the value on the release:
131+
132+
```bash
133+
helm upgrade observability-logs-opensearch \
134+
oci://ghcr.io/openchoreo/helm-charts/observability-logs-opensearch \
135+
--namespace openchoreo-observability-plane \
136+
--version 0.5.3 \
137+
--reuse-values \
138+
--set "fluent-bit.tolerations[0].operator=Exists"
139+
```
140+
141+
Pass the chart version that is already installed (the `CHART` column of `helm list -n openchoreo-observability-plane`): combining `--reuse-values` with a chart version change can carry over values the new chart does not expect.
142+
143+
:::warning Keep the toleration on later upgrades
144+
The toleration is stored in the release's values, so it must be present on every upgrade that re-renders the DaemonSet. An upgrade of `observability-logs-opensearch` with `--reset-values`, or one that passes new `--set`/`-f` values without `--reuse-values`, drops it unless you pass `--set "fluent-bit.tolerations[0].operator=Exists"` again. Agents on the gVisor node then stop producing logs with no error.
145+
:::
146+
147+
<details>
148+
<summary>Logs module not installed as a Helm release</summary>
118149

119-
# 3. Let the Fluent Bit log DaemonSet tolerate the taint (so agent logs are collected)
150+
Only if `observability-logs-opensearch` is not a Helm release in your cluster, patch the DaemonSet directly:
151+
152+
```bash
120153
kubectl patch daemonset fluent-bit -n openchoreo-observability-plane --type=json \
121154
-p='[{"op":"add","path":"/spec/template/spec/tolerations","value":[{"operator":"Exists"}]}]'
122155
```
123156

124-
The label is what the RuntimeClass schedules onto; the taint keeps regular runc pods off the node.
157+
This replaces the DaemonSet's whole tolerations list, and is lost whenever the DaemonSet is recreated (a reinstall of the logs module or a namespace teardown), so re-check the toleration after any such change.
158+
159+
</details>
125160

126161
:::tip Verify
127162
```bash
@@ -222,7 +257,7 @@ The Fluent Bit DaemonSet must run on the tainted node. Check it covers the gViso
222257
kubectl get pods -n openchoreo-observability-plane -o wide | grep fluent-bit
223258
```
224259

225-
If no Fluent Bit pod is on the gVisor node, apply the toleration patch from Step 3.
260+
If no Fluent Bit pod is on the gVisor node, set the Fluent Bit toleration as described in [Step 3](#step-3-register-the-node-for-the-gvisor-tier).
226261

227262
</details>
228263

‎versioned_docs/version-v1.0.0/guides/isolation-tiers/kata.mdx‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,19 @@ What it does:
9393
5. Applies the `kata-qemu` RuntimeClass and taints the node(s) `kata=true:NoSchedule`.
9494
6. Patches the Fluent Bit log DaemonSet to tolerate the taint, so agent logs are collected.
9595

96+
:::note Make the Fluent Bit toleration durable
97+
The v1.0.0 installer adds the toleration by patching the DaemonSet, and a patch is lost whenever the DaemonSet is recreated (a reinstall of the logs module or a namespace teardown). Fluent Bit is rendered by the `observability-logs-opensearch` Helm chart, so set the toleration as a chart value as well, passing the chart version that is already installed (the `CHART` column of `helm list -n openchoreo-observability-plane`):
98+
99+
```bash
100+
helm upgrade observability-logs-opensearch \
101+
oci://ghcr.io/openchoreo/helm-charts/observability-logs-opensearch \
102+
--namespace openchoreo-observability-plane \
103+
--version 0.5.3 \
104+
--reuse-values \
105+
--set "fluent-bit.tolerations[0].operator=Exists"
106+
```
107+
:::
108+
96109
:::tip Verify
97110
```bash
98111
kubectl get runtimeclass kata-qemu
@@ -101,6 +114,10 @@ kubectl get node <node-name> --show-labels # kata=true
101114
```
102115
:::
103116

117+
:::warning Keep the Fluent Bit toleration on later upgrades
118+
The toleration is stored in the `observability-logs-opensearch` release's values, so it must be present on every upgrade that re-renders the Fluent Bit DaemonSet. An upgrade with `--reset-values`, or one that passes new `--set`/`-f` values without `--reuse-values`, drops it unless you pass `--set "fluent-bit.tolerations[0].operator=Exists"` again. Agents on the Kata node then stop producing logs with no error.
119+
:::
120+
104121
<details>
105122
<summary>RKE2 nodes (bundled containerd)</summary>
106123

0 commit comments

Comments
 (0)