-
Notifications
You must be signed in to change notification settings - Fork 976
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
Add VolumeDevices to PodSpec (#2572) #2573
Add VolumeDevices to PodSpec (#2572) #2573
Conversation
I have published this version to the registry for early access and easier docs review. To get the early access, use: terraform {
required_providers {
kubernetes = {
source = "jirislav/kubernetes"
version = "2.32.0-issue2572"
}
}
}
provider "kubernetes" {
# Configuration options
} |
appsv1 "k8s.io/api/apps/v1" | ||
) | ||
|
||
func TestAccKubernetesStatefulSetV1_EKS_basic(t *testing.T) { |
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.
From your description, you added these tests because it's difficult to test locally. Is their no simple way to include volume_device
into the other already existing stateful tests? Would like to know what makes the local testing difficult.
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.
By default, Kind provides StorageClass with rancher.io/local-path
provisioner using the docker.io/kindest/local-path-provisioner
image.
Now, if you create PersistentVolumeClaim
with VolumeMode: Block
, the default StorageClass kicks in, instructing rancher.io/local-path
provisioner to obtain the block storage volume.
Then you will get the rancher.io/local-path does not support block volume provisioning
message saying you need to install whole new provisioner and StorageClass, none of which is provided by Kind out of the box.
Describe StatefulSet (ss-test)
$ k describe sts tf-acc-test-103te79aze
Name: tf-acc-test-103te79aze
Namespace: default
CreationTimestamp: Sat, 17 Aug 2024 00:25:20 +0200
Selector: app=ss-test
Labels: TestLabelOne=one
TestLabelThree=three
TestLabelTwo=two
Annotations: TestAnnotationOne: one
TestAnnotationTwo: two
Replicas: 1 desired | 1 total
Update Strategy: RollingUpdate
Partition: 1
Pods Status: 0 Running / 1 Waiting / 0 Succeeded / 0 Failed
Pod Template:
Labels: app=ss-test
Containers:
ss-test:
Image: registry.k8s.io/e2e-test-images/agnhost:2.43
Port: 80/TCP
Host Port: 0/TCP
Args:
pause
Environment: <none>
Mounts:
/work-dir from ss-test (rw)
Devices:
/dev/xvda from ss-device-test
Volumes: <none>
Node-Selectors: <none>
Tolerations: <none>
Volume Claims:
Name: ss-test
StorageClass:
Labels: <none>
Annotations: <none>
Capacity: 1Gi
Access Modes: [ReadWriteOnce]
Name: ss-device-test
StorageClass:
Labels: <none>
Annotations: <none>
Capacity: 1Gi
Access Modes: [ReadWriteOnce]
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal SuccessfulCreate 80s statefulset-controller create Claim ss-device-test-tf-acc-test-103te79aze-0 Pod tf-acc-test-103te79aze-0 in StatefulSet tf-acc-test-103te79aze success
Normal SuccessfulCreate 80s statefulset-controller create Claim ss-test-tf-acc-test-103te79aze-0 Pod tf-acc-test-103te79aze-0 in StatefulSet tf-acc-test-103te79aze success
Normal SuccessfulCreate 75s statefulset-controller create Pod tf-acc-test-103te79aze-0 in StatefulSet tf-acc-test-103te79aze successful
Describe Pod (ss-test)
$ k describe pod tf-acc-test-103te79aze-0
Name: tf-acc-test-103te79aze-0
Namespace: default
Priority: 0
Service Account: default
Node: <none>
Labels: app=ss-test
apps.kubernetes.io/pod-index=0
controller-revision-hash=tf-acc-test-103te79aze-5ddf5fb74d
statefulset.kubernetes.io/pod-name=tf-acc-test-103te79aze-0
Annotations: <none>
Status: Pending
IP:
IPs: <none>
Controlled By: StatefulSet/tf-acc-test-103te79aze
Containers:
ss-test:
Image: registry.k8s.io/e2e-test-images/agnhost:2.43
Port: 80/TCP
Host Port: 0/TCP
Args:
pause
Environment: <none>
Mounts:
/var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-zptvp (ro)
/work-dir from ss-test (rw)
Devices:
/dev/xvda from ss-device-test
Volumes:
ss-test:
Type: PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
ClaimName: ss-test-tf-acc-test-103te79aze-0
ReadOnly: false
ss-device-test:
Type: PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
ClaimName: ss-device-test-tf-acc-test-103te79aze-0
ReadOnly: false
kube-api-access-zptvp:
Type: Projected (a volume that contains injected data from multiple sources)
TokenExpirationSeconds: 3607
ConfigMapName: kube-root-ca.crt
ConfigMapOptional: <nil>
DownwardAPI: true
QoS Class: BestEffort
Node-Selectors: <none>
Tolerations: node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events: <none>
Describe PersistentVolumeClaim (ss-device-test)
$ k describe pvc ss-device-test-tf-acc-test-103te79aze-0
Name: ss-device-test-tf-acc-test-103te79aze-0
Namespace: default
StorageClass: standard
Status: Pending
Volume:
Labels: app=ss-test
Annotations: volume.beta.kubernetes.io/storage-provisioner: rancher.io/local-path
volume.kubernetes.io/selected-node: kind-control-plane
volume.kubernetes.io/storage-provisioner: rancher.io/local-path
Finalizers: [kubernetes.io/pvc-protection]
Capacity:
Access Modes:
VolumeMode: Block
Used By: tf-acc-test-103te79aze-0
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal WaitForFirstConsumer 106s persistentvolume-controller waiting for first consumer to be created before binding
Warning ProvisioningFailed 106s (x2 over 106s) rancher.io/local-path_local-path-provisioner-57c5987fd4-5fprk_7ec3ce96-a1c6-4a3b-94c8-078cce4831cb rancher.io/local-path does not support block volume provisioning
Normal ExternalProvisioning 12s (x9 over 106s) persistentvolume-controller Waiting for a volume to be created either by the external provisioner 'rancher.io/local-path' or manually by the system administrator. If volume creation is delayed, please verify that the provisioner is running and correctly registered.
Describe local-path-provisioner Pod
$ k describe pod local-path-provisioner-57c5987fd4-5fprk -n local-path-storage
Name: local-path-provisioner-57c5987fd4-5fprk
Namespace: local-path-storage
Priority: 0
Service Account: local-path-provisioner-service-account
Node: kind-control-plane/10.89.0.2
Start Time: Sat, 17 Aug 2024 00:14:00 +0200
Labels: app=local-path-provisioner
pod-template-hash=57c5987fd4
Annotations: <none>
Status: Running
IP: 10.244.0.4
IPs:
IP: 10.244.0.4
Controlled By: ReplicaSet/local-path-provisioner-57c5987fd4
Containers:
local-path-provisioner:
Container ID: containerd://e8df5db803bf7d6464c95986bc9574d44650b88ea746924255b2e4a634c4325d
Image: docker.io/kindest/local-path-provisioner:v20240813-c6f155d6
Image ID: sha256:3a195b56ff1540463285c7f6287ef0d4ec18754013f68a3666b363b7893a62ad
Port: <none>
Host Port: <none>
Command:
local-path-provisioner
--debug
start
--helper-image
docker.io/kindest/local-path-helper:v20230510-486859a6
--config
/etc/config/config.json
State: Running
Started: Sat, 17 Aug 2024 00:14:01 +0200
Ready: True
Restart Count: 0
Environment:
POD_NAMESPACE: local-path-storage (v1:metadata.namespace)
Mounts:
/etc/config/ from config-volume (rw)
/var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-6fpn9 (ro)
Conditions:
Type Status
PodReadyToStartContainers True
Initialized True
Ready True
ContainersReady True
PodScheduled True
Volumes:
config-volume:
Type: ConfigMap (a volume populated by a ConfigMap)
Name: local-path-config
Optional: false
kube-api-access-6fpn9:
Type: Projected (a volume that contains injected data from multiple sources)
TokenExpirationSeconds: 3607
ConfigMapName: kube-root-ca.crt
ConfigMapOptional: <nil>
DownwardAPI: true
QoS Class: BestEffort
Node-Selectors: kubernetes.io/os=linux
Tolerations: node-role.kubernetes.io/control-plane:NoSchedule
node-role.kubernetes.io/master:NoSchedule
node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Warning FailedScheduling 14m default-scheduler 0/1 nodes are available: 1 node(s) had untolerated taint {node.kubernetes.io/not-ready: }. preemption: 0/1 nodes are available: 1 Preemption is not helpful for scheduling.
Normal Scheduled 14m default-scheduler Successfully assigned local-path-storage/local-path-provisioner-57c5987fd4-5fprk to kind-control-plane
Normal Pulled 14m kubelet Container image "docker.io/kindest/local-path-provisioner:v20240813-c6f155d6" already present on machine
Normal Created 14m kubelet Created container local-path-provisioner
Normal Started 14m kubelet Started container local-path-provisioner
Filtered logs:
$ k logs local-path-provisioner-57c5987fd4-5fprk -n local-path-storage | grep 'ss-device-test'
I0816 22:25:12.656609 1 controller.go:1337] provision "default/ss-device-test-tf-acc-test-oww82yagz2-0" class "standard": started
E0816 22:25:12.656641 1 controller.go:1361] provision "default/ss-device-test-tf-acc-test-oww82yagz2-0" class "standard": failed to provision volume: rancher.io/local-path does not support block volume provisioning
I0816 22:25:12.656705 1 event.go:282] Event(v1.ObjectReference{Kind:"PersistentVolumeClaim", Namespace:"default", Name:"ss-device-test-tf-acc-test-oww82yagz2-0", UID:"b9413651-c1db-4095-8926-63edf3bc132a", APIVersion:"v1", ResourceVersion:"1385", FieldPath:""}): type: 'Warning' reason: 'ProvisioningFailed' rancher.io/local-path does not support block volume provisioning
I0816 22:25:12.663412 1 controller.go:1337] provision "default/ss-device-test-tf-acc-test-oww82yagz2-0" class "standard": started
E0816 22:25:12.663449 1 controller.go:1361] provision "default/ss-device-test-tf-acc-test-oww82yagz2-0" class "standard": failed to provision volume: rancher.io/local-path does not support block volume provisioning
I0816 22:25:12.663511 1 event.go:282] Event(v1.ObjectReference{Kind:"PersistentVolumeClaim", Namespace:"default", Name:"ss-device-test-tf-acc-test-oww82yagz2-0", UID:"b9413651-c1db-4095-8926-63edf3bc132a", APIVersion:"v1", ResourceVersion:"1392", FieldPath:""}): type: 'Warning' reason: 'ProvisioningFailed' rancher.io/local-path does not support block volume provisioning
I0816 22:25:13.004019 1 controller.go:1337] provision "default/ss-device-test-tf-acc-test-ai47eoiufr-0" class "standard": started
I0816 22:25:13.004156 1 event.go:282] Event(v1.ObjectReference{Kind:"PersistentVolumeClaim", Namespace:"default", Name:"ss-device-test-tf-acc-test-ai47eoiufr-0", UID:"186a28a0-b637-4c29-922b-a523a26d4c23", APIVersion:"v1", ResourceVersion:"1402", FieldPath:""}): type: 'Warning' reason: 'ProvisioningFailed' rancher.io/local-path does not support block volume provisioning
E0816 22:25:13.004241 1 controller.go:1361] provision "default/ss-device-test-tf-acc-test-ai47eoiufr-0" class "standard": failed to provision volume: rancher.io/local-path does not support block volume provisioning
I0816 22:25:25.813517 1 controller.go:1337] provision "default/ss-device-test-tf-acc-test-103te79aze-0" class "standard": started
E0816 22:25:25.813589 1 controller.go:1361] provision "default/ss-device-test-tf-acc-test-103te79aze-0" class "standard": failed to provision volume: rancher.io/local-path does not support block volume provisioning
I0816 22:25:25.813716 1 event.go:282] Event(v1.ObjectReference{Kind:"PersistentVolumeClaim", Namespace:"default", Name:"ss-device-test-tf-acc-test-103te79aze-0", UID:"cb8a9b89-e6b2-4fb7-b755-ba2bea175956", APIVersion:"v1", ResourceVersion:"1507", FieldPath:""}): type: 'Warning' reason: 'ProvisioningFailed' rancher.io/local-path does not support block volume provisioning
I0816 22:29:01.613933 1 controller.go:1337] provision "default/ss-device-test-tf-acc-test-ai47eoiufr-0" class "standard": started
E0816 22:29:01.613996 1 controller.go:1361] provision "default/ss-device-test-tf-acc-test-ai47eoiufr-0" class "standard": failed to provision volume: rancher.io/local-path does not support block volume provisioning
I0816 22:29:01.614008 1 controller.go:1337] provision "default/ss-device-test-tf-acc-test-oww82yagz2-0" class "standard": started
I0816 22:29:01.614028 1 controller.go:1337] provision "default/ss-device-test-tf-acc-test-103te79aze-0" class "standard": started
E0816 22:29:01.614088 1 controller.go:1361] provision "default/ss-device-test-tf-acc-test-oww82yagz2-0" class "standard": failed to provision volume: rancher.io/local-path does not support block volume provisioning
E0816 22:29:01.614127 1 controller.go:1361] provision "default/ss-device-test-tf-acc-test-103te79aze-0" class "standard": failed to provision volume: rancher.io/local-path does not support block volume provisioning
I0816 22:29:01.614135 1 event.go:282] Event(v1.ObjectReference{Kind:"PersistentVolumeClaim", Namespace:"default", Name:"ss-device-test-tf-acc-test-ai47eoiufr-0", UID:"186a28a0-b637-4c29-922b-a523a26d4c23", APIVersion:"v1", ResourceVersion:"1402", FieldPath:""}): type: 'Warning' reason: 'ProvisioningFailed' rancher.io/local-path does not support block volume provisioning
I0816 22:29:01.614169 1 event.go:282] Event(v1.ObjectReference{Kind:"PersistentVolumeClaim", Namespace:"default", Name:"ss-device-test-tf-acc-test-oww82yagz2-0", UID:"b9413651-c1db-4095-8926-63edf3bc132a", APIVersion:"v1", ResourceVersion:"1392", FieldPath:""}): type: 'Warning' reason: 'ProvisioningFailed' rancher.io/local-path does not support block volume provisioning
I0816 22:29:01.614186 1 event.go:282] Event(v1.ObjectReference{Kind:"PersistentVolumeClaim", Namespace:"default", Name:"ss-device-test-tf-acc-test-103te79aze-0", UID:"cb8a9b89-e6b2-4fb7-b755-ba2bea175956", APIVersion:"v1", ResourceVersion:"1507", FieldPath:""}): type: 'Warning' reason: 'ProvisioningFailed' rancher.io/local-path does not support block volume provisioning
I0816 22:35:12.095561 1 controller.go:1337] provision "default/ss-device-test-tf-acc-test-ai47eoiufr-0" class "standard": started
E0816 22:35:12.095758 1 controller.go:1361] provision "default/ss-device-test-tf-acc-test-ai47eoiufr-0" class "standard": failed to provision volume: rancher.io/local-path does not support block volume provisioning
I0816 22:35:12.095830 1 event.go:282] Event(v1.ObjectReference{Kind:"PersistentVolumeClaim", Namespace:"default", Name:"ss-device-test-tf-acc-test-ai47eoiufr-0", UID:"186a28a0-b637-4c29-922b-a523a26d4c23", APIVersion:"v1", ResourceVersion:"2379", FieldPath:""}): type: 'Warning' reason: 'ProvisioningFailed' rancher.io/local-path does not support block volume provisioning
I0816 22:35:12.887555 1 controller.go:1337] provision "default/ss-device-test-tf-acc-test-oww82yagz2-0" class "standard": started
E0816 22:35:12.887684 1 controller.go:1361] provision "default/ss-device-test-tf-acc-test-oww82yagz2-0" class "standard": failed to provision volume: rancher.io/local-path does not support block volume provisioning
I0816 22:35:12.888008 1 event.go:282] Event(v1.ObjectReference{Kind:"PersistentVolumeClaim", Namespace:"default", Name:"ss-device-test-tf-acc-test-oww82yagz2-0", UID:"b9413651-c1db-4095-8926-63edf3bc132a", APIVersion:"v1", ResourceVersion:"2397", FieldPath:""}): type: 'Warning' reason: 'ProvisioningFailed' rancher.io/local-path does not support block volume provisioning
I0816 22:35:20.885571 1 controller.go:1337] provision "default/ss-device-test-tf-acc-test-103te79aze-0" class "standard": started
E0816 22:35:20.885753 1 controller.go:1361] provision "default/ss-device-test-tf-acc-test-103te79aze-0" class "standard": failed to provision volume: rancher.io/local-path does not support block volume provisioning
I0816 22:35:20.885840 1 event.go:282] Event(v1.ObjectReference{Kind:"PersistentVolumeClaim", Namespace:"default", Name:"ss-device-test-tf-acc-test-103te79aze-0", UID:"cb8a9b89-e6b2-4fb7-b755-ba2bea175956", APIVersion:"v1", ResourceVersion:"2436", FieldPath:""}): type: 'Warning' reason: 'ProvisioningFailed' rancher.io/local-path does not support block volume provisioning
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.
Thanks for the explanation! My only request then is to remove the mention of EKS in the tests since volumeDevices
is dependent on EKS and can be done on any platform. Be sure to include a changelog as well!
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.
Good point, thanks! I have removed the mention of EKS and included the changelog.
760080d
to
38a6c23
Compare
38a6c23
to
6ec1c85
Compare
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.
thanks for adding this in! I've updated the changelog to include the specific location of where volume_devices
was added.
Description
Resolves #2572
Acceptance tests
Output from acceptance testing follows, filtered only to the new EKS tests, since it's hard to test locally:
Release Note
Release note for CHANGELOG:
References
Community Note