-
Notifications
You must be signed in to change notification settings - Fork 88
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
Introduce JUICEFS_IMMUTABLE
, mount /etc/updatedb.conf
only in mutable environments
#680
Conversation
Hi @twelho , CSI Node does not mount We alreay add |
Hmm, you're right, |
Hi @twelho , you can set an environment variable to control not to mount |
Sorry for the delay, but I can now confirm that JuiceFS works on Talos when commenting out the
To my knowledge Kubernetes doesn't provide this kind of generic control through an environment variable, or are you suggesting that I should add an environment variable to the CSI driver to control this? I can refactor this PR do that if that's what you intend. |
@twelho , I mean to add an ENV in juicefs csi node&controller to control if to mount |
3768529
to
c873948
Compare
I've now added |
Now that I think about it, it might make sense to rename the variable to |
@twelho sure, |
…able environments In immutable environments, such as Talos Linux, most host directories are read-only. As a result, for example, `FileOrCreate` for the `/etc/updatedb.conf` will fail to create an empty file. This patch introduces `JUICEFS_IMMUTABLE` as a new environment variable for both controller and node instances to handle these kinds of cases that need special attention in immutable environments.
c873948
to
03c6b11
Compare
/etc/updatedb.conf
from the host if it existsJUICEFS_IMMUTABLE
, mount /etc/updatedb.conf
only in mutable environments
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #680 +/- ##
==========================================
- Coverage 38.92% 38.52% -0.40%
==========================================
Files 33 33
Lines 3895 3943 +48
==========================================
+ Hits 1516 1519 +3
- Misses 2233 2278 +45
Partials 146 146
☔ View full report in Codecov by Sentry. |
Some Kubernetes distributions, such as Talos Linux, do not ship
updatedb
at all. In these environments, the JuiceFS CSI mount pod fails to start due to/etc/updatedb.conf
not being present on the host for bind mounting, nor canFileOrCreate
create it due to/etc
being read-only. This patch introducesJUICEFS_IMMUTABLE
as a new environment variable for both controller and node instances to handle these kinds of cases that need special attention in immutable environments. I've also updatedupdatedb
-related hard-coded strings to use the constant definitions incommon.go
.