csi: make GRPC timeout configurable
setting the GRPC timeout configurable helps
in some cases where ceph cluster takes more time
to respond.
Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
(cherry picked from commit 54de442e22)
This commit is contained in:
1 parent
85d00546d0
commit
b85c79f9df
9 files changed
+37
-10
No files matched your search
@@ -79,6 +79,7 @@ The following tables lists the configurable parameters of the rook-operator char
|
||||
| `csi.cephFSFSGroupPolicy` | Policy for modifying a volume's ownership or permissions when the CephFS PVC is being mounted | ReadWriteOnceWithFSType |
|
||||
| `csi.nfsFSGroupPolicy` | Policy for modifying a volume's ownership or permissions when the NFS PVC is being mounted | ReadWriteOnceWithFSType |
|
||||
| `csi.logLevel` | Set logging level for csi containers. Supported values from 0 to 5. 0 for general useful logs, 5 for trace level verbosity. | `0` |
|
||||
| `csi.grpcTimeoutInSeconds` | Set GRPC timeout for csi containers. | `150` |
|
||||
| `csi.provisionerReplicas` | Set replicas for csi provisioner deployment. | `2` |
|
||||
| `csi.enableGrpcMetrics` | Enable Ceph CSI GRPC Metrics. | `false` |
|
||||
| `csi.enableCSIHostNetwork` | Enable Host Networking for Ceph CSI nodeplugins. | `false` |
|
||||
|
||||
@@ -172,6 +172,9 @@ data:
|
||||
{{- if .Values.csi.logLevel }}
|
||||
CSI_LOG_LEVEL: {{ .Values.csi.logLevel | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.csi.grpcTimeoutInSeconds }}
|
||||
CSI_GRPC_TIMEOUT_SECONDS: {{ .Values.csi.grpcTimeoutInSeconds | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.csi.provisionerReplicas }}
|
||||
CSI_PROVISIONER_REPLICAS: {{ .Values.csi.provisionerReplicas | quote }}
|
||||
{{- end }}
|
||||
|
||||
@@ -110,6 +110,8 @@ csi:
|
||||
# CSI NFS plugin daemonset update strategy, supported values are OnDelete and RollingUpdate.
|
||||
# Default value is RollingUpdate.
|
||||
#nfsPluginUpdateStrategy: OnDelete
|
||||
# The CSI GRPC timeout value (in seconds). It should be >= 120. If this variable is not set or is an invalid value, it's default to 150.
|
||||
grpcTimeoutInSeconds: 150
|
||||
|
||||
# Allow starting unsupported ceph-csi image
|
||||
allowUnsupportedVersion: false
|
||||
|
||||
@@ -494,6 +494,8 @@ data:
|
||||
# Enable the csi addons sidecar.
|
||||
CSI_ENABLE_CSIADDONS: "false"
|
||||
# ROOK_CSIADDONS_IMAGE: "quay.io/csiaddons/k8s-sidecar:v0.2.1"
|
||||
# The GCSI RPC timeout value (in seconds). It should be >= 120. If this variable is not set or is an invalid value, it's default to 150.
|
||||
CSI_GRPC_TIMEOUT_SECONDS: "150"
|
||||
---
|
||||
# The deployment for the rook operator
|
||||
# OLM: BEGIN OPERATOR DEPLOYMENT
|
||||
|
||||
@@ -416,6 +416,8 @@ data:
|
||||
# Enable the csi addons sidecar.
|
||||
CSI_ENABLE_CSIADDONS: "false"
|
||||
# ROOK_CSIADDONS_IMAGE: "quay.io/csiaddons/k8s-sidecar:v0.2.1"
|
||||
# The CSI GRPC timeout value (in seconds). It should be >= 120. If this variable is not set or is an invalid value, it's default to 150.
|
||||
CSI_GRPC_TIMEOUT_SECONDS: "150"
|
||||
---
|
||||
# OLM: BEGIN OPERATOR DEPLOYMENT
|
||||
apiVersion: apps/v1
|
||||
|
||||
@@ -54,6 +54,7 @@ type Param struct {
|
||||
ProvisionerPriorityClassName string
|
||||
VolumeReplicationImage string
|
||||
CSIAddonsImage string
|
||||
GRPCTimeout time.Duration
|
||||
EnablePluginSelinuxHostMount bool
|
||||
EnableCSIHostNetwork bool
|
||||
EnableOMAPGenerator bool
|
||||
@@ -197,6 +198,9 @@ const (
|
||||
// default log level for csi containers
|
||||
defaultLogLevel uint8 = 0
|
||||
|
||||
// GRPC timeout.
|
||||
defaultGRPCTimeout = 150
|
||||
grpcTimeout = "CSI_GRPC_TIMEOUT_SECONDS"
|
||||
// default provisioner replicas
|
||||
defaultProvisionerReplicas int32 = 2
|
||||
|
||||
@@ -286,6 +290,19 @@ func (r *ReconcileCSI) startDrivers(ver *version.Info, ownerInfo *k8sutil.OwnerI
|
||||
tp.ForceCephFSKernelClient = "true"
|
||||
}
|
||||
|
||||
// parese RPC timeout
|
||||
timeout := k8sutil.GetValue(r.opConfig.Parameters, grpcTimeout, "150")
|
||||
timeoutSeconds, err := strconv.Atoi(timeout)
|
||||
if err != nil {
|
||||
logger.Errorf("failed to parse %q. Defaulting to %d. %v", grpcTimeout, defaultGRPCTimeout, err)
|
||||
timeoutSeconds = defaultGRPCTimeout
|
||||
}
|
||||
if timeoutSeconds < 120 {
|
||||
logger.Warningf("%s is %q but it should be >= 120, setting the default value %d", grpcTimeout, timeout, defaultGRPCTimeout)
|
||||
timeoutSeconds = defaultGRPCTimeout
|
||||
}
|
||||
tp.GRPCTimeout = time.Duration(timeoutSeconds) * time.Second
|
||||
|
||||
// parse GRPC and Liveness ports
|
||||
tp.CephFSGRPCMetricsPort, err = getPortFromConfig(r.opConfig.Parameters, "CSI_CEPHFS_GRPC_METRICS_PORT", DefaultCephFSGRPCMerticsPort)
|
||||
if err != nil {
|
||||
|
||||
@@ -28,7 +28,7 @@ spec:
|
||||
- "--v={{ .LogLevel }}"
|
||||
- "--csi-address=$(ADDRESS)"
|
||||
- "--leader-election=true"
|
||||
- "--timeout=150s"
|
||||
- "--timeout={{ .GRPCTimeout }}"
|
||||
- "--leader-election-namespace={{ .Namespace }}"
|
||||
env:
|
||||
- name: ADDRESS
|
||||
@@ -43,7 +43,7 @@ spec:
|
||||
args:
|
||||
- "--csi-address=$(ADDRESS)"
|
||||
- "--v={{ .LogLevel }}"
|
||||
- "--timeout=150s"
|
||||
- "--timeout={{ .GRPCTimeout }}"
|
||||
- "--leader-election=true"
|
||||
- "--leader-election-namespace={{ .Namespace }}"
|
||||
env:
|
||||
@@ -59,7 +59,7 @@ spec:
|
||||
args:
|
||||
- "--csi-address=$(ADDRESS)"
|
||||
- "--v={{ .LogLevel }}"
|
||||
- "--timeout=150s"
|
||||
- "--timeout={{ .GRPCTimeout }}"
|
||||
- "--leader-election"
|
||||
- "--leader-election-namespace={{ .Namespace }}"
|
||||
- "--handle-volume-inuse-error=false"
|
||||
@@ -75,7 +75,7 @@ spec:
|
||||
args:
|
||||
- "--csi-address=$(ADDRESS)"
|
||||
- "--v={{ .LogLevel }}"
|
||||
- "--timeout=150s"
|
||||
- "--timeout={{ .GRPCTimeout }}"
|
||||
- "--retry-interval-start=500ms"
|
||||
- "--leader-election=true"
|
||||
- "--leader-election-namespace={{ .Namespace }}"
|
||||
|
||||
@@ -26,7 +26,7 @@ spec:
|
||||
args:
|
||||
- "--csi-address=$(ADDRESS)"
|
||||
- "--v={{ .LogLevel }}"
|
||||
- "--timeout=150s"
|
||||
- "--timeout={{ .GRPCTimeout }}"
|
||||
- "--retry-interval-start=500ms"
|
||||
- "--leader-election=true"
|
||||
- "--leader-election-namespace={{ .Namespace }}"
|
||||
|
||||
@@ -27,7 +27,7 @@ spec:
|
||||
args:
|
||||
- "--csi-address=$(ADDRESS)"
|
||||
- "--v={{ .LogLevel }}"
|
||||
- "--timeout=150s"
|
||||
- "--timeout={{ .GRPCTimeout }}"
|
||||
- "--retry-interval-start=500ms"
|
||||
- "--leader-election=true"
|
||||
- "--leader-election-namespace={{ .Namespace }}"
|
||||
@@ -45,7 +45,7 @@ spec:
|
||||
args:
|
||||
- "--csi-address=$(ADDRESS)"
|
||||
- "--v={{ .LogLevel }}"
|
||||
- "--timeout=150s"
|
||||
- "--timeout={{ .GRPCTimeout }}"
|
||||
- "--leader-election"
|
||||
- "--leader-election-namespace={{ .Namespace }}"
|
||||
- "--handle-volume-inuse-error=false"
|
||||
@@ -60,7 +60,7 @@ spec:
|
||||
image: {{ .AttacherImage }}
|
||||
args:
|
||||
- "--v={{ .LogLevel }}"
|
||||
- "--timeout=150s"
|
||||
- "--timeout={{ .GRPCTimeout }}"
|
||||
- "--csi-address=$(ADDRESS)"
|
||||
- "--leader-election=true"
|
||||
- "--leader-election-namespace={{ .Namespace }}"
|
||||
@@ -77,7 +77,7 @@ spec:
|
||||
args:
|
||||
- "--csi-address=$(ADDRESS)"
|
||||
- "--v={{ .LogLevel }}"
|
||||
- "--timeout=150s"
|
||||
- "--timeout={{ .GRPCTimeout }}"
|
||||
- "--leader-election=true"
|
||||
- "--leader-election-namespace={{ .Namespace }}"
|
||||
env:
|
||||
@@ -116,7 +116,7 @@ spec:
|
||||
- "--leader-election-namespace={{ .Namespace }}"
|
||||
- "--driver-name={{ .DriverNamePrefix }}rbd.csi.ceph.com"
|
||||
- "--csi-address=$(ADDRESS)"
|
||||
- "--rpc-timeout=150s"
|
||||
- "--rpc-timeout={{ .GRPCTimeout }}"
|
||||
- "--health-probe-bind-address=:9998"
|
||||
- "--leader-elect=true"
|
||||
env:
|
||||
|
||||
Reference in new issue
Block a user