antix@antix:~/master$ vagrant ssh
Vagrant failed to initialize at a very early stage:
The plugins failed to initialize correctly. This may be due to manual
modifications made within the Vagrant home directory. Vagrant can
attempt to automatically correct this issue by running:
vagrant plugin repair
If Vagrant was recently updated, this error may be due to incompatible
versions of dependencies. To fix this problem please remove and re-install
all plugins. Vagrant can attempt to do this automatically by running:
vagrant plugin expunge --reinstall
Or you may want to try updating the installed plugins to their latest
versions:
vagrant plugin update
Error message given during initialization: Unable to resolve dependency: user requested 'vagrant-libvirt (= 0.12.2)'
antix@antix:~/master$ vagrant ssh
Vagrant failed to initialize at a very early stage:
The plugins failed to initialize correctly. This may be due to manual
modifications made within the Vagrant home directory. Vagrant can
attempt to automatically correct this issue by running:
vagrant plugin repair
If Vagrant was recently updated, this error may be due to incompatible
versions of dependencies. To fix this problem please remove and re-install
all plugins. Vagrant can attempt to do this automatically by running:
vagrant plugin expunge --reinstall
Or you may want to try updating the installed plugins to their latest
versions:
vagrant plugin update
Error message given during initialization: Unable to resolve dependency: user requested 'vagrant-libvirt (= 0.12.2)'
antix@antix:~/master$ vagrant plugin repair
Repairing currently installed global plugins. This may take a few minutes...
Fetching xml-simple-1.1.9.gem
Fetching racc-1.8.1.gem
Building native extensions. This could take a while...
Fetching nokogiri-1.18.8-x86_64-linux-gnu.gem
Fetching ruby-libvirt-0.8.4.gem
Building native extensions. This could take a while...
Fetching formatador-1.1.0.gem
Fetching fog-core-2.6.0.gem
Fetching fog-xml-0.1.5.gem
Fetching fog-json-1.2.0.gem
Fetching fog-libvirt-0.13.2.gem
Fetching diffy-3.4.3.gem
Fetching vagrant-libvirt-0.12.2.gem
Failed to automatically repair installed Vagrant plugins. To fix this
problem remove all user installed plugins and reinstall. Vagrant can
do this for you automatically by running the following command:
vagrant plugin expunge --reinstall
Failure message received during repair:
Unable to resolve dependency: user requested 'vagrant-libvirt (= 0.12.2)'
antix@antix:~/master$
Assistant
User
Assistant
Your output shows that your Kubernetes cluster has multiple services running across various namespaces, many with LoadBalancer type services exposed on your local network IP 192.168.121.x. This is typical for clusters using MetalLB as the load balancer (confirmed by the metallb-system namespace showing up).
What you're seeing:
kubectl get svc -A lists all services (all namespaces).
kubectl get ep -A lists the endpoints for the services, i.e., the actual pod IPs and ports powering those services.
Your current affinity configuration restricts scheduling the pods on nodes labeled with:
User
vagrant@Master:~$ kubectl get pods -n prometheus -l app.kubernetes.io/name=prometheus-node-exporter -w
NAME READY STATUS RESTARTS AGE
prometheus-prometheus-node-exporter-cvkm7 0/1 Pending 0 9m47s
prometheus-prometheus-node-exporter-l46nw 0/1 Pending 0 9m47s
prometheus-prometheus-node-exporter-p8fzz 0/1 Pending 0 9m47s
^[[A^[[A^[[A^[[A
^Cvagrant@Master:kubectl get ep prometheus-prometheus-node-exporter -n prometheusus
NAME ENDPOINTS AGE
prometheus-prometheus-node-exporter 12h
vagrant@Master:$ kubectl edit ds prometheus-prometheus-node-exporter -n prometheus
error: daemonsets.apps "prometheus-prometheus-node-exporter" is invalid
A copy of your changes has been stored to "/tmp/kubectl-edit-1500215338.yaml"
error: Edit cancelled, no valid changes were saved.
Assistant
The error message:
User
Assistant
User
Events:
Type Reason Age From Message
Warning FailedScheduling 3m41s default-scheduler 0/3 nodes are available: 1 node(s) didn't have free ports for the requested pod ports, 2 node(s) didn't satisfy plugin(s) [NodeAffinity]. preemption: 0/3 nodes are available: 1 No preemption victims found for incoming pod, 2 Preemption is not helpful for scheduling.
vagrant@Master:~$
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Thu Apr 24 19:23:25 2025 from 192.168.121.1
vagrant@worker: kubectl describe nodes | grep -i taint
E0425 09:23:19.283394 6555 memcache.go:265] "Unhandled Error" err="couldn't get current server API group list: the server could not find the requested resource"
E0425 09:23:19.294294 6555 memcache.go:265] "Unhandled Error" err="couldn't get current server API group list: the server could not find the requested resource"
E0425 09:23:19.300624 6555 memcache.go:265] "Unhandled Error" err="couldn't get current server API group list: the server could not find the requested resource"
E0425 09:23:19.310081 6555 memcache.go:265] "Unhandled Error" err="couldn't get current server API group list: the server could not find the requested resource"
E0425 09:23:19.319136 6555 memcache.go:265] "Unhandled Error" err="couldn't get current server API group list: the server could not find the requested resource"
Error from server (NotFound): the server could not find the requested resource
vagrant@worker:$
Assistant
You are running kubectl describe nodes | grep -i taint on the worker node shell, but:
The error Error from server (NotFound): the server could not find the requested resource indicates kubectl cannot connect properly to the API server or lacks permissions.
Similarly the memcache.go errors indicate the client can’t get the API group info — probably your kubectl config on the worker node isn't set up or is broken.
What this means:
You need to run kubectl commands on the control plane/master node, where kubeconfig and permissions are correctly set.
User
vagrant@worker2:sudoss−tulpn∣grep:9100va sudo ss -tulpn | grep :9100
vagrant@worker2:$
Assistant
On worker2 node, port 9100 is not in use, so no port conflict there.
Next steps:
Check port 9100 usage on all other nodes (including master and other workers):
Make sure no node has port 9100 occupied:
ssh <node>
sudo ss -tulpn | grep :9100
Check node labels and taints on master node
Connect to your master node where kubectl works properly:
vagrant ssh master
Run:
kubectl get nodes --show-labels
kubectl describe nodes | grep -i taint
kubectl get ds prometheus-prometheus-node-exporter -n prometheus -o yaml | grep -A 15 affinity
User
vagrant@Master:~
Assistant
Thanks for sharing the output!
What we see:
All (, , ) are .
User
vagrant@Master: kubectl get ds prometheus-prometheus-node-exporter -n prometheus -o yaml | grep -A 15 affinity
vagrant@Master:
Assistant
User
vagrant@Master: kubectl get ds prometheus-prometheus-node-exporter -n prometheus -o jsonpath='{.spec.template.spec}'
{"automountServiceAccountToken":false,"containers":[{"args":["--path.procfs=/host/proc","--path.sysfs=/host/sys","--path.rootfs=/host/root","--path.udev.data=/host/root/run/udev/data","--web.listen-address=[(HOST_IP)]:9100"],"env":[{"name":"HOST_IP","value":"0.0.0.0"}],"image":"quay.io/prometheus/node-exporter:v1.9.1","imagePullPolicy":"IfNotPresent","livenessProbe":{"failureThreshold":3,"httpGet":{"path":"/","port":9100,"scheme":"HTTP"},"periodSeconds":10,"successThreshold":1,"timeoutSeconds":1},"name":"node-exporter","ports":[{"containerPort":9100,"name":"metrics","protocol":"TCP"}],"readinessProbe":{"failureThreshold":3,"httpGet":{"path":"/","port":9100,"scheme":"HTTP"},"periodSeconds":10,"successThreshold":1,"timeoutSeconds":1},"resources":{},"securityContext":{"allowPrivilegeEscalation":false,"readOnlyRootFilesystem":true},"terminationMessagePath":"/dev/termination-log","terminationMessagePolicy":"File","volumeMounts":[{"mountPath":"/host/proc","name":"proc","readOnly":true},{"mountPath":"/host/sys","name":"sys","readOnly":true},{"mountPath":"/host/root","mountPropagation":"HostToContainer","name":"root","readOnly":true}]}],"dnsPolicy":"ClusterFirst","hostNetwork":true,"hostPID":true,"nodeSelector":{"kubernetes.io/os":"linux"},"restartPolicy":"Always","schedulerName":"default-scheduler","securityContext":{"fsGroup":65534,"runAsGroup":65534,"runAsNonRoot":true,"runAsUser":65534},"serviceAccount":"prometheus-prometheus-node-exporter","serviceAccountName":"prometheus-prometheus-node-exporter","terminationGracePeriodSeconds":30,"tolerations":[{"effect":"NoSchedule","key":"node-role.kubernetes.io/master","operator":"Exists"}],"volumes":[{"hostPath":{"path":"/proc","type":""},"name":"proc"},{"hostPath":{"path":"/sys","type":""},"name":"sys"},{"hostPath":{"path":"/","type":""},"name":"root"}]}vagrant@Master:$
Assistant
User
Please edit the object below. Lines beginning with a '#' will be ignored,
and an empty file will abort the edit. If an error occurs while saving this file will be
It looks like you started editing the DaemonSet YAML but only included the head of the resource. To help you remove or edit something specific, please tell me exactly what you want to change. From previous discussions, I understand the goal might be to:
Remove the problematic affinity section (if present),
Or remove hostNetwork: true to avoid port conflicts,
Or remove the tolerations,
Or remove the hostPort if it's present (though from your previous output it is not set),
Or check and fix a specific field.
Here's what to do to remove the setting (which requires proper understanding because node-exporter typically needs hostNetwork for metrics):
User
how to vind host ip with vi
Assistant
If you want to find (search for) "host IP" or "host IP address" or any string matching "host ip" inside a file while editing it with vi or vim, use the following steps:
Steps to find a string (e.g., "host ip") inside vi/vim:
Open the file with vi or vim:
vi filename.yaml
Press / (forward slash) key to start a search.
Type the search string. For example:
host ip
or just:
host
Press Enter
The cursor will jump to the first match.
Press n to go to the next match, or N to go to the previous match.
For case insensitive search
You can add \c to your search to ignore case:
User
hostPort
Assistant
If you'd like to find hostPort inside a file using vi or vim editor, follow these steps:
Steps to search for hostPort inside vi/vim:
Open the file:
vi filename.yaml
Press / (slash key) — This puts vi in search mode.
Type the word you want to search, in this case:
hostPort
Press Enter
Your cursor will jump to the first occurrence of hostPort.
Press n to jump to the next occurrence.
Press N (capital) to jump to the previous occurrence.
Example:
User
Pattern not found
Assistant
Pattern not found means there is no hostPort entry in the file you are editing.
This aligns with the earlier output you shared — your DaemonSet spec does not include hostPort, so the node-exporter pods are not explicitly requesting a specific host port.
What to do next?
Since there's no hostPort, but pods set hostNetwork: true (meaning node-exporter binds port 9100 directly on the host network), your port conflict is still about multiple pods or processes trying to use port 9100 on the same node.
Recap and recommendations:
Because hostNetwork: true is set, only one pod can bind to port 9100 per node.
Check all your nodes with:
User
now what i did
Assistant
User
how to chek node exporter
Assistant
To check the status and health of node-exporter in your Kubernetes cluster, here’s what you typically do:
1. List node-exporter pods
kubectl get pods -n prometheus -l app.kubernetes.io/name=prometheus-node-exporter
This lists all node-exporter pods, showing status (Running, Pending, CrashLoopBackOff, etc.).
User
vagrant@Master:kubectl get pods -n prometheus -l app.kubernetes.io/name=prometheus-node-exporterer
NAME READY STATUS RESTARTS AGE
prometheus-prometheus-node-exporter-2bs59 1/1 Running 0 62s
prometheus-prometheus-node-exporter-dqp64 1/1 Running 0 62s
prometheus-prometheus-node-exporter-z7vcl 1/1 Running 0 62s
vagrant@Master:
Assistant
Great! From your output:
All three prometheus-prometheus-node-exporter pods are Running and ready.
The endpoints list includes pod IPs and port 9100, meaning the service correctly points to the pods.
This means your node-exporter is now working correctly and:
Pods are scheduled and running on all nodes.
Node Exporter pods are serving metrics on port 9100.
Prometheus can scrape metrics from these endpoints.
Next steps (optional):
To verify metrics are exposed, you can run port-forwarding on one node-exporter pod and curl metrics:
If all above works, your node-exporter is fully functional in your cluster!
If you have any other questions or issues, feel free to ask.
The error you're encountering:
Unable to resolve dependency: user requested 'vagrant-libvirt (= 0.12.2)'
indicates that the specific version 0.12.2 of the vagrant-libvirt plugin cannot be installed or its dependencies cannot be resolved, likely due to incompatible dependencies or an environment mismatch.
What to know here:
vagrant-libvirt plugin manages Vagrant integration with libvirt/KVM virtualization.
The error means either that version is no longer available/compatible with your Vagrant version or some dependencies failed to build/install properly.
Your attempt to run vagrant plugin repair failed for the same reason.
The recommended approach from Vagrant in this case is to wipe all plugins and reinstall them fresh.
How to fix step-by-step
Backup any plugin settings if you need them (usually safe to skip):
Warning FailedScheduling 11m (x12 over 66m) default-scheduler 0/3 nodes are available: 1 node(s) didn't have free ports for the requested pod ports, 2 node(s) didn't satisfy plugin(s) [NodeAffinity]. preemption: 0/3 nodes are available: 1 No preemption victims found for incoming pod, 2 Preemption is not helpful for scheduling.
vagrant@Master:~$
The scheduling failure event you see:
0/3 nodes are available: 1 node(s) didn't have free ports for the requested pod ports, 2 node(s) didn't satisfy plugin(s) [NodeAffinity].
means:
1 node already has port 9100 in use (the port node-exporter tries to bind with hostPort=9100).
2 nodes are blocked due to NodeAffinity constraints, so pods cannot be scheduled there.
What is happening?
Your Prometheus Node Exporter pods are DaemonSet pods that try to run on every node.
Each pod uses hostPort: 9100, so only one pod per node can bind port 9100.
One node already has something (likely another node-exporter pod or another process) using port 9100.
The other two nodes don’t satisfy the DaemonSet's node affinity rules, so the Pod can't be scheduled there.
Steps to fix
1. Check if another process or pod is already using port 9100 on the node with "port in use"
On the problematic node (you can check nodes with kubectl get nodes), ssh into it and run:
sudo lsof -i :9100
or
sudo netstat -tulpn | grep 9100
If something else is bound to 9100, you must either:
Stop that process; or
Change the node-exporter DaemonSet to use a different, free hostPort.
2. Inspect NodeAffinity rules on your DaemonSet
From the DaemonSet description, the nodeAffinity is not shown, but the error clearly complains about NodeAffinity.
Run:
kubectl get ds prometheus-prometheus-node-exporter -n prometheus -o yaml | grep -A 10 affinity
Or view the whole affinity section in the pod template:
kubectl get ds prometheus-prometheus-node-exporter -n prometheus -o yaml | less
Look for an affinity block under .spec.template.spec.affinity.
Possible common affinity could be something like scheduling only on nodes with a label like:
Find the container spec ports section, remove or comment out lines like:
hostPort: 9100
Save and exit.
Note: Removing hostPort means that node-exporter inside the pod listens on a container port only and is accessible only via cluster IP. This may require changes in Prometheus scrape configs.
Step 6: Wait and check pods
After applying fixes, check pods:
kubectl get pods -n prometheus -l app.kubernetes.io/name=prometheus-node-exporter
They should transition from Pending to Running.
Also check endpoints:
kubectl get ep prometheus-prometheus-node-exporter -n prometheus
Pods cannot run on nodes labeled eks.amazonaws.com/compute-type=fargate
Pods cannot run on nodes labeled type=virtual-kubelet
Your nodes likely either have one or both labels OR are missing required labels for these affinity rules.
How to fix your pending pods
Step 1: Check your node labels
Run this to see your node labels:
kubectl get nodes --show-labels
Look for any nodes with labels:
eks.amazonaws.com/compute-type=fargate
type=virtual-kubelet
If your nodes have these labels, the node affinity will prevent node-exporter pods from scheduling on them (ie: pods are excluded from nodes marked as fargate or virtual-kubelet).
If your nodes do NOT have these labels and pods still don't schedule, the affinity is likely not the cause blocking everything — but usually these labels are only present in AWS EKS (managed Kubernetes) environments.
Step 2: Temporarily remove or relax affinity to test
Edit the DaemonSet to remove the affinity block so scheduling restrictions are removed:
Delete or comment out the entire affinity: section under .spec.template.spec.
Save and exit.
Step 3: Check for port conflicts (as from previous problem)
Pods stuck pending can also be due to hostPort: 9100 conflicts.
Check all your nodes:
kubectl get nodes
SSH into each node and check if port 9100 is in use:
sudo lsof -i :9100
or
sudo netstat -tulpn | grep 9100
If port 9100 is busy on a node, either kill the process occupying it, or modify the DaemonSet to not use hostPort (advanced, requires changing Prometheus scrape config).
Step 4: After removing affinity, check pods status
Wait a minute, then check:
kubectl get pods -n prometheus -l app.kubernetes.io/name=prometheus-node-exporter
Pods should move from Pending to Running.
Also check endpoints:
kubectl get ep prometheus-prometheus-node-exporter -n prometheus
Summary of what you probably want to do right now:
After changes, monitor pod scheduling and readiness:
kubectl get pods -n prometheus -w
If you want, after trying this, share the output of kubectl get nodes --show-labels and the new pod status so I can assist further!
eks.amazonaws.com/compute-type=fargate
type=virtual-kubelet
Since you're likely running a local or on-prem cluster (not EKS Fargate), this affinity might unnecessarily restrict pods from scheduling if labels don't match or exist on your nodes.
How to fix
Option 1 — Remove or comment out the affinity block
Edit the DaemonSet to remove the affinity section so pods can schedule on all nodes:
Pod can only run on nodes NOT labeled with fargate or virtual-kubelet.
If your nodes don't have these labels at all, the selector might be effectively excluding them because they don't explicitly not match (depends on your kube scheduler version).
Removing this block lets pods schedule anywhere.
If after removal you still see pods stuck:
Check for port 9100 conflicts on nodes (sudo lsof -i :9100)
Check nodeReady status (kubectl get nodes)
Check pod events (kubectl describe pod <pod-name> -n prometheus)
Feel free to ask if you need help on editing or troubleshooting after this!
error: daemonsets.apps "prometheus-prometheus-node-exporter" is invalid
A copy of your changes has been stored to "/tmp/kubectl-edit-1500215338.yaml"
error: Edit cancelled, no valid changes were saved.
indicates that the edits you made to the DaemonSet were syntactically invalid (YAML formatting or structure issues) and so Kubernetes rejected them.
How to fix this edit error and correctly remove the affinity block
Steps:
Get the current DaemonSet YAML to a file:
kubectl get ds prometheus-prometheus-node-exporter -n prometheus -o yaml > node-exporter-ds.yaml
Open the file with your preferred editor (vim/nano/micro):
nano node-exporter-ds.yaml
Find the affinity: block under .spec.template.spec and completely remove it
For example, remove this section (including indentation):
Warning: Removing hostPort means the node-exporter pods will no longer be exposed on the node's network interface on port 9100. This might break Prometheus scraping unless your setup supports scraping pods directly or via a Service.
Summary of commands to run next:
Check pod details & events:
kubectl describe pod prometheus-prometheus-node-exporter-f7hbc -n prometheus
On all worker/master nodes, check port usage:
sudo ss -tulpn | grep 9100
List all node-exporter pods everywhere:
kubectl get pods --all-namespaces -o wide | grep node-exporter
Delete any duplicate or conflicting pods/processes.
Please paste here the Events section from kubectl describe pod ... if you'd like help interpreting it!
The key error message in the pod event:
0/3 nodes are available: 1 node(s) didn't have free ports for the requested pod ports, 2 node(s) didn't satisfy plugin(s) [NodeAffinity].
means:
1 node is blocked because port 9100 on the host is already in use, so the pod can't bind its required hostPort.
2 other nodes are still blocked by NodeAffinity, meaning the affinity problem was not fully removed or the nodes still don't satisfy the affinity.
Action Plan to fix this step-by-step:
1. Check port usage on all nodes to fix port conflict
On each node, SSH and run:
sudo ss -tulpn | grep :9100
or
sudo lsof -i :9100
If any process is listening on port 9100, identify and stop it.
It's common you might have an old node-exporter instance or some other process holding that port.
2. Check nodes' labels and affinity issues
Run:
kubectl get nodes --show-labels
Verify if the nodes have labels conflicting with DaemonSet affinity rules.
Since you patched affinity away in the DaemonSet, check if pod spec truly has no affinity:
and any port usage info from your nodes (ss/lsof), I can help you with exact next commands.
sudoss−tulpn∣grep:9100vagrant@worker:
Running kubectl from the worker node shell without proper kubeconfig configured will result in these errors.
What to do now
1. SSH or log into your Kubernetes master node
From your host:
vagrant ssh master
(Or however you access your master VM)
2. Run the commands on the master node to check node taints, labels, and affinity again:
kubectl get nodes --show-labels
kubectl describe nodes | grep -i taint
kubectl get ds prometheus-prometheus-node-exporter -n prometheus -o yaml | grep -A 15 affinity
3. Also double-check port 9100 usage on master and worker nodes
On each node (master and workers):
sudo ss -tulpn | grep :9100
Summary
The kubectl command on the worker does not have correct context/permissions to query kube API.
Run kubectl on the master node or on machine with proper kubeconfig.
Investigate taints, node labels, affinity from there.
Check port 9100 conflicts on all nodes.
If you want, share outputs of those commands from the master node and from port checks, and I can help you with the next steps to get node-exporter pods scheduled.
g
r
an
t
@
w
or
k
er
2
:
Verify that DaemonSet affinity is removed
Verify affinity block is gone:
kubectl get ds prometheus-prometheus-node-exporter -n prometheus -o yaml | grep -A 15 affinity
It should return no affinity block or empty {}.
Explanation:
One node is refusing to schedule node-exporter pods because port 9100 is busy.
Other two nodes are rejected due to affinity or taints.
So far on worker2, port 9100 free — good.
You need to check other nodes for port usage and taints.
If all nodes have free port 9100 and no taints preventing scheduling, pods should start running.
If after fixing that pods are still pending:
Paste output of kubectl describe pod <node-exporter-pod> -n prometheus to see fresh events.
Summary:
No port 9100 conflict on worker2 (good).
Check other nodes for conflict.
Check master node for node labels and taints.
Confirm DaemonSet affinity removed.
Let me know if you want help interpreting outputs when you get them!
Nodes have standard labels; none have the eks.amazonaws.com/compute-type or type=virtual-kubelet labels.
So, node affinity from the DaemonSet should NOT be preventing scheduling anymore (especially since you removed affinity).
Next: Check DaemonSet affinity
Please run:
kubectl get ds prometheus-prometheus-node-exporter -n prometheus -o yaml | grep -A 15 affinity
You want to confirm the affinity section is gone or empty.
It should return no output, or something like:
affinity: {}
Check port 9100 usage on master and worker nodes
Since worker2 has no port 9100 conflict, check on master and worker:
On master:
vagrant ssh master
sudo ss -tulpn | grep :9100
On worker:
vagrant ssh worker
sudo ss -tulpn | grep :9100
If either shows port 9100 in use, please stop/kill that process or pod.
Explanation of current situation
Earlier message:
0/3 nodes are available: 1 node(s) didn't have free ports for the requested pod ports, 2 node(s) didn't satisfy plugin(s) [NodeAffinity]
With no taints and no special affinity, the “2 nodes didn’t satisfy NodeAffinity” should no longer happen — but check DaemonSet affinity confirms this.
The “1 node with port conflict” means on one node port 9100 is occupied.
Alternative: Remove hostPort 9100 usage from DaemonSet
If you cannot free port 9100 on the conflicting node, you can edit DaemonSet to remove hostPort: 9100:
No node affinity configured on the node-exporter DaemonSet (empty output means no affinity section)
No processes on any node are listening on port 9100
Yet node-exporter pods remain Pending, with the error 1 node(s) didn't have free ports—which doesn't reflect reality now, since no port conflict exists.
This is unusual
Since:
No affinity blocking scheduling
No ports in use to block hostPort binding
No taints blocking pods
Nodes are Ready
Pods should schedule immediately.
Next steps to troubleshoot:
1. Describe node-exporter pods again & collect scheduling failure events
Run:
kubectl describe pod <pod-name> -n prometheus
(e.g.)
kubectl get pods -n prometheus -l app.kubernetes.io/name=prometheus-node-exporter
kubectl describe pod prometheus-prometheus-node-exporter-f7hbc -n prometheus
Look specifically at Events at end for current failure reasons.
2. Check for any scheduling restrictions or constraints blocking pod placement:
kubectl get ds prometheus-prometheus-node-exporter -n prometheus -o jsonpath='{.spec.template.spec}'
Look for:
nodeSelector
tolerations
affinity (should be empty as you showed)
hostPort: 9100 is probably still present — keep in mind!
hostNetwork: true is set, which means the container shares the host's network namespace.
No hostPort is explicitly configured, which is good — avoids port conflicts via hostPort.
nodeSelector enforces scheduling only on Linux nodes — your nodes satisfy this.
There is a toleration for node-role.kubernetes.io/master:NoSchedule, which means these pods can run on master nodes that have that taint.
The pods listen on 0.0.0.0:9100 inside the host's network namespace, so effectively binding port 9100 on the node interface.
Why might pods still be Pending?
Even though no explicit hostPort is set, hostNetwork: true + container listening on port 9100 means the pod tries to bind port 9100 on the node's network interface directly.
If port 9100 is already in use on a node, this will block pod scheduling on that node.
Since you previously saw an error about port 9100 conflict, likely one node has another process or pod already listening on 9100 port on host network.
Please run these checks next:
Check which process (if any) is listening on port 9100 on each node:
sudo ss -tulpn | grep :9100
If you find an existing node-exporter or other process on any node listening on port 9100, please stop or delete it.
Check for existing node-exporter pods running on cluster:
kubectl get pods --all-namespaces -o wide | grep node-exporter
If you spot duplicate node-exporter pods in other namespaces (kube-system or another prometheus namespace), delete redundant one(s):
kubectl delete pod <pod-name> -n <namespace>
Recap of what to resolve:
Since pods use hostNetwork: true and listen on port 9100, no two pods can bind port 9100 on the same node.
Make sure no other pod or process uses port 9100 on your nodes, or nodes will reject new pod scheduling.
If port conflicts persist and cannot be resolved, consider changing node-exporter host port usage or network mode, but that would require configuration changes in Prometheus too.
Final suggestion
After stopping conflicting processes or pods, check if node-exporter pods schedule:
kubectl get pods -n prometheus -l app.kubernetes.io/name=prometheus-node-exporter -w
kubectl get ep prometheus-prometheus-node-exporter -n prometheus
Let me know the output of sudo ss -tulpn | grep :9100 on all nodes, and any other node-exporter pods you find. I can then guide you exactly on resolving port conflicts.
hostNetwork: true
Locate this section in spec.template.spec:
hostNetwork: true
and delete or comment it out (with # prefix).
Or to remove affinity (if it exists):
Remove the whole affinity: block inside spec.template.spec.
After this edit, pods won’t bind port 9100 on the node network interface but only inside container network. Prometheus scrape configuration will need to scrape pods differently (e.g., via Pod IPs or ClusterIP Service).
If you want, I can help craft the exact patch or assist with troubleshooting your port conflicts further!
You're at a point where:
Your DaemonSet does not have a hostPort setting (confirmed by your search).
Your DaemonSet uses hostNetwork: true, which means the node-exporter pod binds directly to port 9100 on the host's network interface.
Pods are stuck in Pending due to the scheduler error indicating port 9100 is already in use on one node.
You confirmed none of your nodes have port 9100 currently used (via ss), so it’s puzzling that scheduling still fails.
What did you do?
From your messages, most likely you:
Removed the affinity section to avoid scheduling restrictions.
Searched for and confirmed hostPort isn't set on node-exporter pods.
Checked port usage on nodes to verify no port conflict.
Pods are still Pending, which is unexpected given the above.
So, what now?
Option 1: Restart the DaemonSet pods to clear any stale state
Sometimes Kubernetes scheduler or kubelet might get into a stale state. You can force the DaemonSet pods to restart by deleting pods manually:
This will cause the pods to run in the pod network namespace (not host network), avoiding port 9100 conflicts on the host.
Note: Prometheus scraping config must be adjusted accordingly to scrape pods correctly.
Option 3: Check and clear any stale or lingering pods/processes that might bind port 9100
If replaying the port checks shows no process listening, but scheduler still says port conflicts:
Check if an older node-exporter pod or process is still running on your nodes and was not killed properly.
Check if kubelet is reporting any errors on your node related to binding ports.
Reboot nodes as a last resort to clear any stuck sockets (only if viable).
Option 4: Check kube-scheduler and kubelet logs for errors
Look for logs on your master and nodes:
To get kube-scheduler logs, or systemd logs related to kubelet which may show conflicts or errors causing scheduler decisions.
To summarize – immediate work you can do:
# Delete all node-exporter pods to force recreation
kubectl delete pods -l app.kubernetes.io/name=prometheus-node-exporter -n prometheus
# If pods remain pending, try temporarily removing hostNetwork:
kubectl edit ds prometheus-prometheus-node-exporter -n prometheus
# remove hostNetwork: true line
# Save and check pod status
kubectl get pods -n prometheus -w
Let me know what you did exactly and what the pod status and events say after that! I can help you analyze the next step.
2. Check pod details and events for troubleshooting
kubectlpatchdsprometheus−prometheus−node−exporter− kubectl get ep prometheus-prometheus-node-exporter -n prometheus
NAME ENDPOINTS AGE
prometheus-prometheus-node-exporter 12h
vagrant@Master: