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

Renaming kubernetes.io/cluster tag to use EKS cluster name #3573

Merged
merged 1 commit into from
Jul 13, 2022

Conversation

knabben
Copy link
Member

@knabben knabben commented Jul 5, 2022

What type of PR is this?

/kind bug

What this PR does / why we need it:
This PR changes the tag kubernetes.io/cluster/ to have the same EKS cluster name as the other objects, instead of the CAPI cluster name.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #3572

Special notes for your reviewer:

  1. Adding IAMAUTH mocker with mockgen
  2. Increasing the coverage of EKS module for createCluster, this test will guarantee no regressions in the tag.

Checklist:

  • squashed commits
  • includes documentation
  • adds unit tests
  • adds or updates e2e tests

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-priority labels Jul 5, 2022
@k8s-ci-robot
Copy link
Contributor

@knabben: This issue is currently awaiting triage.

If CAPA/CAPI contributors determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jul 5, 2022
@faiq
Copy link
Contributor

faiq commented Jul 5, 2022

I think you want to change this to use KubernetesClusterName as well https://github.com/kubernetes-sigs/cluster-api-provider-aws/blob/main/pkg/cloud/services/eks/cluster.go#L365

@knabben
Copy link
Member Author

knabben commented Jul 5, 2022

I think you want to change this to use KubernetesClusterName as well https://github.com/kubernetes-sigs/cluster-api-provider-aws/blob/main/pkg/cloud/services/eks/cluster.go#L365

At this point, if we do this change the ELB will stop to work again since EKS is not using the CAPI name in the CCM configuration.

@faiq
Copy link
Contributor

faiq commented Jul 5, 2022

I think you want to change this to use KubernetesClusterName as well https://github.com/kubernetes-sigs/cluster-api-provider-aws/blob/main/pkg/cloud/services/eks/cluster.go#L365

At this point, if we do this change the ELB will stop to work again since EKS is not using the CAPI name in the CCM configuration.

Yes, the function I sent you should use KubernetesClusterName, not Name and keep the other tags as they are in main. (I authored the original change to get the Load Balancers to work.)

This should address the inconsistencies described in #3572.

@knabben knabben changed the title [wip] Renaming Kubernetes cluster name on objects tags Renaming kubernetes.io/cluster tag to use EKS cluster name Jul 5, 2022
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 5, 2022
@knabben knabben force-pushed the fix-cluster-name branch from 2c26814 to f9ef35f Compare July 5, 2022 16:33
@knabben
Copy link
Member Author

knabben commented Jul 5, 2022

/test

@k8s-ci-robot
Copy link
Contributor

@knabben: The /test command needs one or more targets.
The following commands are available to trigger required jobs:

  • /test pull-cluster-api-provider-aws-build
  • /test pull-cluster-api-provider-aws-test
  • /test pull-cluster-api-provider-aws-verify

The following commands are available to trigger optional jobs:

  • /test pull-cluster-api-provider-aws-apidiff-main
  • /test pull-cluster-api-provider-aws-e2e
  • /test pull-cluster-api-provider-aws-e2e-blocking
  • /test pull-cluster-api-provider-aws-e2e-conformance
  • /test pull-cluster-api-provider-aws-e2e-conformance-with-ci-artifacts
  • /test pull-cluster-api-provider-aws-e2e-eks

Use /test all to run the following jobs that were automatically triggered:

  • pull-cluster-api-provider-aws-apidiff-main
  • pull-cluster-api-provider-aws-build
  • pull-cluster-api-provider-aws-test
  • pull-cluster-api-provider-aws-verify

In response to this:

/test

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@knabben
Copy link
Member Author

knabben commented Jul 5, 2022

/test pull-cluster-api-provider-aws-e2e

@knabben knabben force-pushed the fix-cluster-name branch from f9ef35f to ca890b0 Compare July 5, 2022 19:34
@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jul 5, 2022
@knabben knabben force-pushed the fix-cluster-name branch from ca890b0 to dad773d Compare July 5, 2022 19:44
@knabben knabben force-pushed the fix-cluster-name branch from dad773d to 03c8db9 Compare July 5, 2022 19:50
@sedefsavas
Copy link
Contributor

