### Install and configure Grafana and Prometheus Source: https://kindnet.es/docs/tutorial/grafana Adds Helm repositories and installs the kube-prometheus-stack with custom values for scraping kindnet metrics. ```bash helm repo add prometheus-community https://prometheus-community.github.io/helm-charts helm repo add grafana https://grafana.github.io/helm-charts helm repo update helm install monitoring prometheus-community/kube-prometheus-stack --namespace monitoring --values grafana-prometheus-kindnet-scrape-config.yaml ``` -------------------------------- ### Access and query SQLite3 database Source: https://kindnet.es/docs/troubleshooting/faq Commands to open the SQLite3 database and perform example queries. ```sql sqlite3 db/kindnet-j7s8r-cni.db SQLite version 3.43.2 2023-10-10 13:08:14 Enter ".help" for usage hints. sqlite> .tables ipam_ranges pods portmap_entries sqlite> select * from pods limit 1; 159d3e9f868f1fdb36c4ace370888f4a900ebdabb5bf623b298f28a2f243b440|local-path-provisioner-57c5987fd4-gq4jb|local-path-storage|91e3e22d-5cdb-4851-b3c8-5211dba96b5d|/var/run/netns/cni-37f62d39-c60c-6257-d150-d4cc6c790403|192.168.1.209||192.168.1.0||knetc098226f|65535|2025-02-04 16:37:33 sqlite> select * from ipam_ranges; 1|192.168.1.0/24| ``` -------------------------------- ### Copy script execution output Source: https://kindnet.es/docs/troubleshooting/faq Example output after executing the file copy script. ```text Getting pods on worker node: home-lab-worker Copying files from pod: kindnet-sgtxm, container: kindnet-cni Getting pods on worker node: home-lab-worker2 Copying files from pod: kindnet-j7s8r, container: kindnet-cni Files copied to ./db ``` -------------------------------- ### Install Kindnet via kubectl Source: https://kindnet.es/docs/quick-start Use this command to apply the Kindnet manifest directly from the official repository to your Kubernetes cluster. ```bash kubectl create -f https://raw.githubusercontent.com/aojea/kindnet/main/install-kindnet.yaml ``` -------------------------------- ### kind cluster config with disableDefaultCNI and podSubnet Source: https://kindnet.es/docs/tutorial/grafana/multi-node-k8s-no-cni.yaml Defines a kind cluster with one control-plane and two worker nodes. Disables the default CNI (disableDefaultCNI: true) and sets the pod subnet to 192.168.0.0/16, which is required when installing a custom CNI like kindnet. ```yaml kind: Cluster apiVersion: kind.x-k8s.io/v1alpha4 nodes: - role: control-plane - role: worker - role: worker networking: disableDefaultCNI: true podSubnet: 192.168.0.0/16 ``` -------------------------------- ### kindnet Custom Resources YAML Source: https://kindnet.es/docs/tutorial/grafana/kindnet-custom-resources.yaml This YAML defines the Kubernetes resources for kindnet: a ClusterRole with permissions for nodes, configmaps, pods, namespaces, and networkpolicies; a ClusterRoleBinding binding the kindnet ClusterRole to the kindnet ServiceAccount in kube-system; a ServiceAccount named kindnet; a DaemonSet running kindnetd with hostNetwork, init container to install CNI binaries, and various flags; and a Service exposing kindnet-metrics on port 19080. ```yaml --- kind: ClusterRole apiVersion: rbac.authorization.k8s.io/v1 metadata: name: kindnet rules: - apiGroups: - "" resources: - nodes verbs: - list - watch - patch - apiGroups: - "" resources: - nodes/proxy - nodes/configz verbs: - get - apiGroups: - "" resources: - configmaps verbs: - get - apiGroups: - "" resources: - pods - namespaces verbs: - list - watch - apiGroups: - "networking.k8s.io" resources: - networkpolicies verbs: - list - watch --- kind: ClusterRoleBinding apiVersion: rbac.authorization.k8s.io/v1 metadata: name: kindnet roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: kindnet subjects: - kind: ServiceAccount name: kindnet namespace: kube-system --- apiVersion: v1 kind: ServiceAccount metadata: name: kindnet namespace: kube-system --- apiVersion: apps/v1 kind: DaemonSet metadata: name: kindnet namespace: kube-system labels: tier: node app: kindnet k8s-app: kindnet spec: selector: matchLabels: app: kindnet template: metadata: labels: tier: node app: kindnet k8s-app: kindnet spec: hostNetwork: true tolerations: - operator: Exists effect: NoSchedule serviceAccountName: kindnet initContainers: - name: install-cni-bin image: ghcr.io/aojea/kindnetd:stable command: ['sh', '-c', 'cat /opt/cni/bin/cni-kindnet > /cni/cni-kindnet ; chmod +x /cni/cni-kindnet'] volumeMounts: - name: cni-bin mountPath: /cni containers: - name: kindnet-cni image: ghcr.io/aojea/kindnetd:stable command: - /bin/kindnetd - --hostname-override=$(NODE_NAME) - --network-policy=true - --admin-network-policy=false - --baseline-admin-network-policy=false - --masquerading=true - --dns-caching=true - --disable-cni=false - --fastpath-threshold=20 - --ipsec-overlay=false - --nat64=true - --v=2 env: - name: HOST_IP valueFrom: fieldRef: fieldPath: status.hostIP - name: POD_IP valueFrom: fieldRef: fieldPath: status.podIP - name: NODE_NAME valueFrom: fieldRef: fieldPath: spec.nodeName volumeMounts: - name: cni-cfg mountPath: /etc/cni/net.d - name: var-lib-kindnet mountPath: /var/lib/cni-kindnet resources: requests: cpu: "100m" memory: "50Mi" securityContext: privileged: true volumes: - name: cni-bin hostPath: path: /opt/cni/bin type: DirectoryOrCreate - name: cni-cfg hostPath: path: /etc/cni/net.d type: DirectoryOrCreate - name: var-lib-kindnet hostPath: path: /var/lib/cni-kindnet type: DirectoryOrCreate --- apiVersion: v1 kind: Service metadata: name: kindnet-metrics namespace: kube-system spec: selector: app: kindnet ports: - protocol: TCP port: 19080 targetPort: 19080 ``` -------------------------------- ### Retrieve Grafana admin password Source: https://kindnet.es/docs/tutorial/grafana Gets the admin password from the Grafana secret in the monitoring namespace. ```bash kubectl get secrets --namespace monitoring monitoring-grafana -o jsonpath="{.data.admin-password}" | base64 -d ; echo ``` -------------------------------- ### Set up monitoring namespace and config map Source: https://kindnet.es/docs/tutorial/grafana Creates a monitoring namespace and a config map for the kindnet dashboard, then labels it for Grafana. ```bash kubectl apply -f monitoring-namespace.yaml kubectl create configmap kindnet-dashboards --from-file=kindnet-dashboard.json -n monitoring kubectl label configmap kindnet-dashboards grafana_dashboard=1 -n monitoring ``` -------------------------------- ### Deploy iperf client and server pods Source: https://kindnet.es/docs/user/fastpath Use kubectl to run the agnhost image as both a client and a server for network performance testing. ```bash $ kubectl run client --image=registry.k8s.io/e2e-test-images/agnhost:2.53 $ kubectl run server --image=registry.k8s.io/e2e-test-images/agnhost:2.53 ``` -------------------------------- ### List nftables table kindnet-fastpath Source: https://kindnet.es/docs/user/fastpath Use this command to inspect the nftables configuration for the Kindnet fastpath. The output shows the flowtable with the list of interfaces and the chain with a counter. If the counter does not increase, no connections are being accelerated. ```bash $ nft list table inet kindnet-fastpath table inet kindnet-fastpath { comment "rules for kindnet fastpath" flowtable kindnet-flowtables { hook ingress priority filter devices = { eth0, knet379d0a5f, knetabb40db0 } } chain kindnet-fastpath-chain { type filter hook forward priority -110; policy accept; ct packets > 20 flow add @kindnet-flowtables counter packets 1 bytes 7292 } } ``` -------------------------------- ### Bash script to copy SQLite3 database files Source: https://kindnet.es/docs/troubleshooting/faq A script to copy SQLite3 database files from Kindnet pods to a local directory. ```bash #!/bin/bash NAMESPACE="kube-system" LABEL_SELECTOR="app=kindnet" CONTAINER_NAME="kindnet-cni" DEST_DIR="./db" # Create destination directory if it doesn't exist mkdir -p $DEST_DIR # Get the names of worker nodes WORKER_NODES=$(kubectl get nodes -o json | jq -r '.items[] | select(.metadata.labels["node-role.kubernetes.io/control-plane"] | not) | .metadata.name') # Loop through each worker node and get the Kindnet pods running on them for NODE in $WORKER_NODES; do echo "Getting pods on worker node: $NODE" PODS=$(kubectl get pods -n $NAMESPACE -l $LABEL_SELECTOR --field-selector spec.nodeName=$NODE -o custom-columns=:metadata.name) # Loop through each pod and copy the files for POD in $PODS; do echo "Copying files from pod: $POD, container: $CONTAINER_NAME" kubectl cp $NAMESPACE/$POD:var/lib/cni-kindnet/cni.db $DEST_DIR/$POD-cni.db -c $CONTAINER_NAME 2>/dev/null kubectl cp $NAMESPACE/$POD:var/lib/cni-kindnet/cni.db-wal $DEST_DIR/$POD-cni.db-wal -c $CONTAINER_NAME 2>/dev/null kubectl cp $NAMESPACE/$POD:var/lib/cni-kindnet/cni.db-shm $DEST_DIR/$POD-cni.db-shm -c $CONTAINER_NAME 2>/dev/null done done echo "Files copied to $DEST_DIR" ``` -------------------------------- ### Run iperf test with fastpath enabled Source: https://kindnet.es/docs/user/fastpath Execute the same iperf test after enabling fastpath to observe the performance improvement in throughput. ```bash $ kubectl exec -it client -- iperf -c 10.244.1.32 ------------------------------------------------------------ Client connecting to 10.244.1.32, TCP port 5001 TCP window size: 16.0 KByte (default) ------------------------------------------------------------ [ 1] local 10.244.2.93 port 42212 connected with 10.244.1.32 port 5001 [ ID] Interval Transfer Bandwidth [ 1] 0.00-10.00 sec 44.4 GBytes 38.1 Gbits/sec ``` -------------------------------- ### Configure kindnet CNI Source: https://kindnet.es/docs/tutorial/grafana Applies the kindnet CNI configuration to the cluster. ```bash kubectl apply -f kindnet-custom-resources.yaml ``` -------------------------------- ### Retrieve Kindnet logs Source: https://kindnet.es/docs/troubleshooting/faq Command to retrieve and follow the logs of the Kindnet DaemonSet in the kube-system namespace. ```bash kubectl -n kube-system logs ds/kindnet -f ``` -------------------------------- ### Kindnet binary location Source: https://kindnet.es/docs/troubleshooting/faq The path to the Kindnet lightweight daemon binary file. ```text /bin/kindnetd ``` -------------------------------- ### Run iperf test without fastpath Source: https://kindnet.es/docs/user/fastpath Execute an iperf test from the client pod to the server pod to establish a baseline performance measurement. ```bash $ kubectl exec -it client -- iperf -c 10.244.1.32 ------------------------------------------------------------ Client connecting to 10.244.1.32, TCP port 5001 TCP window size: 16.0 KByte (default) ------------------------------------------------------------ [ 1] local 10.244.2.93 port 55398 connected with 10.244.1.32 port 5001 [ ID] Interval Transfer Bandwidth [ 1] 0.00-10.01 sec 37.5 GBytes 32.1 Gbits/sec ``` -------------------------------- ### Verify logs for a specific pod Source: https://kindnet.es/docs/troubleshooting/faq Command to verify logs for a specific pod identified by name. ```bash kubectl -n kube-system logs kindnet-z5tst -f ``` -------------------------------- ### CNI configuration file path Source: https://kindnet.es/docs/troubleshooting/faq The path to the configuration file used by the CNI. ```text /etc/cni/net.d/10-kindnet.conflist ``` -------------------------------- ### Create kind cluster without CNI Source: https://kindnet.es/docs/tutorial/grafana Creates a kind cluster without a CNI plugin using a multi-node configuration file. ```bash kind create cluster --config multi-node-k8s-no-cni.yaml --name home-lab ``` -------------------------------- ### CNI configuration file for cni-kindnet Source: https://kindnet.es/docs/design/cni Configuration file for the cni-kindnet plugin. It expects the 'ranges' field to be populated with IP ranges for Pods, and enables the portMappings capability for hostPort support. ```json { "cniVersion": "0.4.0", "name": "kindnet", "plugins": [ { "type": "cni-kindnet", "ranges": [ "10.244.2.0/24" ], "capabilities": {"portMappings": true} } ] } ``` -------------------------------- ### CNI plugin binary location Source: https://kindnet.es/docs/troubleshooting/faq The path to the CNI plugin binary file. ```text /opt/cni/bin/cni-kindnet ``` -------------------------------- ### Identify Kindnet pod name Source: https://kindnet.es/docs/troubleshooting/faq Command to find the name of a specific Kindnet pod running on a selected node. ```bash kubectl get pods -n kube-system -l app=kindnet -o custom-columns=NAME:.metadata.name,NODE:.spec.nodeName ``` -------------------------------- ### SQLite schema for ipam_ranges table Source: https://kindnet.es/docs/design/cni Creates the ipam_ranges table to store IP ranges used for Pod IP allocation. The subnet is in CIDR notation and an optional description is allowed. ```sql CREATE TABLE IF NOT EXISTS ipam_ranges ( id INTEGER PRIMARY KEY AUTOINCREMENT, -- Unique identifier for the IP range subnet TEXT NOT NULL, -- Subnet in CIDR notation (e.g., "10.244.0.0/16") description TEXT -- Optional description of the IP range ); ``` -------------------------------- ### Edit Kindnet configuration Source: https://kindnet.es/docs/troubleshooting/faq Command to edit the Kindnet DaemonSet configuration to change log verbosity. ```bash kubectl -n kube-system edit ds/kindnet ``` -------------------------------- ### Configure fastpath threshold in Kindnet Source: https://kindnet.es/docs/user/fastpath Set the --fastpath-threshold flag in the container arguments to define the packet count required to trigger offloading. Setting this value to 0 disables the feature. ```yaml containers: - args: - /bin/kindnetd - --hostname-override=$(NODE_NAME) - --fastpath-threshold=6 - --v=2 ``` -------------------------------- ### SQLite schema for portmap_entries table Source: https://kindnet.es/docs/design/cni Creates the portmap_entries table to store hostPort mappings. Entries are automatically deleted when the associated Pod is deleted from the pods table via a foreign key with ON DELETE CASCADE. ```sql CREATE TABLE IF NOT EXISTS portmap_entries ( id INTEGER PRIMARY KEY AUTOINCREMENT, container_id TEXT NOT NULL, host_ip TEXT NOT NULL, host_port INTEGER NOT NULL, protocol TEXT NOT NULL, container_ip TEXT NOT NULL, container_port INTEGER NOT NULL, FOREIGN KEY (container_id) REFERENCES pods(container_id) ON DELETE CASCADE, UNIQUE (host_ip, host_port, protocol) -- Unique constraint ); ``` -------------------------------- ### SQLite schema for pods table Source: https://kindnet.es/docs/design/cni Creates the pods table to store Pod information including container ID, network namespace, assigned IPs, gateways, and interface details. Enforces uniqueness on IPv4 and IPv6 addresses. ```sql CREATE TABLE IF NOT EXISTS pods ( container_id TEXT PRIMARY KEY, -- ID of the pod Sandbox on the container runtime name TEXT, -- Kubernetes name of the pod namespace TEXT, -- Kubernetes namespace of the pod uid TEXT, -- Kubernetes UID of the pod netns TEXT NOT NULL, -- Network namespace path of the pod ip_address_v4 TEXT, -- IPv4 address assigned to the pod ip_address_v6 TEXT, -- IPv6 address assigned to the pod ip_gateway_v4 TEXT, -- IPv4 gateway assigned to the pod ip_gateway_v6 TEXT, -- IPv6 gateway assigned to the pod interface_name TEXT NOT NULL, -- Name of the network interface of the pod in the host interface_mtu INTEGER, -- Interface mtu creation_timestamp DATETIME DEFAULT CURRENT_TIMESTAMP, -- Timestamp of pod creation UNIQUE (ip_address_v4), -- Unique constraint for IPv4 address UNIQUE (ip_address_v6) -- Unique constraint for IPv6 address ); ``` -------------------------------- ### Configure Prometheus Scrape Job for Kindnet Source: https://kindnet.es/docs/user/monitoring Add this configuration to your prometheus.yml file to enable Prometheus to scrape metrics from the Kindnet endpoint. Adjust the targets field if your Kindnet metrics are exposed on a different address or port. ```yaml scrape_configs: - job_name: 'kindnet' static_configs: - targets: ['localhost:19080'] ``` -------------------------------- ### Forward port for Grafana Source: https://kindnet.es/docs/tutorial/grafana Forwards the Grafana service port to localhost for browser access. ```bash kubectl port-forward --namespace monitoring svc/monitoring-grafana 3000:80 ``` -------------------------------- ### Grafana dashboard JSON for Kindnet Source: https://kindnet.es/docs/tutorial/grafana/kindnet-dashboard.json Full dashboard configuration with two panels: 'Connection errors' (timeseries) and 'TCP connection latency' (gauge). Uses Prometheus datasource and queries kindnet metrics. ```json { "datasource": { "type": "prometheus", "uid": "prometheus" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "auto", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] } }, "overrides": [] }, "gridPos": { "h": 8, "w": 9, "x": 9, "y": 16 }, "id": 8, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "hideZeros": false, "mode": "single", "sort": "none" } }, "pluginVersion": "11.5.2", "targets": [ { "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, "disableTextWrap": false, "editorMode": "builder", "expr": "sum(rate(kindnet_conntrack_stats_error_total[5m]))", "fullMetaSearch": false, "includeNullMetadata": true, "legendFormat": "__auto", "range": true, "refId": "A", "useBackend": false } ], "title": "Connection errors", "type": "timeseries" } ``` ```json { "datasource": { "type": "prometheus", "uid": "prometheus" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] } }, "overrides": [] }, "gridPos": { "h": 8, "w": 6, "x": 18, "y": 16 }, "id": 6, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, "minVizHeight": 75, "minVizWidth": 75, "orientation": "auto", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showThresholdLabels": false, "showThresholdMarkers": true, "sizing": "auto", "tooltip": { "hideZeros": false, "mode": "single", "sort": "none" } }, "pluginVersion": "11.5.2", "targets": [ { "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, "disableTextWrap": false, "editorMode": "builder", "expr": "sum(kindnet_conntrack_tcp_connection_seen_reply_latency_milliseconds_sum)", "fullMetaSearch": false, "includeNullMetadata": true, "legendFormat": "__auto", "range": true, "refId": "A", "useBackend": false } ], "title": "TCP connection latency", "type": "gauge" } ``` -------------------------------- ### Kindnet klog logging flags Source: https://kindnet.es/docs/user/configuration Logging flags available because Kindnet uses klog. These control log output, file location, verbosity, and thresholds. Note that some flags have no effect when -logtostderr=true. ```text -add_dir_header If true, adds the file directory to the header of the log messages -alsologtostderr log to standard error as well as files (no effect when -logtostderr=true) -log_backtrace_at value when logging hits line file:N, emit a stack trace -log_dir string If non-empty, write log files in this directory (no effect when -logtostderr=true) -log_file string If non-empty, use this log file (no effect when -logtostderr=true) -log_file_max_size uint Defines the maximum size a log file can grow to (no effect when -logtostderr=true). Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800) -logtostderr log to standard error instead of files (default true) -one_output If true, only write logs to their native severity level (vs also writing to each lower severity level; no effect when -logtostderr=true) -skip_headers If true, avoid header prefixes in the log messages -skip_log_headers If true, avoid headers when opening log files (no effect when -logtostderr=true) -stderrthreshold value logs at or above this threshold go to stderr when writing to files and stderr (no effect when -logtostderr=true or -alsologtostderr=true) (default 2) -v value number for the log level verbosity -vmodule value comma-separated list of pattern=N settings for file-filtered logging ``` -------------------------------- ### Grafana dashboard JSON for kindnet conntrack metrics Source: https://kindnet.es/docs/tutorial/grafana/kindnet-dashboard.json Full Grafana dashboard JSON configuration with two timeseries panels: one for connection packets sum (TCP and UDP) and one for connection duration using histogram_quantile. The panels use Prometheus data source and are configured with specific grid positions and options. ```json { "datasource": { "type": "prometheus", "uid": "prometheus" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "barWidthFactor": 0.6, "drawStyle": "bars", "fillOpacity": 80, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "auto", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] } }, "overrides": [ { "__systemRef": "hideSeriesFrom", "matcher": { "id": "byNames", "options": { "mode": "exclude", "names": [ "histogram_quantile(0.95, sum(rate(kindnet_conntrack_connection_duration_seconds_bucket[5m])) by (le))" ], "prefix": "All except:", "readOnly": true } }, "properties": [ { "id": "custom.hideFrom", "value": { "legend": false, "tooltip": false, "viz": true } } ] } ] }, "gridPos": { "h": 8, "w": 12, "x": 0, "y": 8 }, "id": 5, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "hideZeros": false, "mode": "single", "sort": "none" } }, "pluginVersion": "11.5.2", "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "disableTextWrap": false, "editorMode": "builder", "expr": "histogram_quantile(0.95, sum(rate(kindnet_conntrack_connection_duration_seconds_bucket[5m])) by (le))", "fullMetaSearch": false, "hide": false, "includeNullMetadata": false, "instant": false, "legendFormat": "__auto", "range": true, "refId": "A", "useBackend": false } ], "title": "Connection duration", "type": "timeseries" } ``` -------------------------------- ### Kindnet feature flags Source: https://kindnet.es/docs/user/configuration Flags to customize Kindnet network behavior, including control-plane endpoint, DNS caching, masquerading, NAT64, network policy, and fast path threshold. Pass these to the kind create cluster command. ```text -control-plane-endpoint string The URL of the control plane -dns-caching If set, enable Kubernetes DNS caching (default false) -hostname-override string If non-empty, will be used as the name of the Node that kube-network-policies is running on. If unset, the node name is assumed to be the same as the node's hostname. -masquerading masquerade with the Node IP the cluster to external traffic (default true) -metrics-bind-address string The IP address and port for the metrics server to serve on (default ":19080") -nat64 If set, enable NAT64 using the reserved prefix 64:ff9b::/96 on IPv6 only clusters (default true on IPv6 clusters) -network-policy If set, enable Network Policies (default true) -no-masquerade-cidr string Comma seperated list of CIDRs that will not be masqueraded. -fastpath-threshold int The number of packets after the traffic is offloaded to the fast path, zero disables it (default 20). ``` -------------------------------- ### Exclude IP ranges from masquerading with --no-masquerade-cidr Source: https://kindnet.es/docs/user/masquerade Use this flag to provide a comma-separated list of CIDR ranges that should not be masqueraded by Kindnet. ```bash --no-masquerade-cidr="192.168.1.0/24,10.10.0.0/16" ``` -------------------------------- ### Grafana panel: Top talkers by connection bytes Source: https://kindnet.es/docs/tutorial/grafana/kindnet-dashboard.json Grafana panel definition for the 'Top talkers by connection bytes' timeseries. Uses Prometheus datasource with expression topk(10, sum by(src_ip) (rate(kindnet_conntrack_connection_bytes_total_sum[5m]))). ```json "id": 9, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "hideZeros": false, "mode": "single", "sort": "none" } }, "pluginVersion": "11.5.2", "targets": [ { "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, "disableTextWrap": false, "editorMode": "builder", "expr": "topk(10, sum by(src_ip) (rate(kindnet_conntrack_connection_bytes_total_sum[5m])))", "fullMetaSearch": false, "includeNullMetadata": true, "legendFormat": "__auto", "range": true, "refId": "A", "useBackend": false } ], "title": "Top talkers by connection bytes", "type": "timeseries" ``` -------------------------------- ### Grafana gridPos for top talkers panel Source: https://kindnet.es/docs/tutorial/grafana/kindnet-dashboard.json Grid position for the 'Top talkers by connection bytes' panel: height 8, width 12, at x=12, y=8. ```json "gridPos": { "h": 8, "w": 12, "x": 12, "y": 8 } ``` -------------------------------- ### Grafana timeseries fieldConfig defaults Source: https://kindnet.es/docs/tutorial/grafana/kindnet-dashboard.json Grafana panel field configuration for a timeseries visualization. Sets palette-classic colors, line style, and an absolute threshold with a red step at value 80. ```json "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "auto", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] } }, "overrides": [] ``` -------------------------------- ### Grafana panel: Packet drop Source: https://kindnet.es/docs/tutorial/grafana/kindnet-dashboard.json Grafana panel definition for the 'Packet drop' timeseries. Uses Prometheus datasource with expression rate(kindnet_conntrack_stats_early_drop_total[5m]). ```json "datasource": { "type": "prometheus", "uid": "prometheus" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "auto", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] } }, "overrides": [] }, "gridPos": { "h": 8, "w": 9, "x": 0, "y": 16 }, "id": 7, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "hideZeros": false, "mode": "single", "sort": "none" } }, "pluginVersion": "11.5.2", "targets": [ { "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, "disableTextWrap": false, "editorMode": "builder", "expr": "rate(kindnet_conntrack_stats_early_drop_total[5m])", "fullMetaSearch": false, "includeNullMetadata": true, "legendFormat": "__auto", "range": true, "refId": "A", "useBackend": false } ], "title": "Packet drop", "type": "timeseries" ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.