Skip to content

Commit

Permalink
pass probe port via command argument
Browse files Browse the repository at this point in the history
Signed-off-by: 张祖建 <[email protected]>
  • Loading branch information
zhangzujian committed Oct 8, 2023
1 parent a451c7a commit b41ced5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
5 changes: 2 additions & 3 deletions cmd/webhook/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions yamls/webhook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ spec:
- /kube-ovn/kube-ovn-webhook
args:
- --port=8443
- --health-probe-port=8080
- --v=3
env:
- name: POD_IP
Expand Down

0 comments on commit b41ced5

Please sign in to comment.