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

Fix kanister service port issue in case if webhook is disabled #1476

Merged
merged 2 commits into from
Jun 16, 2022

Conversation

viveksinghggits
Copy link
Contributor

@viveksinghggits viveksinghggits commented Jun 13, 2022

Change Overview

In the cases where we install Kanister with webhook enabled we create a service (443) that forwards the request to port 9443 on container. When we upgrade kanister with --set bpValidatingWebhook.enabled=false the service should listen on 8000 and forward the request to port 8000 on container.
This was not happening already, this PR tries to do that.

There was another request in the issue #1376, that says the metrics and healthz endpoint should also not be changed, if we toggle the value bpValidatingWebhook.enabled. Should we handle that as separate PR.

Pull request type

Please check the type of change your PR introduces:

  • 🚧 Work in Progress
  • 🌈 Refactoring (no functional changes, no api changes)
  • 🐹 Trivial/Minor
  • 🐛 Bugfix
  • 🌻 Feature
  • 🗺️ Documentation
  • 🤖 Test

Issues

Test Plan

  • 💪 Manual
  • ⚡ Unit test
  • 💚 E2E

@github-actions
Copy link
Contributor

Thanks for submitting this pull request 🎉. The team will review it soon and get back to you.

If you haven't already, please take a moment to review our project contributing guideline and Code of Conduct document.

@infraq infraq added this to In Progress in Kanister Jun 13, 2022
@viveksinghggits
Copy link
Contributor Author

Start with default conf

Install kanister operator (by default webhook would be enabled)

# curl https://kanister-kanister-operator.kanister.svc.cluster.local/v0/healthz -k
{"alive":true,"version":"0.79.0"}

Upgrade the installed release and disable webhook

» helm upgrade kanister helm/kanister-operator -n kanister --set bpValidatingWebhook.enabled=false
# curl kanister-kanister-operator.kanister.svc.cluster.local:8000/v0/healthz
{"alive":true,"version":"0.79.0"}

Upgrade again to enable the validing webhook

» helm upgrade kanister helm/kanister-operator -n kanister --set bpValidatingWebhook.enabled=true
# curl https://kanister-kanister-operator.kanister.svc.cluster.local/v0/healthz -k
{"alive":true,"version":"0.79.0"}

Strart with validating webhook disabled

» helm install kanister helm/kanister-operator -n kanister --set bpValidatingWebhook.enabled=false
# curl kanister-kanister-operator.kanister.svc.cluster.local:8000/v0/healthz
{"alive":true,"version":"0.79.0"}

Upgrade kanister and enable webhook server

# curl https://kanister-kanister-operator.kanister.svc.cluster.local/v0/healthz -k
{"alive":true,"version":"0.79.0"}

@viveksinghggits
Copy link
Contributor Author

The other thing that I want to talk about is, if we really want to have same endpoint for metrics and healthz irrespective of the fact that validating webhook is enabled or disabled.

Kanister automation moved this from In Progress to Reviewer approved Jun 16, 2022
Copy link
Contributor

@ihcsim ihcsim left a comment

Choose a reason for hiding this comment

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

LGTM 👍. Thanks for fixing this.

@ihcsim ihcsim added the kueue label Jun 16, 2022
@mergify mergify bot merged commit 4297c8d into master Jun 16, 2022
Kanister automation moved this from Reviewer approved to Done Jun 16, 2022
@mergify mergify bot deleted the wh-metrics-bug branch June 16, 2022 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants