Comments (6)
Had the same issue. From what I gather, the hostpathVolumes association is lost since it's stored in memory only.
I've done a ultra-dirty proof of concept to try and rebuild that mapping when the provisioner starts and I got my pods unstuck.
Ofc, this needs a proper implementation - i guess to fully reconstruct, it either needs to query the k8s api for PVs or it should persist this struct somewhere (though i guess that's problematic too in terms of resilience).
diff --git a/pkg/hostpath/hostpath.go b/pkg/hostpath/hostpath.go
index 725e0012..eea4eb0b 100644
--- a/pkg/hostpath/hostpath.go
+++ b/pkg/hostpath/hostpath.go
@@ -19,6 +19,7 @@ package hostpath
import (
"fmt"
"io"
+ "io/ioutil"
"os"
"github.com/golang/glog"
@@ -106,6 +107,8 @@ func NewHostPathDriver(driverName, nodeID, endpoint, version string, ephemeral b
}
func (hp *hostPath) Run() {
+ refreshHostpathVolumes()
+
// Create GRPC servers
hp.ids = NewIdentityServer(hp.name, hp.version)
hp.ns = NewNodeServer(hp.nodeID, hp.ephemeral)
@@ -179,6 +182,27 @@ func deleteHostpathVolume(volID string) error {
return nil
}
+func refreshHostpathVolumes() error {
+ files, err := ioutil.ReadDir(provisionRoot)
+ if err != nil {
+ glog.Fatalf("Cannot refresh existing volumes while initializing.. %v", err)
+ }
+
+ for _, f := range files {
+ if len(f.Name()) > 5 && f.IsDir() {
+ volID := f.Name()
+ hostPathVolumes[volID] = hostPathVolume{
+ VolID: volID,
+ VolName: volID,
+ VolSize: 9999999,
+ VolPath: getVolumePath(volID),
+ VolAccessType: mountAccess,
+ }
+ }
+ }
+ return nil
+}
+
// hostPathIsEmpty is a simple check to determine if the specified hostpath directory
// is empty or not.
from csi-driver-host-path.
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale
.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close
.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale
from csi-driver-host-path.
Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten
.
Rotten issues close after an additional 30d of inactivity.
If this issue is safe to close now please do so with /close
.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten
from csi-driver-host-path.
Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen
.
Mark the issue as fresh with /remove-lifecycle rotten
.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close
from csi-driver-host-path.
@fejta-bot: Closing this issue.
In response to this:
Rotten issues close after 30d of inactivity.
Reopen the issue with/reopen
.
Mark the issue as fresh with/remove-lifecycle rotten
.Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
from csi-driver-host-path.
@shantanugadgil: You can't reopen an issue/PR unless you authored it or you are a collaborator.
In response to this:
/reopen
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
from csi-driver-host-path.
Related Issues (20)
- Need to locate the correct path of `csi-hostpath-plugin.yaml`
- Broken link of `contributor cheatsheet` Need to fix HOT 4
- SELinuxMountReadWriteOncePod tests are failing in CI HOT 4
- Implement support for SINGLE_NODE_SINGLE_WRITER enforcement in NodePublishVolume
- Host Path PV Encryption HOT 5
- Switch from k8s.gcr.io to registry.k8s.io HOT 5
- [enable discussion]
- [changing the pod's node == migrate the volume ?] HOT 1
- Inconsistent namespace in deployment templates HOT 3
- failed to provision volume with StorageClass "csi-hostpath-sc": error getting handle for DataSource Type PersistentVolumeClaim by Name pvc-claim-1: claim in dataSource not bound or invalid HOT 5
- Test config needs to disable new snapshot restore tests
- Are high vulnerabilities being addressed? HOT 10
- Sample implementation in CSI hostpath mock driver
- Remove dependencies on docker-hosted images HOT 5
- [discussion]is this line mean the directory created by hostpath csi driver with file mode 777? HOT 4
- Update the mentions of testgrid dashboard URL from k8s-testgrid.appspot.com to testgrid.k8s.io HOT 1
- Unix sock file is not removed after the server stop HOT 4
- State file not updated after stage/publish action
- 1.29 - [KEP-3751] VAC Hostpath Driver Implementation HOT 4
- Symlinks broken in /deploy HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from csi-driver-host-path.