Skip to content

Add project support #356

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

Merged
merged 8 commits into from
May 28, 2024
Merged

Conversation

vishesh92
Copy link
Member

@vishesh92 vishesh92 commented May 9, 2024

Issue #, if available:
Fixes #217
Description of changes:
Allow specifying project name along with account & domains in CloudStackClusterSpec.

Testing performed: Created and tested an env in default project and a new test project.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label May 9, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: vishesh92

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

The pull request process is described here

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 9, 2024
Copy link

netlify bot commented May 9, 2024

Deploy Preview for kubernetes-sigs-cluster-api-cloudstack ready!

Name Link
🔨 Latest commit 28faaac
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-cluster-api-cloudstack/deploys/664cfc758711f20008778d06
😎 Deploy Preview https://deploy-preview-356--kubernetes-sigs-cluster-api-cloudstack.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label May 9, 2024
@vishesh92
Copy link
Member Author

/ok-to-test

@k8s-ci-robot k8s-ci-robot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label May 9, 2024
@rohityadavcloud rohityadavcloud added this to the v0.5.0 milestone May 17, 2024
@rohityadavcloud rohityadavcloud requested review from hrak and g-gaston May 20, 2024 07:00
@rohityadavcloud
Copy link
Member

@weizhouapache @g-gaston @hrak pl review and advise, this attempts to solve a long-standing issue that users are not able to use CAPC in their projects.

Copy link
Contributor

@g-gaston g-gaston left a comment

Choose a reason for hiding this comment

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

Thanks for the change!

I would like to discuss a bit the UX (the implementation looks sound). I was expecting to see the projectID field in the API (talking about CAPD CRDs).

It seems to me like this is a config that the user might want specify per cluster, at leats that's what I extract from the original issue. It feels like a cluster attribute (create all resources for this cluster in this project). This seems to point to the [CloudStackCluster](https://doc.crds.dev/github.com/kubernetes-sigs/cluster-api-provider-cloudstack/infrastructure.cluster.x-k8s.io/CloudStackCluster/[email protected]#spec-failureDomains-account). And that intuition gets re-enforced by the presence of account in the CloudStackCluster (I think it used to be at the top level and it's now part of the failure domain).

So, would it make sense to move this field from the credentials secret to the CloudStackCluster object? Are there technical reasons why this is not possible?

@weizhouapache
Copy link
Collaborator

So, would it make sense to move this field from the credentials secret to the CloudStackCluster object? Are there technical reasons why this is not possible?

It makes sense to me

@rohityadavcloud
Copy link
Member

@g-gaston I had the same thought, but @vishesh92 advised to me that since in the credentials we don't specify account ID we can keep project ID there and it would require lesser refactorings. Ideally all configuration params including projectID should be part of CloudStackCluster

@vishesh92 could you proceed to address the review comments, and move projectID to cloudstack cluster object?

@weizhouapache
Copy link
Collaborator

@vishesh92
Can you also consider the project resource limitations?

@vishesh92 vishesh92 force-pushed the add-project-support branch from cc95d4a to b61ae4c Compare May 21, 2024 09:46
Copy link
Collaborator

@weizhouapache weizhouapache left a comment

Choose a reason for hiding this comment

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

thanks for the update @vishesh92

Is it possible to add a e2e test for project, similar as test/e2e/data/infrastructure-cloudstack/v1beta2/cluster-template-subdomain/cloudstack-cluster.yaml ?

@vishesh92 vishesh92 force-pushed the add-project-support branch from f719a1e to eba72cf Compare May 21, 2024 12:26
@blueorangutan
Copy link

Test Results : (tid-404)
Environment: kvm Rocky8(x3), Advanced Networking with Management Server Rocky8
Kubernetes Version: v1.27.2
Kubernetes Version upgrade from: v1.26.5
Kubernetes Version upgrade to: v1.27.2
CloudStack Version: 4.19
Template: ubuntu-2004-kube
E2E Test Run Logs: https://github.com/blueorangutan/capc-prs/releases/download/capc-pr-ci-cd/capc-e2e-artifacts-pr356-sl-404.zip



Summarizing 2 Failures:
  [FAIL] When testing resource cleanup [AfterEach] Should create a new network when the specified network does not exist
  /jenkins/workspace/capc-e2e-new/test/e2e/resource_cleanup.go:101
  [FAIL] When testing affinity group [It] Should have host affinity group when affinity is pro
  /jenkins/workspace/capc-e2e-new/test/e2e/common.go:332

Ran 28 of 29 Specs in 9906.986 seconds
FAIL! -- 26 Passed | 2 Failed | 0 Pending | 1 Skipped
--- FAIL: TestE2E (9906.99s)
FAIL

@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 21, 2024
@vishesh92 vishesh92 force-pushed the add-project-support branch 2 times, most recently from a5c90b4 to 87a8e78 Compare May 21, 2024 14:01
@weizhouapache
Copy link
Collaborator

