diff --git a/deploy/helm/pulumi-operator/templates/deployment.yaml b/deploy/helm/pulumi-operator/templates/deployment.yaml index d4512618..c055fd95 100644 --- a/deploy/helm/pulumi-operator/templates/deployment.yaml +++ b/deploy/helm/pulumi-operator/templates/deployment.yaml @@ -38,7 +38,7 @@ spec: - --leader-elect - --health-probe-bind-address=:8081 - --metrics-bind-address=:8383 - - --program-fs-adv-addr=pulumi-kubernetes-operator.$(POD_NAMESPACE).svc.cluster.local + - --program-fs-adv-addr=pulumi-kubernetes-operator.$(POD_NAMESPACE).svc.cluster.local:80 - --zap-log-level={{ .Values.controller.logLevel }} - --zap-time-encoding=iso8601 env: diff --git a/deploy/yaml/install.yaml b/deploy/yaml/install.yaml index 5a274c0d..4d38710a 100644 --- a/deploy/yaml/install.yaml +++ b/deploy/yaml/install.yaml @@ -28404,7 +28404,7 @@ spec: - --leader-elect - --health-probe-bind-address=:8081 - --metrics-bind-address=:8383 - - --program-fs-adv-addr=pulumi-kubernetes-operator.$(POD_NAMESPACE).svc.cluster.local + - --program-fs-adv-addr=pulumi-kubernetes-operator.$(POD_NAMESPACE).svc.cluster.local:80 - --zap-log-level=error - --zap-time-encoding=iso8601 env: diff --git a/operator/cmd/main.go b/operator/cmd/main.go index 4f47223a..a9fd4f3f 100644 --- a/operator/cmd/main.go +++ b/operator/cmd/main.go @@ -86,7 +86,7 @@ func main() { "If set, HTTP/2 will be enabled for the metrics and webhook servers") flag.StringVar(&programFSAddr, "program-fs-addr", envOrDefault("PROGRAM_FS_ADDR", ":9090"), "The address the static file server binds to.") - flag.StringVar(&programFSAdvAddr, "program-fs-adv-addr", envOrDefault("PROGRAM_FS_ADV_ADDR", "localhost:9090"), + flag.StringVar(&programFSAdvAddr, "program-fs-adv-addr", envOrDefault("PROGRAM_FS_ADV_ADDR", ""), "The advertised address of the static file server.") opts := zap.Options{ Development: true, @@ -150,6 +150,9 @@ func main() { // Create a new ProgramHandler to handle Program objects. Both the ProgramReconciler and the file server need to // access the ProgramHandler, so it is created here and passed to both. + if programFSAdvAddr == "" { + programFSAdvAddr = determineAdvAddr(programFSAddr) + } pHandler := newProgramHandler(mgr.GetClient(), programFSAdvAddr) if err = (&autocontroller.WorkspaceReconciler{ diff --git a/operator/config/manager/manager.yaml b/operator/config/manager/manager.yaml index 78eaac76..d72b2532 100644 --- a/operator/config/manager/manager.yaml +++ b/operator/config/manager/manager.yaml @@ -44,7 +44,7 @@ spec: - --leader-elect - --health-probe-bind-address=:8081 - --metrics-bind-address=:8383 - - --program-fs-adv-addr=pulumi-kubernetes-operator.$(POD_NAMESPACE).svc.cluster.local + - --program-fs-adv-addr=pulumi-kubernetes-operator.$(POD_NAMESPACE).svc.cluster.local:80 - --zap-log-level=error - --zap-time-encoding=iso8601 ports: