Skip to content
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

cdi: example driver: fix wrong value for the path of spec #3

Open
wants to merge 50 commits into
base: PR0100-dynamic-resource-allocation
Choose a base branch
from

Conversation

hj-johannes-lee
Copy link

Signed-off-by: Hyeongju Johannes Lee [email protected]

pohly and others added 30 commits April 12, 2022 15:46
Merge conflicts become less likely when:
- features are sorted alphabetically because
  then changes are more likely to be done in
  different parts of the files
- blank lines separate the hash entries because
  gofmt then doesn't change the formating of
  other entries when adding or removing one

Merge conflicts where pretty common shortly before a code freeze when everyone
added new features at the end of the files.
This removes all feature definitions that were marked for removal in 1.25, with
some exceptions:
- some features were marked for removal in 1.25 although they only graduated
  to GA in 1.24 - that seems too soon
- CSIVolumeFSGroupPolicy is still used in the code, so removing it will
  be more work and was deferred
ResourceClaimSpec and its associated code are needed for the core API and have
to be defined there to avoid import cycles.
This is needed for "kubectl get". It depends on the generated swagger docs.
The logic of the driver is very simple (no real allocation, just set some env
variables). The main purpose is to develop and test the code that integrates
with Kubernetes.
This is similar to the support code for generic ephemeral inline volumes.
Differences:
- to avoid stuttering, the functions are just resourceclaim.Name and
  resourceclaim.IsForPod
- resourceclaim.Name returns the right name for both cases (template
  and reference), which will simplify some code
The controller uses the exact same logic as the generic ephemeral inline volume
controller, just for inline ResourceClaimTemplate -> ResourceClaim.
It may be useful to append additional content at the end of the generated
configurations to add or overwrite settings. For example, scheduler extenders
must be listed in kube-scheduler.yaml.
The plugin handles the interaction with ResourceClaims that are referenced by a
Pod.
A scheduler extender for a resource driver is like a normal extender, with one
difference:
- calling it can be limited to pods which use a resource claim with a certain
  driver name, similar to how extenders can be limited based on extended
  resources
- the builtin request/response mechanism for resource availability
  via PotentialNodes/UnsuitableNodes gets disabled when the extender
  supports filtering

Deploying scheduler and resource driver like this is an optimization that
avoids storing potentially long lists of node names in the
ResourceClaim.Status. Neither Kubernetes distros nor resource drivers are
required to support this.
The example resource driver optionally provides a scheduler extender. The
controller package handles this completely by mapping the request to the same
driver call that also handles communication through the apiserver.

For testing,
  SCHEDULER_CONFIG_APPENDIX=test/integration/cdi/example-driver/deploy/scheduler-config-appendix.yaml \
  ... hack/local-up-cluster.sh
in combination with running the example driver on port 9999 can be used.
- add desired and actual StateOfWorld to the Resource Manager
- implement required StateOfWorld APIs
- implement verifyResourcesPreparedFunc
Added desiredStateOfWorldPopulator to the resource manager structures
to be able to call its method ReprocessPod from the Run method of the
resource manager.
Implemented processing of pod resources for DesiredStateOfWorldPopulator
and required APIs for Actual and Desired State of the World.
- get rid of NodeGetInfo call
- updated NodePrepareResource and NodeUnprepareResource requests
  and responses
Signed-off-by: Hyeongju Johannes Lee <[email protected]>
bart0sh and others added 20 commits June 15, 2022 19:17
- get rid of GetNodeInfo API.
- updated Node[Un]PrepareResource API according to the
  GRPC API changes.
This fix should make kubelet to consider resources
prepared and run the pod
Remove unnecessary files and funcs copied from csi volume hostpath plugin
Remove unused parameters

Signed-off-by: Hyeongju Johannes Lee <[email protected]>
@bart0sh bart0sh force-pushed the PR0100-dynamic-resource-allocation branch from 9c44097 to b363909 Compare July 8, 2022 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants