kubernetes/pkg/controller
Kubernetes Submit Queue 0f082c6663 Merge pull request #36280 from rkouj/better-mount-error
Automatic merge from submit-queue

Better messaging for missing volume binaries on host

**What this PR does / why we need it**:
When mount binaries are not present on a host, the error returned is a generic one.
This change is to check the mount binaries before the mount and return a user-friendly error message.

This change is specific to GCI and the flag is experimental now.

https://github.com/kubernetes/kubernetes/issues/36098

**Release note**:
Introduces a flag `check-node-capabilities-before-mount` which if set, enables a check (`CanMount()`) prior to mount operations to verify that the required components (binaries, etc.) to mount the volume are available on the underlying node. If the check is enabled and `CanMount()` returns an error, the mount operation fails. Implements the `CanMount()` check for NFS.















Sample output post change :


rkouj@rkouj0:~/go/src/k8s.io/kubernetes$ kubectl describe pods
Name:		sleepyrc-fzhyl
Namespace:	default
Node:		e2e-test-rkouj-minion-group-oxxa/10.240.0.3
Start Time:	Mon, 07 Nov 2016 21:28:36 -0800
Labels:		name=sleepy
Status:		Pending
IP:		
Controllers:	ReplicationController/sleepyrc
Containers:
  sleepycontainer1:
    Container ID:	
    Image:		gcr.io/google_containers/busybox
    Image ID:		
    Port:		
    Command:
      sleep
      6000
    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:
  data:
    Type:	NFS (an NFS mount that lasts the lifetime of a pod)
    Server:	127.0.0.1
    Path:	/export
    ReadOnly:	false
  default-token-d13tj:
    Type:	Secret (a volume populated by a Secret)
    SecretName:	default-token-d13tj
Events:
  FirstSeen	LastSeen	Count	From						SubobjectPath	Type		Reason		Message
  ---------	--------	-----	----						-------------	--------	------		-------
  7s		7s		1	{default-scheduler }						Normal		Scheduled	Successfully assigned sleepyrc-fzhyl to e2e-test-rkouj-minion-group-oxxa
  6s		3s		4	{kubelet e2e-test-rkouj-minion-group-oxxa}			Warning		FailedMount	Unable to mount volume kubernetes.io/nfs/32c7ef16-a574-11e6-813d-42010af00002-data (spec.Name: data) on pod sleepyrc-fzhyl (UID: 32c7ef16-a574-11e6-813d-42010af00002). Verify that your node machine has the required components before attempting to mount this volume type. Required binary /sbin/mount.nfs is missing
2016-11-09 18:51:00 -08:00
..
certificates include multiple versions in clientset 2016-10-29 13:30:47 -07:00
cronjob Rename ScheduledJob to CronJob 2016-11-07 10:14:12 +01:00
daemon Merge pull request #35465 from lukaszo/ds_event 2016-11-07 18:18:05 -08:00
deployment Merge pull request #36430 from kargakis/fix-deployment-progress-estimation 2016-11-09 08:49:53 -08:00
disruption Add observedGeneration to PodDisruptionBudgetStatus 2016-11-08 17:06:17 +01:00
endpoint Rename PetSet API to StatefulSet 2016-10-27 17:25:10 -07:00
garbagecollector Replace negotiation with a new method that can extract info 2016-10-28 11:30:11 -04:00
informers Switch to JobLister 2016-11-03 20:41:40 -04:00
job Switch to JobLister 2016-11-03 20:41:40 -04:00
namespace Fix possible race in operationNotSupportedCache 2016-11-04 14:11:54 -04:00
node Update bazel 2016-11-03 13:47:09 -07:00
petset implement statefulset update pet unit test 2016-11-05 19:47:01 +08:00
podautoscaler HPA: Consider unready pods and missing metrics 2016-11-08 00:59:23 -05:00
podgc addressing comments. 2016-10-27 13:30:04 -07:00
replicaset Replica set/rc controller changes for Conditions 2016-11-02 10:30:09 +01:00
replication Replica set/rc controller changes for Conditions 2016-11-02 10:30:09 +01:00
resourcequota Use available informers in quota replenishment 2016-11-06 18:45:36 -05:00
route autogenerated 2016-10-21 17:32:32 -07:00
service include multiple versions in clientset 2016-10-29 13:30:47 -07:00
serviceaccount convert SA controller to shared informers 2016-10-27 15:44:46 -04:00
volume Merge pull request #36280 from rkouj/better-mount-error 2016-11-09 18:51:00 -08:00
.import-restrictions add import restrictions 2016-10-13 16:10:24 -07:00
BUILD include multiple versions in clientset 2016-10-29 13:30:47 -07:00
client_builder.go move watch.ListWatchUntil to its own package to avoid future import cycle 2016-10-30 13:14:20 -07:00
controller_ref_manager.go fix tests; convert IsPodActive to operate on *Pod 2016-08-17 13:05:37 -07:00
controller_utils_test.go remove testapi.Default.GroupVersion 2016-10-07 10:10:54 -04:00
controller_utils.go controller: support perma-failed deployments 2016-11-04 13:36:46 +01:00
doc.go Use Go canonical import paths 2016-07-16 13:48:21 -04:00
lookup_cache.go Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
OWNERS Remove myself from a bunch of OWNERS files, as I am too overloaded 2016-05-11 13:34:51 -07:00