Skip to content

Conversation

ldalorion
Copy link
Contributor

@ldalorion ldalorion commented May 15, 2025

Description of your changes

Add controlplane management. Notable changes are as follows:

  • added new api group spacemgmt.upbound.io (not to collide with the actual spaces api)
  • under the new spacemgmt.upbound.io group I added two resources
    • ControlPlane
    • ControlPlaneGroup
  • very rough controller implementation of both
  • two clients that interact with api.upbound.io endpoint that leverages the credentials in the providerConfig

Other Notes (Will remove once converted into a PR)

20250515
Opened a draft pr and here are some top of mind todos:

  • adding unit tests
  • updating the status on the ControlPlaneGroup resource
  • refactoring the status on ControlPlane resource
  • test with robot tokens (only can be used on ControlPlane resource management)

dalorion's wishlist

  • not having specify the orgName and space; use ProviderConfig or something similar to refernce
  • something else maybe lol

Fixes # https://github.com/upbound/team-platform/issues/299

I have:

  • Read and followed Crossplane's contribution process.
  • Run make reviewable to ensure this PR is ready for review.
  • Added backport release-x.y labels to auto-backport this PR if necessary.

How has this code been tested

created controlplane using the following managed resource

apiVersion: spacesmgmt.upbound.io/v1alpha1
kind: ControlPlane
metadata:
  name: provider-upbound-local-test
spec:
  forProvider:
    name: provider-upbound-local-test
    organizationName: upbound
    spaceName: upbound-gcp-us-west-1
    controlPlaneGroupName: 20241203-dalorion-test
    details:
      crossplane:
        autoUpgrade:
          channel: Rapid

output

apiVersion: spacesmgmt.upbound.io/v1alpha1
kind: ControlPlane
metadata:
  annotations:
    crossplane.io/external-create-failed: "2025-05-15T11:15:00-05:00"
    crossplane.io/external-create-pending: "2025-05-15T11:15:50-05:00"
    crossplane.io/external-create-succeeded: "2025-05-15T11:15:50-05:00"
    crossplane.io/external-name: provider-upbound-local-test
    kubectl.kubernetes.io/last-applied-configuration: |
      {"apiVersion":"spacesmgmt.upbound.io/v1alpha1","kind":"ControlPlane","metadata":{"annotations":{},"name":"provider-upbound-local-test","namespace":"default"},"spec":{"forProvider":{"controlPlaneGroupName":"20241203-dalorion-test","details":{"crossplane":{"autoUpgrade":{"channel":"Rapid"}}},"name":"provider-upbound-local-test","organizationName":"upbound","spaceName":"upbound-gcp-us-west-1"}}}
  creationTimestamp: "2025-05-15T16:08:52Z"
  finalizers:
  - finalizer.managedresource.crossplane.io
  generation: 1
  name: provider-upbound-local-test
  namespace: default
  resourceVersion: "2219"
  uid: d89d70fd-0f35-4dc6-b817-3f8c6e55da71
spec:
  deletionPolicy: Delete
  forProvider:
    controlPlaneGroupName: 20241203-dalorion-test
    details:
      crossplane:
        autoUpgrade:
          channel: Rapid
        state: Running
    name: provider-upbound-local-test
    organizationName: upbound
    spaceName: upbound-gcp-us-west-1
  managementPolicies:
  - '*'
  providerConfigRef:
    name: default
status:
  atProvider:
    conditions:
    - lastTransitionTime: "2025-05-15T16:15:55Z"
      reason: ExtensionsReady
      status: "True"
      type: extensionsReady
    - lastTransitionTime: "2025-05-15T16:15:51Z"
      reason: SupportedCrossplaneVersion
      status: "True"
      type: Supported
    - lastTransitionTime: "2025-05-15T16:18:37Z"
      reason: Available
      status: "True"
      type: Ready
    - lastTransitionTime: "2025-05-15T16:16:04Z"
      reason: ReconcileSuccess
      status: "True"
      type: Synced
    - lastTransitionTime: "2025-05-15T16:18:36Z"
      reason: Provisioned
      status: "True"
      type: ControlPlaneProvisioned
    - lastTransitionTime: "2025-05-15T16:18:49Z"
      reason: HealthyControlPlane
      status: "True"
      type: Healthy
    controlPlaneID: f7d9aaa6-3754-4a33-9cee-f958aa1ec20e
    message: Available
  conditions:
  - lastTransitionTime: "2025-05-15T16:15:50Z"
    reason: Available
    status: "True"
    type: Ready
  - lastTransitionTime: "2025-05-15T16:15:50Z"
    reason: ReconcileSuccess
    status: "True"
    type: Synced

created controlplane group with the following mr

apiVersion: spacesmgmt.upbound.io/v1alpha1
kind: ControlPlaneGroup
metadata:
  name: provider-upbound-test
spec:
  forProvider:
    name: provider-upbound-test
    organizationName: upbound
    spaceName: upbound-gcp-us-west-1

here's the output locally

apiVersion: spacesmgmt.upbound.io/v1alpha1
kind: ControlPlaneGroup
metadata:
  annotations:
    crossplane.io/external-create-pending: "2025-05-15T11:50:15-05:00"
    crossplane.io/external-create-succeeded: "2025-05-15T11:50:15-05:00"
    crossplane.io/external-name: provider-upbound-test
    kubectl.kubernetes.io/last-applied-configuration: |
      {"apiVersion":"spacesmgmt.upbound.io/v1alpha1","kind":"ControlPlaneGroup","metadata":{"annotations":{},"name":"provider-upbound-test"},"spec":{"forProvider":{"name":"provider-upbound-test","organizationName":"upbound","spaceName":"upbound-gcp-us-west-1"}}}
  creationTimestamp: "2025-05-15T16:50:15Z"
  finalizers:
  - finalizer.managedresource.crossplane.io
  generation: 1
  name: provider-upbound-test
  resourceVersion: "6548"
  uid: 42a75bd6-4192-4fdd-bf43-ce1a66316725
spec:
  deletionPolicy: Delete
  forProvider:
    name: provider-upbound-test
    organizationName: upbound
    spaceName: upbound-gcp-us-west-1
  managementPolicies:
  - '*'
  providerConfigRef:
    name: default

@ldalorion ldalorion self-assigned this May 15, 2025
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.

1 participant