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

Add Support for DNS Config on GKE #470

Merged
merged 4 commits into from
Oct 6, 2022

Conversation

jensentanlo
Copy link
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
Copy link
Contributor Author

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

Copy link
Collaborator

@Feggah Feggah 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 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.

apis/container/v1beta2/cluster_types.go Outdated Show resolved Hide resolved
apis/container/v1beta2/cluster_types.go Outdated Show resolved Hide resolved
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
Contributor Author

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

Copy link
Collaborator

@Feggah Feggah left a comment

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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants