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 status field to TransportServer resource #1425

Merged
merged 1 commit into from
Mar 9, 2021

Conversation

soneillf5
Copy link
Contributor

@soneillf5 soneillf5 commented Mar 3, 2021

Proposed changes

This change adds the status field to the TransportServer resource.
This enables a user to get the status of the TransportServer i.e.

$ kubectl get ts
NAME      STATE   REASON           IP    PORTS   AGE
dns-tcp   Valid   AddedOrUpdated                 54m

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that all unit tests pass after adding my changes
  • I have updated necessary documentation
  • I have rebased my branch onto master
  • I will ensure my PR is targeting the master branch and pulling from my branch from my own fork

@github-actions github-actions bot added the documentation Pull requests/issues for documentation label Mar 3, 2021
Copy link
Contributor

@pleshakov pleshakov left a comment

Choose a reason for hiding this comment

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

Hi @soneillf5

Please see my feedback.

With TransportServer, it is a bit trickier than with VirtualServer: VirtualServer can have one or two ports. For example it can have port 80 or ports 80 and 443. However, with TransportServer, we only have one port, which corresponds to the port of the listener.

For TCP/UDP TransportServer , it only makes sense to report IP and port when:

  • external-status-address is set in the ConfigMap (we assume that address exposes all ports)
  • the type LoadBalancer service, configured for KIC and used via -external-service, configures a port and protocol that matches the port and protocol of the listener used in the TransportServer. So if the Services exposes port 53, we report the service public IPs and port 53 for a TransportServer that has a listener that uses port 53. Otherwise, if the port is not configured in the Service, it will not be accessible via the allocated cloud LoadBalancer.

For TLS Passthrough TransportServer, which uses port 443, it makes sense to report IP and port in the status when:

pkg/apis/configuration/v1alpha1/types.go Outdated Show resolved Hide resolved
pkg/apis/configuration/v1alpha1/types.go Show resolved Hide resolved
internal/k8s/utils.go Outdated Show resolved Hide resolved
internal/k8s/status_test.go Outdated Show resolved Hide resolved
internal/k8s/status_test.go Outdated Show resolved Hide resolved
internal/k8s/status_test.go Outdated Show resolved Hide resolved
internal/k8s/controller.go Outdated Show resolved Hide resolved
@soneillf5
Copy link
Contributor Author

soneillf5 commented Mar 4, 2021

Hi @pleshakov, thank for the review. I've addressed most of the comments.

The outstanding issue is your comment about reporting the external IP/Port.
You state 'it only makes sense to report the IP/host' under certain conditions.
My understanding is that the output of k get ts depends on the CRD k8s.nginx.org_transportservers.yaml which we don't change at runtime? If that's the case, how do we change what we report?

Or do you mean that we should check for all of the conditions you mentioned?

@soneillf5 soneillf5 force-pushed the transport-server-status-field branch from 2eaaa88 to 99f9c70 Compare March 4, 2021 11:48
pkg/apis/configuration/v1alpha1/types.go Outdated Show resolved Hide resolved
pkg/apis/configuration/v1alpha1/types.go Show resolved Hide resolved
pkg/apis/configuration/v1alpha1/types.go Outdated Show resolved Hide resolved
internal/k8s/status_test.go Show resolved Hide resolved
internal/k8s/status.go Outdated Show resolved Hide resolved
internal/k8s/status.go Outdated Show resolved Hide resolved
@soneillf5
Copy link
Contributor Author

soneillf5 commented Mar 5, 2021

The IP and Port fields are a lot more nuanced and involved, causing a lot of rework on this PR.

I've removed the two fields and logic required for them. If they are still required, we can add them in a new PR.

@pleshakov

pkg/apis/configuration/v1alpha1/types.go Outdated Show resolved Hide resolved
internal/k8s/controller.go Show resolved Hide resolved
internal/k8s/controller.go Outdated Show resolved Hide resolved
@soneillf5 soneillf5 force-pushed the transport-server-status-field branch from efc5c41 to d5d2842 Compare March 8, 2021 12:27
@soneillf5
Copy link
Contributor Author

@pleshakov updated and ready to merge

@pleshakov pleshakov self-requested a review March 8, 2021 16:19
Copy link
Contributor

@pleshakov pleshakov left a comment

Choose a reason for hiding this comment

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

@soneillf5 lgtm

(but I can't find this though #1425 (comment) )

@soneillf5 soneillf5 force-pushed the transport-server-status-field branch from d5d2842 to 4e3007f Compare March 9, 2021 10:13
@soneillf5 soneillf5 merged commit 0491948 into master Mar 9, 2021
@lucacome lucacome added the enhancement Pull requests for new features/feature enhancements label Mar 11, 2021
@lucacome lucacome deleted the transport-server-status-field branch April 27, 2021 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Pull requests/issues for documentation enhancement Pull requests for new features/feature enhancements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants