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

Feature/add selectors cluster private endpoint #610

Conversation

bradkwadsworth-mw
Copy link
Contributor

Description of your changes

Added resource selectors for spec.forProvider.privateClusterConfig.privateEndpointSubnetwork

Fixes #609

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

Applied to a local Kind cluster
manifest:

---
apiVersion: compute.gcp.upbound.io/v1beta1
kind: Network
metadata:
  annotations:
    uptest.upbound.io/timeout: "4800"
    meta.upbound.io/example-id: compute/v1beta1/network
  labels:
    testing.upbound.io/example-name: example_network
  name: example-network
spec:
  forProvider:
    autoCreateSubnetworks: false
---
apiVersion: compute.gcp.upbound.io/v1beta1
kind: Subnetwork
metadata:
  annotations:
    meta.upbound.io/example-id: compute/v1beta1/subnetwork
  labels:
    testing.upbound.io/example-name: example_subnet
  name: gke
spec:
  forProvider:
    ipCidrRange: 10.0.0.0/24
    networkSelector:
      matchLabels:
        testing.upbound.io/example-name: example_network
    region: us-central1
    privateIpGoogleAccess: true
    secondaryIpRange:
      - ipCidrRange: 10.1.0.0/16
        rangeName: pods
      - ipCidrRange: 10.2.0.0/20
        rangeName: services
---
apiVersion: compute.gcp.upbound.io/v1beta1
kind: Router
metadata:
  annotations:
    meta.upbound.io/example-id: compute/v1beta1/router
  labels:
    testing.upbound.io/example-name: example_router
  name: example-router
spec:
  forProvider:
    networkSelector:
      matchLabels:
        testing.upbound.io/example-name: example_network
    region: us-central1
---
apiVersion: compute.gcp.upbound.io/v1beta1
kind: RouterNAT
metadata:
  annotations:
    meta.upbound.io/example-id: compute/v1beta1/routernat
  labels:
    testing.upbound.io/example-name: example_routernat
  name: example-routernat
spec:
  forProvider:
    natIpAllocateOption: AUTO_ONLY
    region: us-central1
    routerSelector:
      matchLabels:
        testing.upbound.io/example-name: example_router
    sourceSubnetworkIpRangesToNat: ALL_SUBNETWORKS_ALL_IP_RANGES
---
apiVersion: container.gcp.upbound.io/v1beta1
kind: Cluster
metadata:
  annotations:
    meta.upbound.io/example-id: container/v1beta1/cluster
  labels:
    testing.upbound.io/example-name: cluster
  name: cluster
spec:
  forProvider:
    addonsConfig:
      - gcePersistentDiskCsiDriverConfig:
          - enabled: true
        gcpFilestoreCsiDriverConfig:
          - enabled: true
        gkeBackupAgentConfig:
          - enabled: true
    binaryAuthorization:
      - evaluationMode: PROJECT_SINGLETON_POLICY_ENFORCE
    datapathProvider: ADVANCED_DATAPATH
    deletionProtection: false
    enableAutopilot: false
    enableIntranodeVisibility: true
    enableL4IlbSubsetting: true
    enableShieldedNodes: true
    gatewayApiConfig:
      - channel: CHANNEL_STANDARD
    initialNodeCount: 1
    ipAllocationPolicy:
      - clusterSecondaryRangeName: pods
        servicesSecondaryRangeName: services
    location: us-central1
    masterAuthorizedNetworksConfig:
      - gcpPublicCidrsAccessEnabled: false
        cidrBlocks:
          - cidrBlock: 10.0.0.0/24
            displayName: bastion
    networkSelector:
      matchLabels:
        testing.upbound.io/example-name: example_network
    networkingMode: VPC_NATIVE
    privateClusterConfig:
      - enablePrivateEndpoint: true
        enablePrivateNodes: true
        masterGlobalAccessConfig:
          - enabled: false
        privateEndpointSubnetworkSelector:
          matchLabels:
            testing.upbound.io/example-name: example_subnet
    releaseChannel:
      - channel: STABLE
    removeDefaultNodePool: true
    subnetworkSelector:
      matchLabels:
        testing.upbound.io/example-name: example_subnet
Screenshot 2024-09-03 at 5 25 54 PM

@bradkwadsworth-mw bradkwadsworth-mw force-pushed the feature/add-selectors-cluster-private-endpoint branch 2 times, most recently from 76c15b4 to 984b284 Compare September 3, 2024 22:31
@turkenf
Copy link
Collaborator

