Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add configuration for StatefulSet updateStrategy #172

Merged
merged 1 commit into from
Jan 18, 2020
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
Allow configure StatefulSet updateStrategy
  • Loading branch information
lawliet89 committed Jan 13, 2020
commit 3fa47ad2c319b1560b46ed15b5032c40be941009
4 changes: 2 additions & 2 deletions templates/server-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ spec:
podManagementPolicy: Parallel
replicas: {{ template "vault.replicas" . }}
updateStrategy:
type: OnDelete
type: {{ .Values.server.updateStrategyType }}
selector:
matchLabels:
app.kubernetes.io/name: {{ template "vault.name" . }}
Expand Down Expand Up @@ -122,7 +122,7 @@ spec:
{{- end }}
lifecycle:
# Vault container doesn't receive SIGTERM from Kubernetes
# and after the grace period ends, Kube sends SIGKILL. This
# and after the grace period ends, Kube sends SIGKILL. This
# causes issues with graceful shutdowns such as deregistering itself
# from Consul (zombie services).
preStop:
Expand Down
11 changes: 11 additions & 0 deletions test/unit/server-ha-statefulset.bats
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,17 @@ load _helpers
[ "${actual}" = "OnDelete" ]
}

@test "server/ha-StatefulSet: RollingUpdate updateStrategy" {
cd `chart_dir`
local actual=$(helm template \
-x templates/server-statefulset.yaml \
--set 'server.ha.enabled=true' \
--set 'server.updateStrategyType="RollingUpdate"' \
. | tee /dev/stderr |
yq -r '.spec.updateStrategy.type' | tee /dev/stderr)
[ "${actual}" = "RollingUpdate" ]
}

#--------------------------------------------------------------------
# affinity

Expand Down
18 changes: 11 additions & 7 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ injector:
tag: "0.1.2"
pullPolicy: IfNotPresent

# agentImage sets the repo and tag of the Vault image to use for the Vault Agent
# containers. This should be set to the official Vault image. Vault 1.3.1+ is
# agentImage sets the repo and tag of the Vault image to use for the Vault Agent
# containers. This should be set to the official Vault image. Vault 1.3.1+ is
# required.
agentImage:
repository: "vault"
Expand Down Expand Up @@ -76,6 +76,10 @@ server:
# Overrides the default Image Pull Policy
pullPolicy: IfNotPresent

# Configure the Update Strategy Type for the StatefulSet
# See https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#update-strategies
updateStrategyType: "OnDelete"

resources:
# resources:
# requests:
Expand All @@ -85,7 +89,7 @@ server:
# memory: 256Mi
# cpu: 250m

# Ingress allows ingress services to be created to allow external access
# Ingress allows ingress services to be created to allow external access
# from Kubernetes to access Vault pods.
ingress:
enabled: false
Expand All @@ -109,7 +113,7 @@ server:
# method. https://www.vaultproject.io/docs/auth/kubernetes.html
authDelegator:
enabled: true

# extraContainers is a list of sidecar containers. Specified as a raw YAML string.
extraContainers: null

Expand Down Expand Up @@ -192,12 +196,12 @@ server:
# used to communicate with pods directly through DNS instead of a round robin
# load balancer.
# clusterIP: None
# Configures the service type for the main Vault service. Can be ClusterIP

# Configures the service type for the main Vault service. Can be ClusterIP
# or NodePort.
#type: ClusterIP

# If type is set to "NodePort", a specific nodePort value can be configured,
# If type is set to "NodePort", a specific nodePort value can be configured,
# will be random if left blank.
#nodePort: 30000

Expand Down