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

feat(topology): add support for custom topology keys #135

Merged
merged 1 commit into from
Dec 18, 2020

Conversation

prateekpandey14
Copy link
Contributor

@prateekpandey14 prateekpandey14 commented Dec 16, 2020

Signed-off-by: prateekpandey14 prateek.pandey@mayadata.io

What this PR does:
Now user can label the nodes with the required custom topology, the cstor-csi driver will support all the node labels as topology keys.

Ideally we should label the nodes first and then deploy the driver to make it aware of all the labels that node has been configured.
If we want to add labels on the Nodes after CStor CSI driver has been deployed, a restart all the csi-node daemonset pods are required so that the driver can pick the labels and add them as supported topology keys.

How the changes has been tested :

  1. Label all the similar nodes using the same key value and use that label to create the StorageClass
$ kubectl label node node-1 node-2 openebs.io/nodegroup=storage
  1. Now, restart the CStor CSI Driver node daemonset pods (if already deployed, otherwise please ignore) so that it can pick the new node label as the supported topology
$  kubectl delete po -n openebs -l role=openebs-cstor-csi
  1. Now, we can create the StorageClass with required topologies information
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: cstor-sparse-auto
provisioner: cstor.csi.openebs.io
allowVolumeExpansion: true
volumeBindingMode: WaitForFirstConsumer
parameters:
  replicaCount: "1"
  cstorPoolCluster: "cspc-sparse"
  cas-type: "cstor"
allowedTopologies:
- matchLabelExpressions:
  - key: openebs.io/nodegroup
    values:
      - storage
  1. Verify the application pod get scheduled on matched nodes and running.

Special notes for your reviewer:
Docs will added to cstor-operators repo

Checklist

  • PR messages has document related information
  • Labelled this PR & related issue with documentation tag
  • PR messages has breaking changes related information
  • PR messages has upgrade related information
  • Labelled this PR & related issue with requires-upgrade tag
  • Tests updated

@codecov-io
Copy link

codecov-io commented Dec 16, 2020

Codecov Report

Merging #135 (dafc15b) into master (2078c9c) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #135   +/-   ##
=======================================
  Coverage   42.47%   42.47%           
=======================================
  Files          12       12           
  Lines         412      412           
=======================================
  Hits          175      175           
  Misses        224      224           
  Partials       13       13           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2078c9c...fee1a5e. Read the comment docs.

Signed-off-by: prateekpandey14 <prateek.pandey@mayadata.io>
Copy link

@pawanpraka1 pawanpraka1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good.

@kmova kmova merged commit 58c962a into openebs-archive:master Dec 18, 2020
@prateekpandey14 prateekpandey14 deleted the custom-topologies branch December 18, 2020 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request pr/release-note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants