Closed leakingtapan closed 5 years ago
/cc msau42 /assign verult
I have see this once so far and am wondering how is preference set in topology requirement?
@leakingtapan: GitHub didn't allow me to assign the following users: verult.
Note that only kubernetes-csi members and repo collaborators can be assigned. For more information please see the contributor guide
/assign @verult
It looks like topology preferences are not set even though WaitForFirstConsumer is enabled in the StorageClass.
@leakingtapan can you also list out the feature gates you set on Kubernetes and csi-external-provisioner?
@msau42: GitHub didn't allow me to assign the following users: verult.
Note that only kubernetes-csi members and repo collaborators can be assigned. For more information please see the contributor guide
cc @verult @ddebroy
ACK will take a look
@leakingtapan in the reproductions where provisioning is successful, do you see a Preferred
field in the CreateVolumeRequest() log (should be right after requisite
)?
Here is the log where it succeeds:
I1015 21:36:01.390494 1 controller.go:991] provision "default/late-claim" class "late-sc": started
I1015 21:36:01.405928 1 controller.go:121] GRPC call: /csi.v0.Identity/GetPluginCapabilities
I1015 21:36:01.405941 1 controller.go:122] GRPC request:
I1015 21:36:01.406243 1 event.go:221] Event(v1.ObjectReference{Kind:"PersistentVolumeClaim", Namespace:"default", Name:"late-claim", UID:"4a34733f-d0c2-11e8-81f1-0a75e9a76798", APIVersion:"v1", ResourceVersion:"19029", FieldPath:""}): type: 'Normal' reason: 'Provisioning' External provisioner is provisioning volume for claim "default/late-claim"
I1015 21:36:01.406605 1 controller.go:124] GRPC response: capabilities:<service:<type:CONTROLLER_SERVICE > > capabilities:<service:<type:ACCESSIBILITY_CONSTRAINTS > >
I1015 21:36:01.406643 1 controller.go:125] GRPC error: <nil>
I1015 21:36:01.406667 1 controller.go:121] GRPC call: /csi.v0.Controller/ControllerGetCapabilities
I1015 21:36:01.406674 1 controller.go:122] GRPC request:
I1015 21:36:01.407000 1 controller.go:124] GRPC response: capabilities:<rpc:<type:CREATE_DELETE_VOLUME > > capabilities:<rpc:<type:PUBLISH_UNPUBLISH_VOLUME > >
I1015 21:36:01.407033 1 controller.go:125] GRPC error: <nil>
I1015 21:36:01.407045 1 controller.go:121] GRPC call: /csi.v0.Identity/GetPluginInfo
I1015 21:36:01.407050 1 controller.go:122] GRPC request:
I1015 21:36:01.407312 1 controller.go:124] GRPC response: name:"com.amazon.aws.csi.ebs" vendor_version:"0.0.1"
I1015 21:36:01.407358 1 controller.go:125] GRPC error: <nil>
I1015 21:36:01.415984 1 controller.go:428] CreateVolumeRequest {Name:pvc-4a34733f-d0c2-11e8-81f1-0a75e9a76798 CapacityRange:required_bytes:4294967296 VolumeCapabilities:[mount:<> access_mode:<mode:SINGLE_NODE_WRITER > ] Parameters:map[] ControllerCreateSecrets:map[] VolumeContentSource:<nil> AccessibilityRequirements:requisite:<segments:<key:"com.amazon.aws.csi.ebs/zone" value:"us-east-1c" > > requisite:<segments:<key:"com.amazon.aws.csi.ebs/zone" value:"us-east-1a" > > requisite:<segments:<key:"com.amazon.aws.csi.ebs/zone" value:"us-east-1b" > > XXX_NoUnkeyedLiteral:{} XXX_unrecognized:[] XXX_sizecache:0}
I1015 21:36:01.416051 1 controller.go:121] GRPC call: /csi.v0.Controller/CreateVolume
I1015 21:36:01.416057 1 controller.go:122] GRPC request: name:"pvc-4a34733f-d0c2-11e8-81f1-0a75e9a76798" capacity_range:<required_bytes:4294967296 > volume_capabilities:<mount:<> access_mode:<mode:SINGLE_NODE_WRITER > > accessibility_requirements:<requisite:<segments:<key:"com.amazon.aws.csi.ebs/zone" value:"us-east-1c" > > requisite:<segments:<key:"com.amazon.aws.csi.ebs/zone" value:"us-east-1a" > > requisite:<segments:<key:"com.amazon.aws.csi.ebs/zone" value:"us-east-1b" > > >
I1015 21:36:01.774456 1 controller.go:124] GRPC response: volume:<capacity_bytes:4294967296 id:"vol-0f1667fc673302e81" accessible_topology:<segments:<key:"com.amazon.aws.csi.ebs/zone" value:"us-east-1c" > > >
I1015 21:36:01.774530 1 controller.go:125] GRPC error: <nil>
I1015 21:36:01.774543 1 controller.go:484] create volume rep: {CapacityBytes:4294967296 Id:vol-0f1667fc673302e81 Attributes:map[] ContentSource:<nil> AccessibleTopology:[segments:<key:"com.amazon.aws.csi.ebs/zone" value:"us-east-1c" > ] XXX_NoUnkeyedLiteral:{} XXX_unrecognized:[] XXX_sizecache:0}
I1015 21:36:01.774576 1 controller.go:546] successfully created PV {GCEPersistentDisk:nil AWSElasticBlockStore:nil HostPath:nil Glusterfs:nil NFS:nil RBD:nil ISCSI:nil Cinder:nil CephFS:nil FC:nil Flocker:nil FlexVolume:nil AzureFile:nil VsphereVolume:nil Quobyte:nil AzureDisk:nil PhotonPersistentDisk:nil PortworxVolume:nil ScaleIO:nil Local:nil StorageOS:nil CSI:&CSIPersistentVolumeSource{Driver:com.amazon.aws.csi.ebs,VolumeHandle:vol-0f1667fc673302e81,ReadOnly:false,FSType:ext4,VolumeAttributes:map[string]string{storage.kubernetes.io/csiProvisionerIdentity: 1539635296092-8081-com.amazon.aws.csi.ebs,},ControllerPublishSecretRef:nil,NodeStageSecretRef:nil,NodePublishSecretRef:nil,}}
I1015 21:36:01.774624 1 controller.go:1091] provision "default/late-claim" class "late-sc": volume "pvc-4a34733f-d0c2-11e8-81f1-0a75e9a76798" provisioned
I1015 21:36:01.774657 1 controller.go:1105] provision "default/late-claim" class "late-sc": trying to save persistentvvolume "pvc-4a34733f-d0c2-11e8-81f1-0a75e9a76798"
I1015 21:36:01.794182 1 controller.go:1112] provision "default/late-claim" class "late-sc": persistentvolume "pvc-4a34733f-d0c2-11e8-81f1-0a75e9a76798" saved
I1015 21:36:01.794214 1 controller.go:1153] provision "default/late-claim" class "late-sc": succeeded
I1015 21:36:01.794300 1 event.go:221] Event(v1.ObjectReference{Kind:"PersistentVolumeClaim", Namespace:"default", Name:"late-claim", UID:"4a34733f-d0c2-11e8-81f1-0a75e9a76798", APIVersion:"v1", ResourceVersion:"19029", FieldPath:""}): type: 'Normal' reason: 'ProvisioningSucceeded' Successfully provisioned volume pvc-4a34733f-d0c2-11e8-81f1-0a75e9a76798
It didn't contain preferred too
can you also list out the feature gates you set on Kubernetes and csi-external-provisioner?
I enabled CSIDriverRegistry and CSINodeInfo for kubelet and kube-apiserver.
Args for external provisioner:
image: quay.io/k8scsi/csi-provisioner:v0.4.0
args:
- --provisioner=com.amazon.aws.csi.ebs
- --csi-address=$(ADDRESS)
- --v=5
That's strange... after creating the PVC and the pod, do you see a selected-node
annotation in the PVC object?
This information is unfortunately not available now since I didn't describe the pvc at the time when this bug happened. And after that I retried pod creation and everything works again. I need to reproduce this in order to find out.
For the working case, selected-node
does show up with correct assigned node though.
To more easily repro the issue, you can try creating multiple PVCs in one Pod
(maybe like 10+ PVCs)
I did a test with the latest of k8s release-1.12 branch (cluster started with AllAlpha=true) and external-provisioner 0.4.0 (with --feature-gates=Topology=true
), and the provisioner did call the CSI driver with preferred
:
I1018 22:30:45.278889 1 controller.go:432] CreateVolumeRequest {Name:pvc-74359b21-d325-11e8-a631-42010a800002 CapacityRange:required_bytes:6442450944 VolumeCapabilities:[mount:<> access_mode:<mode:SINGLE_NODE_WRITER > ] Parameters:map[type:pd-standard] ControllerCreateSecrets:map[] VolumeContentSource:<nil> AccessibilityRequirements:requisite:<segments:<key:"com.google.topology/zone" value:"us-central1-b" > > preferred:<segments:<key:"com.google.topology/zone" value:"us-central1-b" > > XXX_NoUnkeyedLiteral:{} XXX_unrecognized:[] XXX_sizecache:0}
external-attacher and driver-registrar are also at 0.4.0. This is a single-zone cluster.
Steps:
KUBE_FEATURE_GATES=AllAlpha=true cluster/kube-up.sh
kubectl create -f https://raw.githubusercontent.com/kubernetes/csi-api/master/pkg/crd/testdata/csinodeinfo.yaml --validate=false
StorageClass:
apiVersion: storage.k8s.io/v1beta1
kind: StorageClass
metadata:
name: csi-gce-pd
provisioner: com.google.csi.gcepd
parameters:
type: pd-standard
volumeBindingMode: WaitForFirstConsumer
PVC:
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: podpvc
spec:
accessModes:
- ReadWriteOnce
storageClassName: csi-gce-pd
resources:
requests:
storage: 6Gi
Pod:
apiVersion: v1
kind: Pod
metadata:
name: web-server
spec:
containers:
- name: web-server
image: nginx
volumeMounts:
- mountPath: /var/lib/www/html
name: mypvc
volumes:
- name: mypvc
persistentVolumeClaim:
claimName: podpvc
readOnly: false
BTW looks like the csi-provisioner 0.4.0 image was updated 2 days ago...
@verult do you mean 0.4.1?
Can you try a multi-zone cluster?
After upgrading to v0.4.1 for provisioner/attacher/registrar, I can see preferred
too.
Thanks, can we close this issue then?
I haven't seem this issue again. /close
@leakingtapan: Closing this issue.
Is this a BUG REPORT or FEATURE REQUEST?:
What happened: I am testing dynamic provisioning with EBS CSI driver with delayed binding. Most of the time the pod is created under the same zone as volume. There is one time that pod creation is failed because of pod is created in a different zone to volume's zone.
What you expected to happen: Volume and pod should always be created under the same topology domain with volume scheduling enabled.
How to reproduce it (as minimally and precisely as possible): Non-deterministic so far
Anything else we need to know?: Provisioner log:
EBS Driver Log:
POD event:
Environment:
kubectl version
): client: v1.12.0 server: v1.12.1uname -a
):