Skip to content

Commit

Permalink
Update stack helm chart after review on PR #72
Browse files Browse the repository at this point in the history
  • Loading branch information
pmorillon committed Dec 7, 2023
1 parent 90c539d commit 888654b
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{{- if and .Values.stack.hook.enabled .Values.stack.hook.persistence.enabled -}}
{{- $result = true -}}
{{- if and .Values.stack.hook.persistence.enabled (eq .Values.stack.hook.persistence.type "pvc") }}
{{- range .Values.stack.hook.persistence.accessModes }}
{{- range .Values.stack.hook.persistence.pvc.accessModes }}
{{- if eq . "ReadWriteOnce" }}
{{- $result = false}}
{{- end }}
Expand Down
4 changes: 2 additions & 2 deletions tinkerbell/stack/templates/hook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ spec:
type: DirectoryOrCreate
{{- else if eq .Values.stack.hook.persistence.type "pvc" }}
persistentVolumeClaim:
claimName: {{ .Values.stack.hook.persistence.existingClaim | default "hook-artifacts" }}
claimName: {{ .Values.stack.hook.persistence.pvc.existingClaim | default "hook-artifacts" }}
{{- else }}
{{- fail "value for .Values.stack.hook.persistence.type is not as expected" }}
{{- fail "value for .Values.stack.hook.persistence.type is unsupported" }}
{{- end }}
{{- else }}
emptyDir: {}
Expand Down
2 changes: 1 addition & 1 deletion tinkerbell/stack/templates/nginx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ spec:
type: DirectoryOrCreate
{{- else if eq .Values.stack.hook.persistence.type "pvc" }}
persistentVolumeClaim:
claimName: {{ .Values.stack.hook.persistence.existingClaim | default "hook-artifacts" }}
claimName: {{ .Values.stack.hook.persistence.pvc.existingClaim | default "hook-artifacts" }}
{{- else }}
{{- fail "value for .Values.stack.hook.persistence.type is not as expected" }}
{{- end }}
Expand Down
19 changes: 9 additions & 10 deletions tinkerbell/stack/templates/nginx_persistentvolumeclaim.yaml
Original file line number Diff line number Diff line change
@@ -1,30 +1,29 @@
{{- if and .Values.stack.hook.enabled .Values.stack.hook.persistence.enabled (not .Values.stack.hook.persistence.existingClaim) (eq .Values.stack.hook.persistence.type "pvc") }}
{{- if and .Values.stack.hook.enabled .Values.stack.hook.persistence.enabled (not .Values.stack.hook.persistence.pvc.existingClaim) (eq .Values.stack.hook.persistence.type "pvc") }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: hook-artifacts
labels:
{{- with .Values.stack.hook.persistence.extraPvcLabels }}
{{- with .Values.stack.hook.persistence.pvc.extraLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.stack.hook.persistence.annotations }}
{{- with .Values.stack.hook.persistence.pvc.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
accessModes:
{{- range .Values.stack.hook.persistence.accessModes }}
{{- range .Values.stack.hook.persistence.pvc.accessModes }}
- {{ . | quote }}
{{- end }}
resources:
requests:
storage: {{ .Values.stack.hook.persistence.size | quote }}
{{- with .Values.stack.hook.persistence.storageClassName }}
storage: {{ .Values.stack.hook.persistence.pvc.size | quote }}
{{- with .Values.stack.hook.persistence.pvc.storageClassName }}
storageClassName: {{ . }}
{{- end }}
{{- with .Values.stack.hook.persistence.selectorLabels }}
selector:
matchLabels:
{{- toYaml . | nindent 6 }}
{{- with .Values.stack.hook.persistence.pvc.selector }}
selector:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
40 changes: 27 additions & 13 deletions tinkerbell/stack/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,36 @@ stack:
downloadURL: https://github.com/tinkerbell/hook/releases/download/latest
persistence:
enabled: true
## type hostpath or pvc
# hostpath : only works on a single worker node cluster
# type must be either "hostpath" or "pvc"
# hostpath: only works on a single worker node cluster
# https://kubernetes.io/docs/concepts/storage/volumes/#hostpath
type: hostpath
## When type is pvc

# The PVC storage class to use. Only valid with type=pvc.
# storageClassName: default

## PVC accessModes :
# Require ReadWriteMany in order to download Hook and scale up kubernetes tink-stack Deployment resource.
# If ReadWriteOnce is used, you will need to download manually Hook into stack Pod (/usr/share/nginx/html/).
accessModes:
- ReadWriteMany
size: 1Gi
# annotations: {}
# selectorLabels: {}
# existingClaim:
extraPvcLabels: {}
pvc:
# PVC accessModes :
# If you include only ReadWriteMany access mode it will allow to download Hook artifacts,
# it will also allow to scale up stack deployment on multinode cluster.
# If ReadWriteOnce is included, you will need to download manually Hook artifacts into
# stack Pod (/usr/share/nginx/html/).
# https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes
accessModes:
- ReadWriteMany
size: 1Gi
# Annotations to include on the PVC object.
annotations: {}

# An optional selector to narrow the Volumes considered for binding to the PVC.
# Should be structured the same as a raw PVC selector (see documentation for more info).
#
# https://kubernetes.io/docs/concepts/storage/persistent-volumes/#selector.
selector: {}

# existingClaim:
extraLabels: {}

kubevip:
enabled: true
name: kube-vip
Expand Down

0 comments on commit 888654b

Please sign in to comment.