Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions cmd/csi/provisioner/cmd.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package provisioner

import (
"os"

"github.com/Dynatrace/dynatrace-operator/pkg/api/scheme"
dtcsi "github.com/Dynatrace/dynatrace-operator/pkg/controllers/csi"
csiprovisioner "github.com/Dynatrace/dynatrace-operator/pkg/controllers/csi/provisioner"
Expand Down Expand Up @@ -91,6 +93,7 @@ func createManager(config *rest.Config, namespace string) (manager.Manager, erro
Metrics: server.Options{
BindAddress: metricsBindAddress,
},
PprofBindAddress: os.Getenv("PPROF_BIND_ADDRESS"),
HealthProbeBindAddress: probeAddress,
LivenessEndpointName: livenessEndpointName,
}
Expand Down
5 changes: 4 additions & 1 deletion cmd/csi/server/cmd.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package server

import (
"os"

"github.com/Dynatrace/dynatrace-operator/pkg/api/scheme"
dtcsi "github.com/Dynatrace/dynatrace-operator/pkg/controllers/csi"
csidriver "github.com/Dynatrace/dynatrace-operator/pkg/controllers/csi/driver"
Expand Down Expand Up @@ -87,7 +89,8 @@ func createManager(config *rest.Config, namespace string) (manager.Manager, erro
Metrics: server.Options{
BindAddress: metricsBindAddress,
},
Scheme: scheme.Scheme,
PprofBindAddress: os.Getenv("PPROF_BIND_ADDRESS"),
Scheme: scheme.Scheme,
}

mgr, err := manager.New(config, options)
Expand Down
1 change: 1 addition & 0 deletions cmd/operator/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ func createOptions(namespace string) ctrl.Options {
Metrics: server.Options{
BindAddress: metricsBindAddress,
},
PprofBindAddress: os.Getenv("PPROF_BIND_ADDRESS"),
LeaderElection: true,
LeaderElectionID: leaderElectionID,
LeaderElectionResourceLock: leaderElectionResourceLock,
Expand Down
1 change: 1 addition & 0 deletions cmd/webhook/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ func createOptions(namespace string) ctrl.Options {
Metrics: server.Options{
BindAddress: metricsBindAddress,
},
PprofBindAddress: os.Getenv("PPROF_BIND_ADDRESS"),
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ spec:
- name: LOG_LEVEL
value: "debug"
{{- end }}
{{- if .Values.enableProfiling }}
- name: PPROF_BIND_ADDRESS
value: ":6060"
{{- end }}
{{- if and (not .Values.debug) .Values.csidriver.server.livenessProbe.enabled }}
livenessProbe:
failureThreshold: {{ .Values.csidriver.server.livenessProbe.failureThreshold }}
Expand Down Expand Up @@ -182,6 +186,10 @@ spec:
- name: LOG_LEVEL
value: "debug"
{{- end }}
{{- if .Values.enableProfiling }}
- name: PPROF_BIND_ADDRESS
value: ":6061"
{{- end }}
{{- if .Values.csidriver.cleanupPeriod }}
- name: CLEANUP_PERIOD
value: "{{ .Values.csidriver.cleanupPeriod}}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ spec:
- name: LOG_LEVEL
value: "debug"
{{- end }}
{{- if .Values.enableProfiling }}
- name: PPROF_BIND_ADDRESS
value: ":6060"
{{- end }}
{{ include "dynatrace-operator.modules-json-env" . | nindent 12}}
{{ include "dynatrace-operator.gomemlimit" .Values.operator | nindent 12 }}
ports:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ spec:
- name: LOG_LEVEL
value: "debug"
{{- end }}
{{- if .Values.enableProfiling }}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
{{- if .Values.enableProfiling }}
{{- if .Values.enableGoProfiling }}

- name: PPROF_BIND_ADDRESS
value: ":6060"
{{- end }}
{{ include "dynatrace-operator.modules-json-env" . | nindent 12 }}
readinessProbe:
httpGet:
Expand Down
2 changes: 2 additions & 0 deletions hack/make/deploy/deploy.mk
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
ENABLE_CSI ?= true
DEBUG_LOGS ?= true
PROFILING ?= true
PLATFORM ?= "kubernetes"
HELM_CHART ?= config/helm/chart/default

Expand All @@ -22,6 +23,7 @@ deploy: manifests/crd/helm
--set manifests=true \
--set image=$(IMAGE_URI) \
--set debugLogs=$(DEBUG_LOGS) \
--set enableProfiling=$(PROFILING) \
--set debug=$(DEBUG)

## Undeploy the current operator installation
Expand Down