-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Implement CanMount() for gfsMounter for linux #36686
Implement CanMount() for gfsMounter for linux #36686
Conversation
does it work for ns mount? |
Edit : I misread it as nfs mount. The following comment is for nfs mount Yes we have enabled the check for only GCI and only when the containerized mount flag is turned off. cc: @saad-ali |
exe := exec.New() | ||
switch runtime.GOOS { | ||
case "linux": | ||
if _, err := exe.Command("/bin/ls", "/sbin/mount.glusterfs").CombinedOutput(); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please define the mount client binary path
as constant. It would also be good if you can add a comment about what distros
are verified under linux
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack
@rootfs Can you clarify what you mean by this? |
@rkouj @saad-ali In ns_mount.go, the mount binary is under |
@rootfs : For now the change is enabled only in GCI where we don't run kubelet in container. Once we start doing that or if we need to make the change take effect elsewhere, we need to add additional code to support it. |
06733df
to
b85ac95
Compare
As discussed on slack with @rootfs |
@rkouj checkout util mounter and ns mounter |
@rootfs : The CanMount() check that we are doing is specific to each volume plugin and the intent of this change was to make CanMount() isolated to each plugin. Later on we can refactor this when we want this change to turned on on other platforms and make it more generic. |
LGTM |
@rkouj: you can't LGTM your own PR.
In response to [this comment](https://github.com//pull/36686#issuecomment-260484357):
If you have questions or suggestions related to this bot's behavior, please file an issue against the kubernetes/test-infra repository. |
Post applying the lgtm label, the Submit Queue is not getting updated to pick up the change. |
/lgtm |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
Automatic merge from submit-queue |
The code checks /sbin/mount.glusterfs for linux (btw, gluster client also runs on Mac), while containerized kubelet actually executes /rootfs/sbin/mount.glusterfs, there is a mismatch: if containerized kubelet doesn't have /sbin/mount.glusterfs, while host has, then we get a false negative |
@saad-ali I'm removing the cherrypick-candidate label. This is a regression breaking working setups. Personally I think we should revert until it and look for a non-regressing path, but I'd love to hear your take. |
@eparis I'm not sure if this helps but this check is enabled Right now the flag is enabled only in GCI (where we don't do containerized kubelet yet I believe). https://github.com/kubernetes/kubernetes/pull/36280/files#diff-6e3b476b9225d1213dc6ad13e453fc16R477 If we are doing a containerized mount, this check Once we start exploring more avenues, we will need to refactor/add more code to handle different cases. |
@rkouj As I understand it, |
Right. What do you suggest ? I can create an issue and link it if it helps. Or add a comment around the flag in options.go . |
@eparis what's the best practice? |
Sorry for the delay in response--overwhelmed with CCs so I just saw this thread.
@eparis No, it does not (or at least should not). The
It should not have broken anything. If it did, our bad, please file a bug and we'll take a look ASAP. Any break here would be a release blocker.
The flag is explicitly marked We need this in GKE for 1.4, I'm going to re-add the cherrypick candidate label. If you have any other concerns, I'll be happy to discuss them. Feel free to ping me here, or directly on Slack, and I'm happy to discuss this during the Storage SIG meeting as well. |
…upstream-release-1.4 Automated cherry pick of #36686
Commit found in the "release-1.4" branch appears to be this PR. Removing the "cherrypick-candidate" label. If this is an error find help to get your PR picked. |
What this PR does / why we need it:
To implement CanMount() check for glusterfs. If mount binaries are not present on the underlying node, the mount will not proceed and return an error message stating so.
Related to issue : #36098
Related to similar change for NFS :
#36280
Release note:
Check binaries for GlusterFS on the underlying node before doing mount
This change is
Sample output from testing in GCE/GCI:
rkouj@rkouj0:~/go/src/k8s.io/kubernetes$ kubectl describe pods
Name: glusterfs
Namespace: default
Node: e2e-test-rkouj-minion-group-kjq3/10.240.0.3
Start Time: Fri, 11 Nov 2016 17:22:04 -0800
Labels:
Status: Pending
IP:
Controllers:
Containers:
glusterfs:
Container ID:
Image: gcr.io/google_containers/busybox
Image ID:
Port:
QoS Tier:
cpu: Burstable
memory: BestEffort
Requests:
cpu: 100m
State: Waiting
Reason: ContainerCreating
Ready: False
Restart Count: 0
Environment Variables:
Conditions:
Type Status
Initialized True
Ready False
PodScheduled True
Volumes:
glusterfs:
Type: Glusterfs (a Glusterfs mount on the host that shares a pod's lifetime)
EndpointsName: glusterfs-cluster
Path: kube_vol
ReadOnly: true
default-token-2zcao:
Type: Secret (a volume populated by a Secret)
SecretName: default-token-2zcao
Events:
FirstSeen LastSeen Count From SubobjectPath Type Reason Message
8s 8s 1 {default-scheduler } Normal Scheduled Successfully assigned glusterfs to e2e-test-rkouj-minion-group-kjq3
7s 4s 4 {kubelet e2e-test-rkouj-minion-group-kjq3} Warning FailedMount Unable to mount volume kubernetes.io/glusterfs/6bb04587-a876-11e6-a712-42010af00002-glusterfs (spec.Name: glusterfs) on pod glusterfs (UID: 6bb04587-a876-11e6-a712-42010af00002). Verify that your node machine has the required components before attempting to mount this volume type. Required binary /sbin/mount.glusterfs is missing