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

refactor: use one http.Server #463

Open
diafour opened this issue Feb 15, 2023 · 0 comments
Open

refactor: use one http.Server #463

diafour opened this issue Feb 15, 2023 · 0 comments
Labels
enhancement New feature or request
Milestone

Comments

@diafour
Copy link
Contributor

diafour commented Feb 15, 2023

Background

Ports
Shell-operator starts different tcp listeners:

  • port 9115 for operator metrics and liveness probe
  • port --hook-metrics-listen-port for hook metrics
  • port 9680 for validating and mutating webhooks
  • port 9681 for conversion webhooks

There is an issue when shell-operator runs in the private cluster in GKE or in other clouds: control-plane nodes allow to connect to regular nodes only by 443 and 10250 ports. (See this discussion for more details external-secrets/external-secrets#1982)

There is no reason to have different ports for metrics and webhooks. May be it is required for kube-rbac-proxy, but it supports different auth parameters for different paths.

Services for webhooks

There are separate settings for admission and conversion webhooks:

  • service name
  • server certificate and key
  • CA and client CA

These settings are needed only for different listeners.

Solution

  1. Keep only one http server for metrics and for webhooks. (Debug server should be different, it listens on unix socket).
  2. Change default listen-port from 9115 to 10250.
  3. Add documentation about default port, why it is 10250 and when it should be changed, e.g. when using hostNetwork: true.
  4. Remove --hook-metrics-listen-port option.
  5. Merge CONVERSION_WEBHOOK_* and VALIDATING_WEBHOOK_* settings into one set of WEBHOOK_* settings.
  6. Change default directory for certificates to /webhook-certs
  7. Use one Service for all webhooks
  8. Add additonal prefix for webhook paths if needed.
  9. Change webhook examples
@diafour diafour added the enhancement New feature or request label Feb 15, 2023
@diafour diafour added this to the 1.3.0 milestone Feb 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant