From f3b16301f555f8035d69a5720ed1e6b342504705 Mon Sep 17 00:00:00 2001 From: Kevin Klues Date: Wed, 17 Apr 2024 15:05:12 +0100 Subject: [PATCH] DRAFT: Update README with how to run with structured parameters Signed-off-by: Kevin Klues --- README.md | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 505bb128..3b47cd81 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ From here we will build the image for the example resource driver: And create a `kind` cluster to run it in: ```bash -./create-cluster.sh +KUBE_GIT_VERSION=v1.30.0 BUILD_KIND_IMAGE=true KIND_K8S_TAG=master ./create-cluster.sh ``` Once the cluster has been created successfully, double check everything is @@ -76,6 +76,18 @@ helm upgrade -i \ ../deployments/helm/dra-example-driver ``` +**Note**: If you would like to run this example driver with +`StructuredParameters`, add `withStructuredParameters=true` to your helm +command as below: +``` +helm upgrade -i \ + --create-namespace \ + --namespace dra-example-driver \ + --set withStructuredParameters=true \ + dra-example-driver \ + ../deployments/helm/dra-example-driver +``` + Double check the driver components have come up successfully: ```console $ kubectl get pod -n dra-example-driver @@ -117,6 +129,43 @@ Spec: ... ``` +**Note**: When running with `StructuredParameters` you can also check that the +`ResourceSlice` has been populated with similar information: +``` +$ kubectl get resourceslice -o yaml +apiVersion: v1 +items: +- apiVersion: resource.k8s.io/v1alpha2 + driverName: gpu.resource.example.com + kind: ResourceSlice + metadata: + creationTimestamp: "2024-04-17T13:45:44Z" + generateName: dra-example-driver-cluster-worker-gpu.resource.example.com- + name: dra-example-driver-cluster-worker-gpu.resource.example.comxktph + ownerReferences: + - apiVersion: v1 + controller: true + kind: Node + name: dra-example-driver-cluster-worker + uid: 4dc7c3b2-d99c-492b-8ede-37d435e56b2d + resourceVersion: "1189" + uid: 61c965b5-54a9-40ee-88a1-c52a814fa624 + namedResources: + instances: + - name: gpu-0159f35e-99ee-b2b5-74f1-9d18df3f22ac + - name: gpu-657bd2e7-f5c2-a7f2-fbaa-0d1cdc32f81b + - name: gpu-18db0e85-99e9-c746-8531-ffeb86328b39 + - name: gpu-93d37703-997c-c46f-a531-755e3e0dc2ac + - name: gpu-ee3e4b55-fcda-44b8-0605-64b7a9967744 + - name: gpu-9ede7e32-5825-a11b-fa3d-bab6d47e0243 + - name: gpu-e7b42cb1-4fd8-91b2-bc77-352a0c1f5747 + - name: gpu-f11773a1-5bfb-e48b-3d98-1beb5baaf08e + nodeName: dra-example-driver-cluster-worker +kind: List +metadata: + resourceVersion: "" +``` + Next, deploy four example apps that demonstrate how `ResourceClaim`s, `ResourceClaimTemplate`s, and custom `ClaimParameter` objects can be used to request access to resources in various ways: