Skip to content

Commit

Permalink
feat: support running in non-default namespace (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
erikgb committed Feb 2, 2024
1 parent c421a4f commit f3cdc46
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,13 @@ func main() {
os.Exit(1)
}

namespace, ok := os.LookupEnv("POD_NAMESPACE")
if !ok {
namespace = "kube-startup-cpu-boost-system"
}

certsReady := make(chan struct{})
if err = util.ManageCerts(mgr, "kube-startup-cpu-boost-system", certsReady); err != nil {
if err = util.ManageCerts(mgr, namespace, certsReady); err != nil {
setupLog.Error(err, "Unable to set up certificates")
os.Exit(1)
}
Expand Down
7 changes: 6 additions & 1 deletion config/default/manager_config_patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,9 @@ spec:
- --health-probe-bind-address=:8081
- --metrics-bind-address=127.0.0.1:8080
- --leader-elect
- --zap-log-level=5
- --zap-log-level=5
env:
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace

0 comments on commit f3cdc46

Please sign in to comment.