Skip to content
Merged
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
12 changes: 12 additions & 0 deletions cmd/syncer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"flag"
"fmt"
"net/http"
_ "net/http/pprof"
"os"
"os/signal"
"regexp"
Expand Down Expand Up @@ -84,6 +85,7 @@ var (
internalFSSNamespace = flag.String("fss-namespace", "", "Namespace of the feature state switch configmap")
periodicSyncIntervalInMin = flag.Duration("storagequota-sync-interval", 30*time.Minute,
"Periodic sync interval in Minutes")
enableProfileServer = flag.Bool("enable-profile-server", false, "Enable profiling endpoint for the syncer.")
)

// main for vsphere syncer.
Expand All @@ -98,6 +100,16 @@ func main() {
ctx, log := logger.GetNewContextWithLogger()
log.Infof("Version : %s", syncer.Version)

if *enableProfileServer {
go func() {
log.Info("Starting the http server to expose profiling metrics..")
err := http.ListenAndServe(":9501", nil)
if err != nil {
log.Fatalf("Unable to start profiling server: %s", err)
}
}()
}

// Set CO agnostic init params.
clusterFlavor, err := config.GetClusterFlavor(ctx)
if err != nil {
Expand Down
13 changes: 13 additions & 0 deletions cmd/vsphere-csi/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ import (
"context"
"flag"
"fmt"
"net/http"
_ "net/http/pprof"
"os"
"os/signal"
"syscall"
Expand All @@ -41,6 +43,7 @@ var (
"Namespace of the feature state switch configmap in supervisor cluster")
internalFSSName = flag.String("fss-name", "", "Name of the feature state switch configmap")
internalFSSNamespace = flag.String("fss-namespace", "", "Namespace of the feature state switch configmap")
enableProfileServer = flag.Bool("enable-profile-server", false, "Enable profiling endpoint for the controller.")
)

// main is ignored when this package is built as a go plug-in.
Expand All @@ -55,6 +58,16 @@ func main() {
ctx, log := logger.GetNewContextWithLogger()
log.Infof("Version : %s", service.Version)

if *enableProfileServer {
go func() {
log.Info("Starting the http server to expose profiling metrics..")
err := http.ListenAndServe(":9500", nil)
if err != nil {
log.Fatalf("Unable to start profiling server: %s", err)
}
}()
}

// Set CO Init params.
clusterFlavor, err := csiconfig.GetClusterFlavor(ctx)
if err != nil {
Expand Down
2 changes: 2 additions & 0 deletions manifests/guestcluster/1.31/pvcsi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ spec:
- "--supervisor-fss-namespace=$(CSI_NAMESPACE)"
- "--fss-name=internal-feature-states.csi.vsphere.vmware.com"
- "--fss-namespace=$(CSI_NAMESPACE)"
- "--enable-profile-server=false"
imagePullPolicy: "IfNotPresent"
ports:
- containerPort: 2112
Expand Down Expand Up @@ -270,6 +271,7 @@ spec:
- "--supervisor-fss-namespace=$(CSI_NAMESPACE)"
- "--fss-name=internal-feature-states.csi.vsphere.vmware.com"
- "--fss-namespace=$(CSI_NAMESPACE)"
- "--enable-profile-server=false"
imagePullPolicy: "IfNotPresent"
ports:
- containerPort: 2113
Expand Down
2 changes: 2 additions & 0 deletions manifests/guestcluster/1.32/pvcsi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ spec:
- "--supervisor-fss-namespace=$(CSI_NAMESPACE)"
- "--fss-name=internal-feature-states.csi.vsphere.vmware.com"
- "--fss-namespace=$(CSI_NAMESPACE)"
- "--enable-profile-server=false"
imagePullPolicy: "IfNotPresent"
ports:
- containerPort: 2112
Expand Down Expand Up @@ -270,6 +271,7 @@ spec:
- "--supervisor-fss-namespace=$(CSI_NAMESPACE)"
- "--fss-name=internal-feature-states.csi.vsphere.vmware.com"
- "--fss-namespace=$(CSI_NAMESPACE)"
- "--enable-profile-server=false"
imagePullPolicy: "IfNotPresent"
ports:
- containerPort: 2113
Expand Down
2 changes: 2 additions & 0 deletions manifests/guestcluster/1.33/pvcsi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ spec:
- "--supervisor-fss-namespace=$(CSI_NAMESPACE)"
- "--fss-name=internal-feature-states.csi.vsphere.vmware.com"
- "--fss-namespace=$(CSI_NAMESPACE)"
- "--enable-profile-server=false"
imagePullPolicy: "IfNotPresent"
ports:
- containerPort: 2112
Expand Down Expand Up @@ -270,6 +271,7 @@ spec:
- "--supervisor-fss-namespace=$(CSI_NAMESPACE)"
- "--fss-name=internal-feature-states.csi.vsphere.vmware.com"
- "--fss-namespace=$(CSI_NAMESPACE)"
- "--enable-profile-server=false"
imagePullPolicy: "IfNotPresent"
ports:
- containerPort: 2113
Expand Down
3 changes: 3 additions & 0 deletions manifests/supervisorcluster/1.29/cns-csi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,8 @@ spec:
name: socket-dir
- name: vsphere-csi-controller
image: localhost:5000/vmware/vsphere-csi:<vsphere_csi_ver>
args:
- "--enable-profile-server=false"
ports:
- containerPort: 2112
name: prometheus
Expand Down Expand Up @@ -446,6 +448,7 @@ spec:
- "--leader-election-retry-period=30s"
- "--storagequota-sync-interval=10m"
- "--webhook-client-cert-verification"
- "--enable-profile-server=false"
env:
- name: CLUSTER_FLAVOR
value: "WORKLOAD"
Expand Down
3 changes: 3 additions & 0 deletions manifests/supervisorcluster/1.30/cns-csi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,8 @@ spec:
name: socket-dir
- name: vsphere-csi-controller
image: localhost:5000/vmware/vsphere-csi:<vsphere_csi_ver>
args:
- "--enable-profile-server=false"
ports:
- containerPort: 2112
name: prometheus
Expand Down Expand Up @@ -453,6 +455,7 @@ spec:
- "--leader-election-retry-period=30s"
- "--storagequota-sync-interval=10m"
- "--webhook-client-cert-verification"
- "--enable-profile-server=false"
env:
- name: CLUSTER_FLAVOR
value: "WORKLOAD"
Expand Down
3 changes: 3 additions & 0 deletions manifests/supervisorcluster/1.31/cns-csi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,8 @@ spec:
name: socket-dir
- name: vsphere-csi-controller
image: localhost:5000/vmware/vsphere-csi:<vsphere_csi_ver>
args:
- "--enable-profile-server=false"
ports:
- containerPort: 2112
name: prometheus
Expand Down Expand Up @@ -453,6 +455,7 @@ spec:
- "--leader-election-retry-period=30s"
- "--storagequota-sync-interval=10m"
- "--webhook-client-cert-verification"
- "--enable-profile-server=false"
env:
- name: CLUSTER_FLAVOR
value: "WORKLOAD"
Expand Down
2 changes: 2 additions & 0 deletions manifests/vanilla/vsphere-csi-driver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ spec:
args:
- "--fss-name=internal-feature-states.csi.vsphere.vmware.com"
- "--fss-namespace=$(CSI_NAMESPACE)"
- "--enable-profile-server=false"
imagePullPolicy: "Always"
env:
- name: CSI_ENDPOINT
Expand Down Expand Up @@ -346,6 +347,7 @@ spec:
- "--leader-election-retry-period=10s"
- "--fss-name=internal-feature-states.csi.vsphere.vmware.com"
- "--fss-namespace=$(CSI_NAMESPACE)"
- "--enable-profile-server=false"
imagePullPolicy: "Always"
ports:
- containerPort: 2113
Expand Down