Skip to content

Add skeleton for ClusterStoragePolicyInfo controller#3973

Open
skogta wants to merge 2 commits intokubernetes-sigs:masterfrom
skogta:topic/skogta/spi-controller
Open

Add skeleton for ClusterStoragePolicyInfo controller#3973
skogta wants to merge 2 commits intokubernetes-sigs:masterfrom
skogta:topic/skogta/spi-controller

Conversation

@skogta
Copy link
Copy Markdown
Contributor

@skogta skogta commented Apr 16, 2026

What this PR does / why we need it:
This PR adds the skeleton for ClusterStoragePolicyInfo Controller.

At a high level it covers the following changes:

  1. Apply ClusterSPI CRD.
  2. Watch for SC and VAC creation inside the controller.
  3. Create ClusterSPI CR if it does not already exist for the given SC/VAC.
  4. Add ownerref of SC and VAC at the time of creation.
  5. Do not create a clusterCPI in case WFFC volumebinding mode.

Testing done:
clusrerSPI CRs got created for each SC on their own:

k get clusterspi
NAME                                                   AGE
management-storage-policy-encryption                   10m
management-storage-policy-regular                      10m
management-storage-policy-single-node                  10m
management-storage-policy-stretched-lite               10m
management-storage-policy-thin                         10m
vm-encryption-policy                                   10m
vsan-default-storage-policy                            10m
 k get clusterspi -oyaml management-storage-policy-encryption

apiVersion: cns.vmware.com/v1alpha1
kind: ClusterStoragePolicyInfo
metadata:
  creationTimestamp: "2026-04-17T09:19:21Z"
  generation: 1
  name: management-storage-policy-encryption
  ownerReferences:
  - apiVersion: storage.k8s.io/v1
    blockOwnerDeletion: false
    controller: false
    kind: StorageClass
    name: management-storage-policy-encryption
    uid: a66c6122-5f8a-4dc8-b78a-eb13755e0d3a
  resourceVersion: "2482860"
  uid: ffea23c8-8fb2-48b1-8d40-99b14a3abf99
spec:
  k8sCompliantName: management-storage-policy-encryption

Manually created 1 CR:

root@4212ef7b3c931047671ef485ba899967 [ ~ ]# k get clusterspi -oyaml my-gold-policy
apiVersion: cns.vmware.com/v1alpha1
kind: ClusterStoragePolicyInfo
metadata:
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: |
      {"apiVersion":"cns.vmware.com/v1alpha1","kind":"ClusterStoragePolicyInfo","metadata":{"annotations":{},"name":"my-gold-policy"},"spec":{"k8sCompliantName":"gold-policy-k8s-name"}}
  creationTimestamp: "2026-04-17T09:21:47Z"
  generation: 1
  name: my-gold-policy
  resourceVersion: "2484343"
  uid: 5ddc2b89-c298-47be-bf48-17a11be88753
spec:
  k8sCompliantName: gold-policy-k8s-name

WCP precheckin (passed): https://jenkins-vcf-csifvt.devops.broadcom.net/job/wcp-instapp-e2e-pre-checkin/1268/
VKS precheckin (failed): https://jenkins-vcf-csifvt.devops.broadcom.net/job/vks-instapp-e2e-pre-checkin/1022/

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: skogta
Once this PR has been reviewed and has the lgtm label, please assign akankshapanse for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@skogta skogta marked this pull request as draft April 16, 2026 07:44
@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Apr 16, 2026
@skogta skogta force-pushed the topic/skogta/spi-controller branch 3 times, most recently from 79d81f9 to 06d7a57 Compare April 17, 2026 09:23
@deepakkinni
Copy link
Copy Markdown
Collaborator

Triggering CSI-WCP Pre-checkin Pipeline for this PR... Job takes approximately an hour to complete
Jenkins Build #1264

@deepakkinni
Copy link
Copy Markdown
Collaborator

Triggering CSI-WCP Pre-checkin Pipeline for this PR... Job takes approximately an hour to complete
Jenkins Build #1263

@deepakkinni
Copy link
Copy Markdown
Collaborator

Triggering CSI-TKG Pre-checkin Pipeline for this PR... Job takes approximately an hour to complete
Jenkins Build #1022

@deepakkinni
Copy link
Copy Markdown
Collaborator

FAILED --- Jenkins Build #1263

@deepakkinni
Copy link
Copy Markdown
Collaborator

FAILED --- Jenkins Build #1264

@skogta skogta force-pushed the topic/skogta/spi-controller branch from 06d7a57 to 3fb8e9e Compare April 21, 2026 08:05
@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Apr 21, 2026
@skogta skogta marked this pull request as ready for review April 21, 2026 08:05
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 21, 2026
@skogta skogta force-pushed the topic/skogta/spi-controller branch from 3fb8e9e to cf79411 Compare April 21, 2026 08:10
@deepakkinni
Copy link
Copy Markdown
Collaborator

Triggering CSI-WCP Pre-checkin Pipeline for this PR... Job takes approximately an hour to complete
Jenkins Build #1268

@deepakkinni
Copy link
Copy Markdown
Collaborator

FAILED --- Jenkins Build #1022

@skogta skogta force-pushed the topic/skogta/spi-controller branch 2 times, most recently from 690df0c to 0a6a5f5 Compare April 21, 2026 08:42
@deepakkinni
Copy link
Copy Markdown
Collaborator

SUCCESS --- Jenkins Build #1268

@skogta skogta changed the title Topic/skogta/spi controller Add skeleton for ClusterStoragePolicyInfo controller Apr 21, 2026
@deepakkinni
Copy link
Copy Markdown
Collaborator

Triggering CSI-TKG Pre-checkin Pipeline for this PR... Job takes approximately an hour to complete
Jenkins Build #1023

@skogta skogta force-pushed the topic/skogta/spi-controller branch from 0a6a5f5 to e2a848a Compare April 21, 2026 13:45
@deepakkinni
Copy link
Copy Markdown
Collaborator

Triggering CSI-TKG Pre-checkin Pipeline for this PR... Job takes approximately an hour to complete
Jenkins Build #1025

@deepakkinni
Copy link
Copy Markdown
Collaborator

Triggering CSI-TKG Pre-checkin Pipeline for this PR... Job takes approximately an hour to complete
Jenkins Build #1024

@deepakkinni
Copy link
Copy Markdown
Collaborator

Triggering CSI-TKG Pre-checkin Pipeline for this PR... Job takes approximately an hour to complete
Jenkins Build #1026

@skogta skogta force-pushed the topic/skogta/spi-controller branch 2 times, most recently from 4aaf5b2 to 77d3565 Compare April 22, 2026 06:34
@skogta skogta force-pushed the topic/skogta/spi-controller branch from 77d3565 to 70386b8 Compare April 22, 2026 06:40
@deepakkinni
Copy link
Copy Markdown
Collaborator

Triggering CSI-TKG Pre-checkin Pipeline for this PR... Job takes approximately an hour to complete
Jenkins Build #1029

@deepakkinni
Copy link
Copy Markdown
Collaborator

FAILED --- Jenkins Build #1029

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants