diff options
| author | Paul Buetow <paul@buetow.org> | 2025-12-26 23:35:12 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-12-26 23:35:12 +0200 |
| commit | aecb38c82f165b1c9ad38fb31d5bf39ee8c453ee (patch) | |
| tree | 619ca750bb2150107d72fcbf774969864b3dfff9 /gemfeed | |
| parent | 68c184731cae75640d3c910b7f3397373e35a690 (diff) | |
Update content for gemtext
Diffstat (limited to 'gemfeed')
| -rw-r--r-- | gemfeed/2025-07-14-f3s-kubernetes-with-freebsd-part-6.gmi | 11 | ||||
| -rw-r--r-- | gemfeed/2025-07-14-f3s-kubernetes-with-freebsd-part-6.gmi.tpl | 11 | ||||
| -rw-r--r-- | gemfeed/DRAFT-f3s-kubernetes-with-freebsd-part-X-OBSERVABILITY2.gmi | 131 | ||||
| -rw-r--r-- | gemfeed/atom.xml | 16 |
4 files changed, 162 insertions, 7 deletions
diff --git a/gemfeed/2025-07-14-f3s-kubernetes-with-freebsd-part-6.gmi b/gemfeed/2025-07-14-f3s-kubernetes-with-freebsd-part-6.gmi index 90de2f83..2c63f3b4 100644 --- a/gemfeed/2025-07-14-f3s-kubernetes-with-freebsd-part-6.gmi +++ b/gemfeed/2025-07-14-f3s-kubernetes-with-freebsd-part-6.gmi @@ -1543,10 +1543,17 @@ Domain = lan.buetow.org . ``` -And afterwards, we need to run the following on all 3 Rocky hosts:: +We also need to increase the inotify limit, otherwise nfs-idmapd may fail to start with "Too many open files": ```sh -[root@r0 ~]# systemctl enable --now nfs-idmapd +[root@r0 ~]# echo 'fs.inotify.max_user_instances = 512' > /etc/sysctl.d/99-inotify.conf +[root@r0 ~]# sysctl -w fs.inotify.max_user_instances=512 +``` + +And afterwards, we need to run the following on all 3 Rocky hosts: + +```sh +[root@r0 ~]# systemctl start nfs-idmapd [root@r0 ~]# systemctl enable --now nfs-client.target ``` diff --git a/gemfeed/2025-07-14-f3s-kubernetes-with-freebsd-part-6.gmi.tpl b/gemfeed/2025-07-14-f3s-kubernetes-with-freebsd-part-6.gmi.tpl index 69ee77d0..cc5ea379 100644 --- a/gemfeed/2025-07-14-f3s-kubernetes-with-freebsd-part-6.gmi.tpl +++ b/gemfeed/2025-07-14-f3s-kubernetes-with-freebsd-part-6.gmi.tpl @@ -1486,10 +1486,17 @@ Domain = lan.buetow.org . ``` -And afterwards, we need to run the following on all 3 Rocky hosts:: +We also need to increase the inotify limit, otherwise nfs-idmapd may fail to start with "Too many open files": ```sh -[root@r0 ~]# systemctl enable --now nfs-idmapd +[root@r0 ~]# echo 'fs.inotify.max_user_instances = 512' > /etc/sysctl.d/99-inotify.conf +[root@r0 ~]# sysctl -w fs.inotify.max_user_instances=512 +``` + +And afterwards, we need to run the following on all 3 Rocky hosts: + +```sh +[root@r0 ~]# systemctl start nfs-idmapd [root@r0 ~]# systemctl enable --now nfs-client.target ``` diff --git a/gemfeed/DRAFT-f3s-kubernetes-with-freebsd-part-X-OBSERVABILITY2.gmi b/gemfeed/DRAFT-f3s-kubernetes-with-freebsd-part-X-OBSERVABILITY2.gmi new file mode 100644 index 00000000..4968211f --- /dev/null +++ b/gemfeed/DRAFT-f3s-kubernetes-with-freebsd-part-X-OBSERVABILITY2.gmi @@ -0,0 +1,131 @@ +# f3s: Kubernetes with FreeBSD - Part 9: Enabling etcd Metrics + +## Introduction + +This post covers enabling etcd metrics monitoring for the k3s cluster. The etcd dashboard in Grafana initially showed no data because k3s uses an embedded etcd that doesn't expose metrics by default. + +=> ./2025-12-07-f3s-kubernetes-with-freebsd-part-8.html Part 8: Observability + +## Enabling etcd metrics in k3s + +On each control-plane node (r0, r1, r2), create /etc/rancher/k3s/config.yaml: + +``` +etcd-expose-metrics: true +``` + +Then restart k3s on each node: + +``` +systemctl restart k3s +``` + +After restarting, etcd metrics are available on port 2381: + +``` +curl http://127.0.0.1:2381/metrics | grep etcd +``` + +## Configuring Prometheus to scrape etcd + +In persistence-values.yaml, enable kubeEtcd with the node IP addresses: + +``` +kubeEtcd: + enabled: true + endpoints: + - 192.168.1.120 + - 192.168.1.121 + - 192.168.1.122 + service: + enabled: true + port: 2381 + targetPort: 2381 +``` + +Apply the changes: + +``` +just upgrade +``` + +## Verifying etcd metrics + +After the changes, all etcd targets are being scraped: + +``` +kubectl exec -n monitoring prometheus-prometheus-kube-prometheus-prometheus-0 \ + -c prometheus -- wget -qO- 'http://localhost:9090/api/v1/query?query=etcd_server_has_leader' | \ + jq -r '.data.result[] | "\(.metric.instance): \(.value[1])"' +``` + +Output: + +``` +192.168.1.120:2381: 1 +192.168.1.121:2381: 1 +192.168.1.122:2381: 1 +``` + +The etcd dashboard in Grafana now displays metrics including Raft proposals, leader elections, and peer round trip times. + +## Complete persistence-values.yaml + +The complete updated persistence-values.yaml: + +``` +kubeEtcd: + enabled: true + endpoints: + - 192.168.1.120 + - 192.168.1.121 + - 192.168.1.122 + service: + enabled: true + port: 2381 + targetPort: 2381 + +prometheus: + prometheusSpec: + additionalScrapeConfigsSecret: + enabled: true + name: additional-scrape-configs + key: additional-scrape-configs.yaml + storageSpec: + volumeClaimTemplate: + spec: + storageClassName: "" + accessModes: ["ReadWriteOnce"] + resources: + requests: + storage: 10Gi + selector: + matchLabels: + type: local + app: prometheus + +grafana: + persistence: + enabled: true + type: pvc + existingClaim: "grafana-data-pvc" + + initChownData: + enabled: false + + podSecurityContext: + fsGroup: 911 + runAsUser: 911 + runAsGroup: 911 +``` + +## Summary + +Enabled etcd metrics monitoring for the k3s embedded etcd by: + +* Adding etcd-expose-metrics: true to /etc/rancher/k3s/config.yaml on each control-plane node +* Configuring Prometheus to scrape etcd on port 2381 + +The etcd dashboard now provides visibility into cluster health, leader elections, and Raft consensus metrics. + +=> https://codeberg.org/snonux/conf/src/branch/master/f3s/prometheus prometheus configuration on Codeberg diff --git a/gemfeed/atom.xml b/gemfeed/atom.xml index 89bf6a50..75c62d76 100644 --- a/gemfeed/atom.xml +++ b/gemfeed/atom.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <feed xmlns="http://www.w3.org/2005/Atom"> - <updated>2025-12-26T08:51:40+02:00</updated> + <updated>2025-12-26T23:33:35+02:00</updated> <title>foo.zone feed</title> <subtitle>To be in the .zone!</subtitle> <link href="gemini://foo.zone/gemfeed/atom.xml" rel="self" /> @@ -6673,13 +6673,23 @@ Domain = lan.buetow.org . </pre> <br /> -<span>And afterwards, we need to run the following on all 3 Rocky hosts::</span><br /> +<span>We also need to increase the inotify limit, otherwise nfs-idmapd may fail to start with "Too many open files":</span><br /> <br /> <!-- Generator: GNU source-highlight 3.1.9 by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre>[root@r0 ~]<i><font color="silver"># systemctl enable --now nfs-idmapd</font></i> +<pre>[root@r0 ~]<i><font color="silver"># echo 'fs.inotify.max_user_instances = 512' > /etc/sysctl.d/99-inotify.conf</font></i> +[root@r0 ~]<i><font color="silver"># sysctl -w fs.inotify.max_user_instances=512</font></i> +</pre> +<br /> +<span>And afterwards, we need to run the following on all 3 Rocky hosts:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>[root@r0 ~]<i><font color="silver"># systemctl start nfs-idmapd</font></i> [root@r0 ~]<i><font color="silver"># systemctl enable --now nfs-client.target</font></i> </pre> <br /> |
