Skip to content

Commit

Permalink
moved replicas for k0s
Browse files Browse the repository at this point in the history
  • Loading branch information
facchettos committed Jan 26, 2024
1 parent b51fe22 commit bdc9a57
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
7 changes: 7 additions & 0 deletions charts/k0s/templates/_migrate.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{{/*
handles both replicas and syncer.replicas
*/}}
{{- define "vcluster.replicas" -}}
{{ if .Values.replicas }}{{ .Values.replicas }}{{ else }}{{ .Values.syncer.replicas }}{{ end }}
{{- end }}

4 changes: 2 additions & 2 deletions charts/k0s/templates/syncer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ spec:
whenDeleted: Delete
{{- end }}
{{- end }}
replicas: {{ .Values.replicas }}
replicas: {{ include "vcluster.replicas" . }}
selector:
matchLabels:
app: vcluster
Expand Down Expand Up @@ -251,7 +251,7 @@ spec:
{{- include "vcluster.plugins.config" . | indent 10 }}
- name: VCLUSTER_DISTRO
value: k0s
{{- if eq (.Values.replicas | toString | atoi) 1 }}
{{- if eq ( ( include "vcluster.replicas" . ) | toString | atoi) 1 }}
- name: VCLUSTER_NODE_NAME
valueFrom:
fieldRef:
Expand Down
4 changes: 1 addition & 3 deletions charts/k0s/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ proxy:

# Syncer configuration
syncer:
replicas: 1
# Image to use for the syncer
# image: ghcr.io/loft-sh/vcluster
imagePullPolicy: ""
Expand Down Expand Up @@ -227,9 +228,6 @@ rbac:
excludedApiResources:
# - pods/exec

# The amount of replicas to run the statefulset with
replicas: 1

# If vCluster persistent volume claims should get deleted automatically.
autoDeletePersistentVolumeClaims: true

Expand Down

0 comments on commit bdc9a57

Please sign in to comment.