Skip to content

Commit

Permalink
make pod termination grace period configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
mkabilov committed Aug 18, 2017
1 parent c557027 commit 71dfb33
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions manifests/configmap.yaml
Expand Up @@ -31,3 +31,4 @@ data:
enable_load_balancer: "true"
api_port: "8080"
ring_log_lines: "100"
pod_terminate_grace_period: 5m
2 changes: 1 addition & 1 deletion pkg/cluster/k8sres.go
Expand Up @@ -303,7 +303,7 @@ func (c *Cluster) generatePodTemplate(resourceRequirements *v1.ResourceRequireme
Privileged: &privilegedMode,
},
}
terminateGracePeriodSeconds := int64(30)
terminateGracePeriodSeconds := int64(c.OpConfig.PodTerminateGracePeriod.Seconds())

podSpec := v1.PodSpec{
ServiceAccountName: c.OpConfig.ServiceAccountName,
Expand Down
2 changes: 2 additions & 0 deletions pkg/util/config/config.go
Expand Up @@ -63,6 +63,8 @@ type Config struct {
Workers uint32 `name:"workers" default:"4"`
APIPort int `name:"api_port" default:"8080"`
RingLogLines int `name:"ring_log_lines" default:"100"`

PodTerminateGracePeriod time.Duration `name:"pod_terminate_grace_period" default:"5m"`
}

// MustMarshal marshals the config or panics
Expand Down

0 comments on commit 71dfb33

Please sign in to comment.