Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
k8s-ingress
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
3
Merge Requests
3
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
uplex-varnish
k8s-ingress
Commits
9598c469
Commit
9598c469
authored
Jun 03, 2020
by
Lars Fenneberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Helm charts: Add option for using a StatefulSet with persistent storage
parent
3d7908ac
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
21 deletions
+40
-21
_helpers.tpl
charts/viking-service/templates/_helpers.tpl
+0
-10
deployment.yaml
charts/viking-service/templates/deployment.yaml
+27
-7
values.yaml
charts/viking-service/values.yaml
+13
-4
No files found.
charts/viking-service/templates/_helpers.tpl
View file @
9598c469
...
...
@@ -45,14 +45,4 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
{{- end -}}
{{- end -}}
{
{
/*
Return
the
appropriate
apiVersion
for
deployment
.
*/
}
}
{{- define "deployment.apiVersion" -}}
{{- if semverCompare ">=1.9-0" .Capabilities.KubeVersion.GitVersion -}}
{{- print "apps/v1" -}}
{{- else -}}
{{- print "extensions/v1beta1" -}}
{{- end -}}
{{- end -}}
charts/viking-service/templates/deployment.yaml
View file @
9598c469
apiVersion
:
{{
template "deployment.apiVersion" .
}}
kind
:
Deployment
apiVersion
:
apps/v1
kind
:
{{
.Values.vikingService.kind
}}
metadata
:
labels
:
app.kubernetes.io/name
:
{{
template "viking-service.name" .
}}
...
...
@@ -14,17 +14,33 @@ metadata:
{{
toYaml .Values.vikingService.annotations | nindent 4
}}
{{
- end
}}
spec
:
{{
/* Try to collect kind specific differences here */
}}
{{
- if eq .Values.vikingService.kind "Deployment"
}}
minReadySeconds
:
{{
.Values.vikingService.minReadySeconds
}}
{{
- else
}}
serviceName
:
{{
template "viking-service.fullname" .
}}
{{
- if .Values.vikingService.persistentVolume.enabled
}}
volumeClaimTemplates
:
-
metadata
:
name
:
persistent-storage
spec
:
accessModes
:
[
"
ReadWriteOnce"
]
storageClassName
:
{{
.Values.vikingService.persistentVolume.storageClass | quote
}}
resources
:
requests
:
storage
:
{{
.Values.vikingService.persistentVolume.size
}}
{{
- end
}}
{{
- end
}}
selector
:
matchLabels
:
app.kubernetes.io/name
:
{{
template "viking-service.name" .
}}
app.kubernetes.io/instance
:
{{
.Release.Name
}}
{{
- if .Values.vikingService.updateStrategy
}}
strategy
:
{{
- toYaml .Values.vikingService.updateStrategy | nindent 4
}}
{{
- end
}}
replicas
:
{{
.Values.vikingService.replicaCount
}}
revisionHistoryLimit
:
{{
.Values.revisionHistoryLimit
}}
{{
- if .Values.vikingService.updateStrategy
}}
strategy
:
{{
toYaml .Values.vikingService.updateStrategy | nindent 4
}}
{{
- end
}}
minReadySeconds
:
{{
.Values.vikingService.minReadySeconds
}}
template
:
metadata
:
{{
- if .Values.vikingService.podAnnotations
}}
...
...
@@ -105,6 +121,10 @@ spec:
mountPath
:
"
/run/varnish-home"
-
name
:
run-offload
mountPath
:
"
/run/offload"
{{
- if (and (eq .Values.vikingService.kind "StatefulSet") .Values.vikingService.persistentVolume.enabled)
}}
-
name
:
persistent-storage
mountPath
:
"
/run/varnish-home/persistent-storage"
{{
- end
}}
securityContext
:
readOnlyRootFilesystem
:
true
resources
:
...
...
charts/viking-service/values.yaml
View file @
9598c469
...
...
@@ -21,6 +21,19 @@ vikingService:
resources
:
{}
# Choose from Deployment or StatefulSet
kind
:
Deployment
# Only applicable if kind is StatefulSet
persistentVolume
:
enabled
:
false
storageClass
:
null
size
:
1Gi
# Only applicable if kind is Deployment
# minReadySeconds to avoid killing pods before we are ready
minReadySeconds
:
0
secrets
:
admin
:
"
21d0ac6c-83d5-11ea-8acc-1ff3820da75e"
dataplaneapi
:
"
e24bb312-cb21-46d6-aaec-8ae676f06fea"
...
...
@@ -62,10 +75,6 @@ vikingService:
# maxUnavailable: 1
# type: RollingUpdate
# minReadySeconds to avoid killing pods before we are ready
##
minReadySeconds
:
0
## Node tolerations for server scheduling to nodes with taints
## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
##
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment