-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #124 from gman0/backport-122
(Backport #122) automount: shut down automount daemon with SIGKILL
- Loading branch information
Showing
4 changed files
with
132 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Uninstalling cvmfs-csi driver | ||
|
||
The nodeplugin Pods store various resources on the node hosts they are running on: | ||
* autofs mount and the respective inner CVMFS mounts, | ||
* CVMFS client cache. | ||
|
||
By default, the nodeplugin Pod leaves autofs and its respective inner mounts on the node | ||
in `/var/cvmfs`. They may need to be unmounted recursively. To do that, you can set | ||
`AUTOFS_TRY_CLEAN_AT_EXIT` environment variable to `true` in nodeplugin's DaemonSet and restart | ||
the Pods. On the next exit, they will be unmounted. | ||
|
||
``` | ||
kubectl set env daemonset -l app=cvmfs-csi,component=nodeplugin AUTOFS_TRY_CLEAN_AT_EXIT=true | ||
# Restarting nodeplugin Pods needs attention, as this may break existing mounts. | ||
# They will be restored once the Pods come back up. | ||
kubectl delete pods -l app=cvmfs-csi,component=nodeplugin | ||
``` | ||
|
||
The CVMFS client cache is stored by default in `/var/lib/cvmfs.csi.cern.ch/cache`. | ||
This directory is not deleted automatically, and manual intervention is currently needed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// Copyright CERN. | ||
// | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
|
||
package env | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
"strconv" | ||
) | ||
|
||
const ( | ||
// Boolean value. By default, when exiting, automount daemon is sent | ||
// SIGKILL signal forcing it to skip its clean up procedure, leaving | ||
// the autofs mount behind. This is needed for the daemon to be able | ||
// to reconnect to the autofs mount when the nodeplugin Pod is being | ||
// restarted. | ||
// | ||
// Setting the value of this environment value to TRUE overrides this, | ||
// and allows the daemon to do the clean up. This is useful when | ||
// e.g. uninstalling the eosxd-csi driver. | ||
AutofsTryCleanAtExit = "AUTOFS_TRY_CLEAN_AT_EXIT" | ||
) | ||
|
||
func GetAutofsTryCleanAtExit() bool { | ||
strVal := os.Getenv(AutofsTryCleanAtExit) | ||
boolVal, _ := strconv.ParseBool(strVal) | ||
|
||
return boolVal | ||
} | ||
|
||
func StringAutofsTryCleanAtExit() string { | ||
return fmt.Sprintf("%s=\"%v\"", AutofsTryCleanAtExit, GetAutofsTryCleanAtExit()) | ||
} |