Skip to content
This repository was archived by the owner on May 30, 2025. It is now read-only.

Add Support for DNS Config on GKE - #470

Merged
Feggah merged 4 commits into
crossplane-contrib:masterfrom
jensentanlo:add-DNS-config-to-gke
Oct 6, 2022
Merged

Add Support for DNS Config on GKE#470
Feggah merged 4 commits into
crossplane-contrib:masterfrom
jensentanlo:add-DNS-config-to-gke

Conversation

@jensentanlo

Copy link
Copy Markdown
Contributor

Description of your changes

In the GKE API and gcloud, there is the option to select CloudDNS instead of relying on the regular kube-dns. This adds those fields to the GKE Cluster CRD.

In order to do that, I had to upgrade some dependencies to deal with some issues as detailed here:

Upgraded google.golang.org/api v0.52.0 to google.golang.org/api v0.97.0

sigs.k8s.io/controller-tools v0.8.0 to sigs.k8s.io/controller-tools v0.9.2 (fixes kubernetes-sigs/controller-tools#613 which occurs because google.golang.org/grpc is upgraded by the google.golang.org/api upgrade)

The "DesiredAutopilot' field no longer exists in the newer version of the client. In the documentation, it says that converting between Standard and Autopilot is not supported: https://cloud.google.com/kubernetes-engine/docs/concepts/autopilot-overview#no_conversion

Fixes #464

I have:

  • [ x] Read and followed Crossplane's contribution process.
  • [ x] Run make reviewable test to ensure this PR is ready for review.

How has this code been tested

I created a GKE cluster and verified with gcloud that its dnsConfig was correctly set.

Upgraded google.golang.org/api v0.52.0 to google.golang.org/api v0.97.0

sigs.k8s.io/controller-tools v0.8.0 to sigs.k8s.io/controller-tools v0.9.2 (fixes kubernetes-sigs/controller-tools#613 which occurs because google.golang.org/grpc is upgraded by the google.golang.org/api upgrade)

The "DesiredAutopilot' field no longer exists in the newer version of the client. In the documentation, it says that converting between Standard and Autopilot is not supported: https://cloud.google.com/kubernetes-engine/docs/concepts/autopilot-overview#no_conversion

Signed-off-by: Jensen Lo <54557407+jensentanlo@users.noreply.github.com>
Signed-off-by: Jensen Lo <jtlo@alumni.princeton.edu>
Signed-off-by: Jensen Lo <54557407+jensentanlo@users.noreply.github.com>
Signed-off-by: Jensen Lo <jtlo@alumni.princeton.edu>
Signed-off-by: Jensen Lo <54557407+jensentanlo@users.noreply.github.com>
Signed-off-by: Jensen Lo <jtlo@alumni.princeton.edu>
@jensentanlo
jensentanlo force-pushed the add-DNS-config-to-gke branch from f4f0190 to 010a6c9 Compare October 4, 2022 18:56
@jensentanlo

Copy link
Copy Markdown
Contributor Author

@Feggah Thanks for the help yesterday with testing. Would it be possible to kick off the pre-merge checks for me?

@Feggah Feggah left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for your effort, @jensentanlo !

Added some small coments in the code.

I think you also need to add the DNSConfig logic for the LateInitializeSpec method. This method is responsible for importing the field value when it isn't specified in the MR manifest. This is important when we are importing an existing GKE.

Lastly, I think you should change the TestLateInitializeSpec and TestIsUpToDate tests to cover the modifications you made in this PR.

Comment thread apis/container/v1beta2/cluster_types.go
Comment thread apis/container/v1beta2/cluster_types.go
Added relevant annotations
Changed optional fields to pointers
Added late initialization logic (and manually tested)
Added more tests

Signed-off-by: Jensen Lo <jtlo@alumni.princeton.edu>
@jensentanlo

Copy link
Copy Markdown
Contributor Author

Thanks for the detailed review comments, I think I've addressed everything + manually tested again as well.

@jensentanlo
jensentanlo requested a review from Feggah October 6, 2022 19:49

@Feggah Feggah left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks, @jensentanlo! LGTM

@Feggah
Feggah merged commit d85e3cc into crossplane-contrib:master Oct 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add DNSConfig support for GKE Clusters controller-gen panics when reading selector expressions containing composite literals (Go 1.17)

2 participants