Skip to content
Snippets Groups Projects
Commit eb686d9d authored by Sung-Kyu Yoo's avatar Sung-Kyu Yoo Committed by Derek Su
Browse files

Added provision/delete retry count options

parent 7353f083
Branches
Tags
No related merge requests found
...@@ -51,6 +51,14 @@ spec: ...@@ -51,6 +51,14 @@ spec:
- --worker-threads - --worker-threads
- {{ .Values.workerThreads }} - {{ .Values.workerThreads }}
{{- end }} {{- end }}
{{- if .Values.provisioningRetryCount }}
- --provisioning-retry-count
- {{ .Values.provisioningRetryCount }}
{{- end }}
{{- if .Values.deletionRetryCount }}
- --deletion-retry-count
- {{ .Values.deletionRetryCount }}
{{- end }}
volumeMounts: volumeMounts:
- name: config-volume - name: config-volume
mountPath: /etc/config/ mountPath: /etc/config/
......
...@@ -140,4 +140,10 @@ configmap: ...@@ -140,4 +140,10 @@ configmap:
imagePullPolicy: IfNotPresent imagePullPolicy: IfNotPresent
# Number of provisioner worker threads to call provision/delete simultaneously. # Number of provisioner worker threads to call provision/delete simultaneously.
workerThreads: 4 # workerThreads: 4
# Number of retries of failed volume provisioning. 0 means retry indefinitely.
# provisioningRetryCount: 15
# Number of retries of failed volume deletion. 0 means retry indefinitely.
# deletionRetryCount: 15
...@@ -40,7 +40,11 @@ var ( ...@@ -40,7 +40,11 @@ var (
FlagHelperPodFile = "helper-pod-file" FlagHelperPodFile = "helper-pod-file"
DefaultHelperPodFile = "helperPod.yaml" DefaultHelperPodFile = "helperPod.yaml"
FlagWorkerThreads = "worker-threads" FlagWorkerThreads = "worker-threads"
DefaultWorkerThreads = 4 DefaultWorkerThreads = pvController.DefaultThreadiness
FlagProvisioningRetryCount = "provisioning-retry-count"
DefaultProvisioningRetryCount = pvController.DefaultFailedProvisionThreshold
FlagDeletionRetryCount = "deletion-retry-count"
DefaultDeletionRetryCount = pvController.DefaultFailedDeleteThreshold
) )
func cmdNotFound(c *cli.Context, command string) { func cmdNotFound(c *cli.Context, command string) {
...@@ -114,6 +118,16 @@ func StartCmd() cli.Command { ...@@ -114,6 +118,16 @@ func StartCmd() cli.Command {
Usage: "Number of provisioner worker threads.", Usage: "Number of provisioner worker threads.",
Value: DefaultWorkerThreads, Value: DefaultWorkerThreads,
}, },
cli.IntFlag{
Name: FlagProvisioningRetryCount,
Usage: "Number of retries of failed volume provisioning. 0 means retry indefinitely.",
Value: DefaultProvisioningRetryCount,
},
cli.IntFlag{
Name: FlagDeletionRetryCount,
Usage: "Number of retries of failed volume deletion. 0 means retry indefinitely.",
Value: DefaultDeletionRetryCount,
},
}, },
Action: func(c *cli.Context) { Action: func(c *cli.Context) {
if err := startDaemon(c); err != nil { if err := startDaemon(c); err != nil {
...@@ -239,8 +253,8 @@ func startDaemon(c *cli.Context) error { ...@@ -239,8 +253,8 @@ func startDaemon(c *cli.Context) error {
provisioner, provisioner,
serverVersion.GitVersion, serverVersion.GitVersion,
pvController.LeaderElection(false), pvController.LeaderElection(false),
pvController.FailedProvisionThreshold(0), pvController.FailedProvisionThreshold(c.Int(FlagProvisioningRetryCount)),
pvController.FailedDeleteThreshold(0), pvController.FailedDeleteThreshold(c.Int(FlagDeletionRetryCount)),
pvController.Threadiness(c.Int(FlagWorkerThreads)), pvController.Threadiness(c.Int(FlagWorkerThreads)),
) )
logrus.Debug("Provisioner started") logrus.Debug("Provisioner started")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment