From b41ced59a417561e896c5979e630a535eb1a818b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=A5=96=E5=BB=BA?= Date: Sun, 8 Oct 2023 15:29:26 +0800 Subject: [PATCH] pass probe port via command argument MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 张祖建 --- cmd/webhook/server.go | 5 ++--- yamls/webhook.yaml | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/webhook/server.go b/cmd/webhook/server.go index f38c30d7ad6..b9f053e6082 100644 --- a/cmd/webhook/server.go +++ b/cmd/webhook/server.go @@ -21,8 +21,6 @@ import ( "github.com/kubeovn/kube-ovn/versions" ) -const healthProbePort = 8080 - const hookServerCertDir = "/tmp/k8s-webhook-server/serving-certs" var scheme = runtime.NewScheme() @@ -43,6 +41,7 @@ func main() { klog.Infof(versions.String()) port := pflag.Int("port", 8443, "The port webhook listen on.") + healthProbePort := pflag.Int32("health-probe-port", 8080, "The port health probes listen on.") klogFlags := flag.NewFlagSet("klog", flag.ExitOnError) klog.InitFlags(klogFlags) @@ -77,7 +76,7 @@ func main() { Metrics: metricsserver.Options{ BindAddress: "0", }, - HealthProbeBindAddress: util.JoinHostPort(os.Getenv("POD_IP"), healthProbePort), + HealthProbeBindAddress: util.JoinHostPort(os.Getenv("POD_IP"), *healthProbePort), }) if err != nil { panic(err) diff --git a/yamls/webhook.yaml b/yamls/webhook.yaml index ca5bf74b36b..fe76f86523d 100644 --- a/yamls/webhook.yaml +++ b/yamls/webhook.yaml @@ -39,6 +39,7 @@ spec: - /kube-ovn/kube-ovn-webhook args: - --port=8443 + - --health-probe-port=8080 - --v=3 env: - name: POD_IP