Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hostpath-provisioner pods are not executed in tainted nodes #4385

Open
arielly-parussulo opened this issue Jan 29, 2024 · 2 comments
Open

hostpath-provisioner pods are not executed in tainted nodes #4385

arielly-parussulo opened this issue Jan 29, 2024 · 2 comments
Labels

Comments

@arielly-parussulo
Copy link

Summary

When I was trying to create a hostpath-provisioner PVC for my microk8s cluster I noticed that hostpath-provisioner could not create PVCs inside nodes tainted with NoSchedule effect. The problem is that when hostpath-provisioner creates a pod to create the storage path inside the node and the created pod doesn't contain a toleration to allow it to be executed in any node.

What Should Happen Instead?

hostpath-provisioned pods should be executed in any node even with NoScheduled and NoExecuted taints.

Reproduction Steps

  1. Add a node inside your microk8s cluster.
  2. Run microk8s kubectl taint test=true:NoScheduled to taint the node.
  3. Enable hostpath-storage add-ons using microk8s enable hostpath-storage.
  4. Add a pod and a PVC with tolerations:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: test-pvc
spec:
  accessModes: [ReadWriteOnce]
---
apiVersion: v1
kind: Pod
metadata:
  name: test-nginx
spec:
  volumes:
    - name: pvc
      persistentVolumeClaim:
        claimName: test-pvc
  tolerations:
    - key: "test"
      operator: "Equal"
      value: "true"
      effect: "NoSchedule"
  containers:
    - name: nginx
      image: nginx
      ports:
        - containerPort: 80
      volumeMounts:
        - name: pvc
          mountPath: /usr/share/nginx/html
  1. Run microk8s kubectl -n kube-system get pods to find hostpath-provisioner-<node>-<hash> in Pending state.

Introspection Report

inspection-report.tar.gz

Can you suggest a fix?

hostpath-provisioner-<node>-<hash> could start wih the toleration so it could be scheduled in any node.

tolerations:
  - operator: Equals

Are you interested in contributing with a fix?

Yes.

@ktsakalozos
Copy link
Member

Hi @arielly-parussulo, sorry for the late reply. The file you would need to patch is https://github.com/canonical/microk8s-core-addons/blob/main/addons/hostpath-storage/storage.yaml and your work will be available on the next MicroK8s release (1.30). Thank you.

Copy link

stale bot commented Jan 17, 2025

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the inactive label Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants