Skip to content
Open
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
2 changes: 2 additions & 0 deletions charts/weka-operator/templates/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,8 @@ spec:
value: "{{ .Values.csi.preventNewWorkloadOnClientContainerNotRunning }}"
- name: CSI_LOG_LEVEL
value: "{{ .Values.csi.logLevel }}"
- name: CSI_SET_OWNERSHIP_ON_DYNAMIC_FILESYSTEMS
value: "{{ .Values.csi.setOwnershipOnDynamicFilesystems }}"
- name: CSI_CONTROLLER_WEKAFS_LIMITS_CPU
value: "{{ .Values.csi.controller.resources.wekafs.limits.cpu }}"
- name: CSI_CONTROLLER_WEKAFS_LIMITS_MEMORY
Expand Down
1 change: 1 addition & 0 deletions charts/weka-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ csi:
registrarImage: "registry.k8s.io/sig-storage/csi-node-driver-registrar:v2.14.0"
preventNewWorkloadOnClientContainerNotRunning: true
logLevel: 5
setOwnershipOnDynamicFilesystems: false
controller:
resources:
wekafs:
Expand Down
2 changes: 2 additions & 0 deletions internal/config/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ type EmbeddedCsiSettings struct {
RegistrarImage string
PreventNewWorkloadOnClientContainerNotRunning bool
LogLevel int
SetOwnershipOnDynamicFilesystems bool
ControllerResources CsiControllerResources
NodeResources CsiNodeResources
}
Expand Down Expand Up @@ -389,6 +390,7 @@ func ConfigureEnv(ctx context.Context) {
Config.Csi.RegistrarImage = env.GetString("CSI_REGISTRAR_IMAGE", "")
Config.Csi.PreventNewWorkloadOnClientContainerNotRunning = getBoolEnvOrDefault("CSI_PREVENT_NEW_WORKLOAD_ON_CLIENT_CONTAINER_NOT_RUNNING", true)
Config.Csi.LogLevel = getIntEnvOrDefault("CSI_LOG_LEVEL", 5)
Config.Csi.SetOwnershipOnDynamicFilesystems = getBoolEnvOrDefault("CSI_SET_OWNERSHIP_ON_DYNAMIC_FILESYSTEMS", false)
Config.Csi.ControllerResources = parseCsiControllerResources()
Config.Csi.NodeResources = parseCsiNodeResources()
Config.SyslogPackage = getEnvOrDefault("SYSLOG_PACKAGE", "auto")
Expand Down
65 changes: 35 additions & 30 deletions internal/controllers/operations/csi/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,22 @@ import (
// CsiControllerHashableSpec represents the fields from CSI Controller Deployment
// that are relevant for determining if an update is needed
type CsiControllerHashableSpec struct {
CsiDriverName string
CsiImage string
CsiAttacherImage string
CsiProvisionerImage string
CsiResizerImage string
CsiSnapshotterImage string
CsiLivenessProbeImage string
Labels *util2.HashableMap
Tolerations []corev1.Toleration
NodeSelector *util2.HashableMap
EnforceTrustedHttps bool
SkipGarbageCollection bool
LogLevel int
PriorityClassName string
WekaContainerName string
CsiDriverName string
CsiImage string
CsiAttacherImage string
CsiProvisionerImage string
CsiResizerImage string
CsiSnapshotterImage string
CsiLivenessProbeImage string
Labels *util2.HashableMap
Tolerations []corev1.Toleration
NodeSelector *util2.HashableMap
EnforceTrustedHttps bool
SkipGarbageCollection bool
SetOwnershipOnDynamicFilesystems bool
LogLevel int
PriorityClassName string
WekaContainerName string
}

// GetCsiControllerDeploymentHash generates a hash for the CSI Controller Deployment
Expand Down Expand Up @@ -68,21 +69,22 @@ func GetCsiControllerDeploymentHash(csiGroupName string, wekaClient *weka.WekaCl
}

spec := CsiControllerHashableSpec{
CsiDriverName: csiDriverName,
CsiImage: config.Config.Csi.WekafsImage,
CsiAttacherImage: config.Config.Csi.AttacherImage,
CsiProvisionerImage: config.Config.Csi.ProvisionerImage,
CsiResizerImage: config.Config.Csi.ResizerImage,
CsiSnapshotterImage: config.Config.Csi.SnapshotterImage,
CsiLivenessProbeImage: config.Config.Csi.LivenessProbeImage,
Labels: labelsHashable,
Tolerations: tolerations,
NodeSelector: nodeSelectorHashable,
EnforceTrustedHttps: enforceTrustedHttps,
SkipGarbageCollection: skipGarbageCollection,
LogLevel: config.Config.Csi.LogLevel,
PriorityClassName: config.Config.PriorityClasses.Targeted,
WekaContainerName: resources.GetWekaClientContainerName(wekaClient),
CsiDriverName: csiDriverName,
CsiImage: config.Config.Csi.WekafsImage,
CsiAttacherImage: config.Config.Csi.AttacherImage,
CsiProvisionerImage: config.Config.Csi.ProvisionerImage,
CsiResizerImage: config.Config.Csi.ResizerImage,
CsiSnapshotterImage: config.Config.Csi.SnapshotterImage,
CsiLivenessProbeImage: config.Config.Csi.LivenessProbeImage,
Labels: labelsHashable,
Tolerations: tolerations,
NodeSelector: nodeSelectorHashable,
EnforceTrustedHttps: enforceTrustedHttps,
SkipGarbageCollection: skipGarbageCollection,
SetOwnershipOnDynamicFilesystems: config.Config.Csi.SetOwnershipOnDynamicFilesystems,
LogLevel: config.Config.Csi.LogLevel,
PriorityClassName: config.Config.PriorityClasses.Targeted,
WekaContainerName: resources.GetWekaClientContainerName(wekaClient),
}

return util2.HashStruct(spec)
Expand Down Expand Up @@ -163,6 +165,9 @@ func NewCsiControllerDeployment(ctx context.Context, csiGroupName string, wekaCl
if skipGarbageCollection {
args = append(args, "--skipgarbagecollection")
}
if config.Config.Csi.SetOwnershipOnDynamicFilesystems {
args = append(args, "--setownershipondynamicfilesystems")
}

tracingFlag := GetTracingFlag()
if tracingFlag != "" {
Expand Down
Loading