Skip to content

Conversation

rifelpet
Copy link
Member

@rifelpet rifelpet commented Aug 15, 2020

This is the alternative solution to #9756

When sslCertificate is set, the API ELB will also have a TCP listener on 8443 that will pass through the TLS session to the apiserver pods, allowing client certificate auth.

When --admin is specified in kops update cluster or kops export kubecfg, the kubeconfig file will use this port and will include the cluster's CA.

If anyone has a preference for port number other than 8443 I'm happy to change it.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 15, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rifelpet

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 area/provider/aws Issues or PRs related to aws provider approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Aug 15, 2020
@rifelpet
Copy link
Member Author

/hold for comment

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 15, 2020
@johngmyers
Copy link
Member

johngmyers commented Aug 15, 2020

Looks like the Terraform provider needs to consistently sort the listeners on an ELB in order for the integration tests to not flake.

@johngmyers
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 16, 2020
@hakman
Copy link
Member

hakman commented Aug 17, 2020

/lgtm

@rifelpet
Copy link
Member Author

We might need to go back to the drawing board on this one :( I finally had a chance to test it out:

error running task "LoadBalancer/api.foo.k8s.local" (9m54s remaining to succeed): error creating LoadBalancerListeners: InvalidConfigurationRequest: Listeners can't talk to InstancePort 443 with secure and insecure protocols at the same time

@johngmyers
Copy link
Member

Might be worth an AWS ticket to let them know of the use case, but that probably won't help us.

@hakman
Copy link
Member

hakman commented Aug 20, 2020

What if also open port 8443 on host?

@rifelpet
Copy link
Member Author

Opening a second port on the instances would require we forward traffic on that port to apiserver. I suppose the apiserver health check container is performing a similar function right now so we could extend it and give it a more generic name. That will vastly increase the scope of this change though, so it'd be nice to get agreement on that prior to implementation.

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 20, 2020
@k8s-ci-robot
Copy link
Contributor

New changes are detected. LGTM label has been removed.

@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 20, 2020
@rifelpet rifelpet force-pushed the acm-cert-listener branch 2 times, most recently from a463aae to cbbd9aa Compare August 20, 2020 15:11
@rifelpet
Copy link
Member Author

Ok I tried to use a second hostPort in the kube-apiserver pod spec and pointed the second ELB listener at the second port but that didn't work because hostNetwork: true requires matching containerPort and hostPort (of course)

Aug 20 21:14:54 ip-XX-XX-XX-XX kubelet[6631]: E0820 21:14:54.409160 6631 file.go:187] Can't process manifest file "/etc/kubernetes/manifests/kube-apiserver.manifest": invalid pod: [spec.containers[0].ports[1].containerPort: Invalid value: 443: must match hostPortwhenhostNetwork is true]

So it seems like if we want to keep pursuing the second listener option we'd need to have something listening on a second instance port (hijacking the healthcheck container is sounding better and better...)

Beyond that, I did notice when upgrading an existing cluster, we'll need to remind users not to use update cluster --admin before rolling-update cluster or else the generated kubeconfig file will be pointing to the new port which wont work until at least one master has been replaced, causing rolling-update to fail. Therefor we should recommend kops update cluster --yes; kops rolling-update cluster --yes; kops update cluster --yes --admin

@rifelpet
Copy link
Member Author

I wonder if NLBs don't have the duplicate instancePort limitation that ELBs do. We have an open PR to add NLB support, maybe it's worth focusing on getting that merged for 1.19. That would be much more elegant than our other proposals.

I'll test an NLB tomorrow unless someone else gets a chance first.

@seh
Copy link
Contributor

seh commented Aug 21, 2020

One note on NLBs, in case you consider their use for from the control plane components as well: They only support hairpin connections from EC2 instances registered as targets by their IP address, and not by their instance ID. That precludes registering the instances automatically by virtue of their management by an ASG, as that registration method registers them by instance ID.

Instead, you have register and deregister the EC2 instances when they boot or shut down (such as via systemd units), but of course it's possible for the machines to die without the deregistration procedure running. A controller running elsewhere would be more resilient. though more complicated.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 27, 2020
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Oct 24, 2020
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 25, 2020
@k8s-ci-robot
Copy link
Contributor

@rifelpet: The following tests failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
pull-kops-bazel-test f6c2ee9 link /test pull-kops-bazel-test
pull-kops-verify-cloudformation f6c2ee9 link /test pull-kops-verify-cloudformation

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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. I understand the commands that are listed here.

@rifelpet
Copy link
Member Author

rifelpet commented Nov 2, 2020

Superseded by #10157
/close

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 2, 2020
@k8s-ci-robot
Copy link
Contributor

@rifelpet: PR needs rebase.

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

@rifelpet: Closed this PR.

In response to this:

Superseded by #10157
/close

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.

@rifelpet rifelpet deleted the acm-cert-listener branch May 5, 2021 13:44
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. area/nodeup area/provider/aws Issues or PRs related to aws provider cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants