You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds configuration to customize resolv.conf file paths
for pod and node DNS resolution in network disruptions.
Users can now override default paths via Helm values,
ConfigMap, or CLI flags to support different Kubernetes
distributions (systemd-resolved, NetworkManager, etc.).
Configuration:
- injector.networkDisruption.dnsPodResolvConf
- injector.networkDisruption.dnsNodeResolvConf
Defaults: /etc/resolv.conf (pod),
/mnt/host/etc/resolv.conf (node)
Logs show which resolv.conf files are loaded with their
nameservers for debugging.
Jira: CHAOSPLT-1360
mainFS.StringVar(&cfg.Injector.NetworkDisruption.DNSPodResolvConf, "injector-network-disruption-dns-pod-resolv-conf", "/etc/resolv.conf", "Path to pod DNS resolv.conf file")
mainFS.StringVar(&cfg.Injector.NetworkDisruption.DNSNodeResolvConf, "injector-network-disruption-dns-node-resolv-conf", "/mnt/host/etc/resolv.conf", "Path to node DNS resolv.conf file")
-**`pod-fallback-node`** (default): Use when you want resilience - try pod DNS first but fall back to node DNS if it fails
291
293
-**`node-fallback-pod`**: Use when node DNS is preferred but you want pod DNS as a backup
292
294
295
+
#### Customizing resolv.conf Paths
296
+
297
+
By default, the chaos-controller uses these locations for resolv.conf files:
298
+
299
+
-**Pod DNS**: `/etc/resolv.conf`
300
+
-**Node DNS**: `/mnt/host/etc/resolv.conf`
301
+
302
+
These defaults are set in the controller configuration. Some Kubernetes distributions or node configurations may use different locations for resolv.conf. You can override the defaults using Helm values:
3. The injector uses these paths for DNS resolution
353
+
4. Logs will show which resolv.conf files were loaded:
354
+
```
355
+
INFO loaded pod DNS configuration resolv_conf_path=/run/systemd/resolve/resolv.conf nameservers=[8.8.8.8, 8.8.4.4]
356
+
INFO loaded node DNS configuration resolv_conf_path=/mnt/host/run/systemd/resolve/stub-resolv.conf nameservers=[10.0.0.1]
357
+
```
358
+
359
+
You can verify the paths used by an injector pod:
360
+
```bash
361
+
kubectl describe pod chaos-injector-xxxxx -n chaos-engineering | grep dns-
362
+
```
363
+
364
+
**Use cases:**
365
+
-**systemd-resolved**: Nodes using systemd-resolved may have resolv.conf at `/run/systemd/resolve/resolv.conf` or `/run/systemd/resolve/stub-resolv.conf`
366
+
-**NetworkManager**: Some distributions use `/run/NetworkManager/resolv.conf`
367
+
-**Custom Kubernetes distributions**: Distributions like k3s, microk8s, or OpenShift may use non-standard paths
368
+
-**Custom DNS configurations**: Environments with custom DNS setups that require specific resolv.conf locations
369
+
293
370
### Some special cases
294
371
295
372
Cluster IPs can also be specified to target the relevant pods.
0 commit comments