turkenf commented Sep 4, 2024

Hi @bradkwadsworth-mw, thanks for the PR.

For failed CI pipelines, please run make submodules and force push the changes.

@bradkwadsworth-mw
Copy link
Contributor Author

I ran make submodules and there were no changes.

@bradkwadsworth-mw
Copy link
Contributor Author

@turkenf Any ideas on how I should proceed?

@bradkwadsworth-mw bradkwadsworth-mw force-pushed the feature/add-selectors-cluster-private-endpoint branch 2 times, most recently from cf25db5 to 6a65aeb Compare September 16, 2024 14:51
@bradkwadsworth-mw
Copy link
Contributor Author

@turkenf It looks like the tests are passing now.

@bradkwadsworth-mw bradkwadsworth-mw force-pushed the feature/add-selectors-cluster-private-endpoint branch 3 times, most recently from 4ec146b to a997a66 Compare October 9, 2024 14:07
@bradkwadsworth-mw
Copy link
Contributor Author

@turkenf Just rebased against current main.

@turkenf
Copy link
Collaborator

turkenf commented Oct 9, 2024

/test-examples="examples/cloudplatform/v1beta1/serviceaccount.yaml"

Copy link
Collaborator

@turkenf turkenf left a comment

Choose a reason for hiding this comment

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

Thank you for your effort @bradkwadsworth-mw, I left two comments. And, do you have a specific reason for updating the build submodule, if not would you revert it to the same commit as main?

apis/container/v1beta1/zz_cluster_types.go Outdated Show resolved Hide resolved
apis/container/v1beta1/zz_cluster_types.go Show resolved Hide resolved
@bradkwadsworth-mw bradkwadsworth-mw force-pushed the feature/add-selectors-cluster-private-endpoint branch from a997a66 to 070c165 Compare October 16, 2024 15:58
@bradkwadsworth-mw
Copy link
Contributor Author

@turkenf I think I fixed the issues.

@turkenf
Copy link
Collaborator

turkenf commented Oct 18, 2024

@bradkwadsworth-mw, as I mentioned here: do you have a specific reason for updating the build submodule, if not would you revert it to the same commit as main?

@turkenf
Copy link
Collaborator

turkenf commented Oct 18, 2024

And please squash your commits for a clean commit history.

@bradkwadsworth-mw bradkwadsworth-mw force-pushed the feature/add-selectors-cluster-private-endpoint branch from 070c165 to 1255095 Compare October 24, 2024 15:49
@bradkwadsworth-mw
Copy link
Contributor Author

@turkenf ok should be good I hope.

@turkenf
Copy link
Collaborator

turkenf commented Oct 24, 2024

Please add the following lines to PrivateClusterConfigInitParameters and PrivateClusterConfigParameters in the apis/container/v1beta1/zz_cluster_types.go file.

	// +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/compute/v1beta2.Subnetwork
	// +crossplane:generate:reference:extractor=github.com/upbound/provider-gcp/config/common.SelfLinkExtractor()

You just need to copy changes in types go file from v1beta2 to v1beta1

@bradkwadsworth-mw bradkwadsworth-mw force-pushed the feature/add-selectors-cluster-private-endpoint branch from 1255095 to b15dbe0 Compare October 24, 2024 18:31
@bradkwadsworth-mw
Copy link
Contributor Author

@turkenf hopefully that should do it.

@turkenf
Copy link
Collaborator

turkenf commented Oct 24, 2024

Could you please run make generate again and push the changes?

@bradkwadsworth-mw bradkwadsworth-mw force-pushed the feature/add-selectors-cluster-private-endpoint branch from b15dbe0 to ca5bb2c Compare October 24, 2024 21:33
@bradkwadsworth-mw bradkwadsworth-mw force-pushed the feature/add-selectors-cluster-private-endpoint branch from ca5bb2c to 25f8e4b Compare October 28, 2024 13:47
Copy link
Collaborator

@turkenf turkenf left a comment

Choose a reason for hiding this comment

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

Thank you @bradkwadsworth-mw, LGTM.

@turkenf turkenf merged commit 59c689d into crossplane-contrib:main Oct 28, 2024
9 checks passed
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.

Add resource selectors for privateEndpointSubnetwork to clusters.container.gcp.upbound.io
2 participants