/run-e2e -c 4.19

@blueorangutan
Copy link

@weizhouapache a jenkins job has been kicked to run test with following paramaters:

  • kubernetes version: 1.27.2
  • CloudStack version: 4.19
  • hypervisor: kvm
  • template: ubuntu-2004-kube
  • Kubernetes upgrade from: 1.26.5 to 1.27.2

@blueorangutan
Copy link

Setting up environment failed

@vishesh92 vishesh92 force-pushed the add-project-support branch 2 times, most recently from 21ce310 to 37a3996 Compare May 21, 2024 16:49
@blueorangutan
Copy link

Tests were aborted.

@blueorangutan
Copy link

Setting up environment failed

1 similar comment
@blueorangutan
Copy link

Setting up environment failed

@vishesh92 vishesh92 force-pushed the add-project-support branch from 37a3996 to 28faaac Compare May 21, 2024 19:56
@blueorangutan
Copy link

Test Results : (tid-418)
Environment: kvm Rocky8(x3), Advanced Networking with Management Server Rocky8
Kubernetes Version: v1.27.2
Kubernetes Version upgrade from: v1.26.5
Kubernetes Version upgrade to: v1.27.2
CloudStack Version: 4.19
Template: ubuntu-2004-kube
E2E Test Run Logs: https://github.com/blueorangutan/capc-prs/releases/download/capc-pr-ci-cd/capc-e2e-artifacts-pr356-sl-418.zip



Summarizing 4 Failures:
  [FAIL] When testing Kubernetes version upgrades [It] Should successfully upgrade kubernetes versions when there is a change in relevant fields
  /root/go/pkg/mod/sigs.k8s.io/cluster-api/[email protected]/framework/machinedeployment_helpers.go:127
  [FAIL] When testing affinity group [It] Should have host affinity group when affinity is pro
  /jenkins/workspace/capc-e2e-new/test/e2e/common.go:348
  [FAIL] When testing project [AfterEach] Should create a cluster in a project
  /jenkins/workspace/capc-e2e-new/test/e2e/project.go:103
  [TIMEDOUT] When testing app deployment to the workload cluster with network interruption [ToxiProxy] [It] Should be able to create a cluster despite a network interruption during that process
  /jenkins/workspace/capc-e2e-new/test/e2e/network_interruption_toxi.go:77

Ran 29 of 30 Specs in 10818.560 seconds
FAIL! - Suite Timeout Elapsed -- 25 Passed | 4 Failed | 0 Pending | 1 Skipped
--- FAIL: TestE2E (10818.56s)
FAIL

@vishesh92
Copy link
Member Author

@g-gaston I have made the changes and moved the project to CloudStackCluster. Please review again.

@blueorangutan
Copy link

Test Results : (tid-424)
Environment: kvm Rocky8(x3), Advanced Networking with Management Server Rocky8
Kubernetes Version: v1.27.2
Kubernetes Version upgrade from: v1.26.5
Kubernetes Version upgrade to: v1.27.2
CloudStack Version: 4.19
Template: ubuntu-2004-kube
E2E Test Run Logs: https://github.com/blueorangutan/capc-prs/releases/download/capc-pr-ci-cd/capc-e2e-artifacts-pr356-sl-424.zip



Summarizing 3 Failures:
  [FAIL] When testing affinity group [It] Should have host affinity group when affinity is pro
  /jenkins/workspace/capc-e2e-new/test/e2e/common.go:348
  [FAIL] When testing Kubernetes version upgrades [It] Should successfully upgrade kubernetes versions when there is a change in relevant fields
  /root/go/pkg/mod/sigs.k8s.io/cluster-api/[email protected]/framework/machinedeployment_helpers.go:127
  [TIMEDOUT] When testing MachineDeployment rolling upgrades [It] Should successfully upgrade Machines upon changes in relevant MachineDeployment fields
  /jenkins/workspace/capc-e2e-new/test/e2e/md_rollout.go:60

Ran 29 of 30 Specs in 10817.946 seconds
FAIL! - Suite Timeout Elapsed -- 26 Passed | 3 Failed | 0 Pending | 1 Skipped
--- FAIL: TestE2E (10817.95s)
FAIL

@kubernetes-sigs kubernetes-sigs deleted a comment from blueorangutan May 23, 2024
@weizhouapache
Copy link
Collaborator

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 28, 2024
@k8s-ci-robot k8s-ci-robot merged commit 514e4c3 into kubernetes-sigs:main May 28, 2024
10 checks passed
@vishesh92 vishesh92 deleted the add-project-support branch May 29, 2024 05:59
@g-gaston
Copy link
Contributor

Sorry I didn't get to review, high level lgtm, thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release:must-have size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow Project-Level Resource Creation
6 participants