/lgtm
cc @richardcase for another review.
We can cherry pick this one to release-1.5 too? Looks important enough.

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 12, 2022
@richardcase
Copy link
Member

@sedefsavas - yes lets cherry pick this for 1.5.

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: richardcase

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 Jul 13, 2022
@richardcase
Copy link
Member

/cherry-pick release-1.5

@k8s-infra-cherrypick-robot

@richardcase: once the present PR merges, I will cherry-pick it on top of release-1.5 in a new PR and assign it to you.

In response to this:

/cherry-pick release-1.5

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-infra-cherrypick-robot

@richardcase: new pull request created: #3591

In response to this:

/cherry-pick release-1.5

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@Skarlso
Copy link
Contributor

Skarlso commented Jul 13, 2022

Ah, nice, this will make MY PR smaller now since you added the mock for the IAM one for create cluster. :)

@Skarlso
Copy link
Contributor

Skarlso commented Jul 14, 2022

Hey @knabben!

It looks like this is breaking the upgrade flow test. Would you mind taking a look at this error:

E0713 19:35:41.930286 1 controller.go:317] controller/awsmanagedcontrolplane "msg"="Reconciler error" "error"="failed to reconcile control plane for AWSManagedControlPlane eks-upgrade-onnuy2/eks-upgrade-sijk09-control-plane: checking owner of eks-upgrade-onnuy2_eks-upgrade-sijk09-control-plane is eks-upgrade-sijk09: %!w()" "name"="eks-upgrade-sijk09-control-plane" "namespace"="eks-upgrade-onnuy2" "reconciler group"="controlplane.cluster.x-k8s.io" "reconciler kind"="AWSManagedControlPlane"

In this run: https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_cluster-api-provider-aws/3568/pull-cluster-api-provider-aws-e2e-eks/1547298125415190528

You can inspect the CAPA controller log here: https://storage.googleapis.com/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_cluster-api-provider-aws/3568/pull-cluster-api-provider-aws-e2e-eks/1547298125415190528/artifacts/clusters/bootstrap/controllers/capa-controller-manager/capa-controller-manager-6df746c6c6-dbn2l/manager.log

Further logs:

controller/awsmanagedcontrolplane "msg"="Reconciler error" "error"="failed to reconcile control plane for AWSManagedControlPlane eks-upgrade-onnuy2/eks-upgrade-sijk09-control-plane: checking owner of eks-upgrade-onnuy2_eks-upgrade-sijk09-control-plane is eks-upgrade-sijk09: %!w(<nil>)" "name"="eks-upgrade-sijk09-control-plane" "namespace"="eks-upgrade-onnuy2" "reconciler group"="controlplane.cluster.x-k8s.io" "reconciler kind"="AWSManagedControlPlane"

This looks suspicious: is eks-upgrade-sijk09: %!w(<nil>).

@Skarlso
Copy link
Contributor

Skarlso commented Jul 14, 2022

Never mind. I think it's my fault, I haven't merged in this PR apparently in another PR I was running. 🤦 I thought I did, but apparently I didn't.

@Skarlso
Copy link
Contributor

Skarlso commented Jul 14, 2022

E0714 05:23:46.831908       1 controller.go:317] controller/awsmanagedcontrolplane "msg"="Reconciler error" "error"="failed to reconcile control plane for AWSManagedControlPlane eks-upgrade-vkundt/eks-upgrade-pupqgg-control-plane: checking owner of eks-upgrade-vkundt_eks-upgrade-pupqgg-control-plane is eks-upgrade-pupqgg: %!w(<nil>)" "name"="eks-upgrade-pupqgg-control-plane" "namespace"="eks-upgrade-vkundt" "reconciler group"="controlplane.cluster.x-k8s.io" "reconciler kind"="AWSManagedControlPlane"

So it's still the same problem even after merging this PR.

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. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inconsistent kubernetes.io/cluster/ tag usage with EKS
7 participants