Skip to content

Commit

Permalink
removed unused values since the merge into a single container (#1476)
Browse files Browse the repository at this point in the history
* removed unused values since the merge into a single container

* removed enableHA

* removed enableHA from k0s

* fix

* removed enableHA

* removed references to enableHA
  • Loading branch information
facchettos authored Jan 30, 2024
1 parent 1f32779 commit 2d90c93
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 51 deletions.
2 changes: 1 addition & 1 deletion charts/eks/templates/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ rules:
resources: ["endpoints"]
verbs: ["create", "delete", "patch", "update"]
{{- end }}
{{- if or .Values.enableHA .Values.rbac.role.extended }}
{{- if or (gt (int .Values.syncer.replicas) 1) .Values.rbac.role.extended }}
- apiGroups: ["coordination.k8s.io"]
resources: ["leases"]
verbs: ["create", "delete", "patch", "update", "get", "list", "watch"]
Expand Down
6 changes: 3 additions & 3 deletions charts/eks/templates/syncer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ spec:
{{- if .Values.syncer.affinity }}
affinity:
{{ toYaml .Values.syncer.affinity | indent 8 }}
{{- else if .Values.enableHA }}
{{- else if (gt (int .Values.syncer.replicas) 1) }}
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
Expand Down Expand Up @@ -227,7 +227,7 @@ spec:
- --etcd-replicas={{ .Values.syncer.replicas }}
{{- end }}
{{- end }}
{{- if .Values.enableHA }}
{{- if (gt (int .Values.syncer.replicas) 1) }}
- --leader-elect=true
{{- else }}
- --leader-elect=false
Expand Down Expand Up @@ -386,7 +386,7 @@ spec:
- '--node-monitor-period=1h'
- '--horizontal-pod-autoscaler-sync-period=60s'
- '--kubeconfig=/pki/controller-manager.conf'
{{- if .Values.enableHA }}
{{- if (gt (int .Values.syncer.replicas) 1) }}
- '--leader-elect=true'
{{- else }}
- '--leader-elect=false'
Expand Down
2 changes: 1 addition & 1 deletion charts/k0s/templates/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ rules:
resources: ["endpoints"]
verbs: ["create", "delete", "patch", "update"]
{{- end }}
{{- if or .Values.enableHA .Values.rbac.role.extended }}
{{- if or ( gt (int (include "vcluster.replicas" . ) ) 1) .Values.rbac.role.extended }}
- apiGroups: ["coordination.k8s.io"]
resources: ["leases"]
verbs: ["create", "delete", "patch", "update", "get", "list", "watch"]
Expand Down
2 changes: 1 addition & 1 deletion charts/k8s/templates/etcd-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ spec:
{{- if .Values.etcd.affinity }}
affinity:
{{ toYaml .Values.etcd.affinity | indent 8 }}
{{- else if .Values.enableHA }}
{{- else }}
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
Expand Down
2 changes: 1 addition & 1 deletion charts/k8s/templates/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ rules:
resources: ["endpoints"]
verbs: ["create", "delete", "patch", "update"]
{{- end }}
{{- if or .Values.enableHA .Values.rbac.role.extended }}
{{- if or (gt (int .Values.syncer.replicas) 1) .Values.rbac.role.extended }}
- apiGroups: ["coordination.k8s.io"]
resources: ["leases"]
verbs: ["create", "delete", "patch", "update", "get", "list", "watch"]
Expand Down
8 changes: 4 additions & 4 deletions charts/k8s/templates/syncer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ spec:
{{- if .Values.syncer.affinity }}
affinity:
{{ toYaml .Values.syncer.affinity | indent 8 }}
{{- else if .Values.enableHA }}
{{- else if (gt (int .Values.syncer.replicas) 1) }}
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
Expand Down Expand Up @@ -244,7 +244,7 @@ spec:
- --etcd-replicas={{ .Values.syncer.replicas }}
{{- end }}
{{- end }}
{{- if .Values.enableHA }}
{{- if (gt (int .Values.syncer.replicas) 1)}}
- --leader-elect=true
{{- else }}
- --leader-elect=false
Expand Down Expand Up @@ -407,7 +407,7 @@ spec:
{{- end }}
- '--horizontal-pod-autoscaler-sync-period=60s'
- '--kubeconfig=/pki/controller-manager.conf'
{{- if .Values.enableHA }}
{{- if (gt (int .Values.syncer.replicas) 1) }}
- '--leader-elect=true'
{{- else }}
- '--leader-elect=false'
Expand All @@ -432,7 +432,7 @@ spec:
- '--authorization-kubeconfig=/pki/scheduler.conf'
- '--bind-address=127.0.0.1'
- '--kubeconfig=/pki/scheduler.conf'
{{- if .Values.enableHA }}
{{- if (gt (int .Values.syncer.replicas) 1) }}
- '--leader-elect=true'
{{- else }}
- '--leader-elect=false'
Expand Down
21 changes: 5 additions & 16 deletions docs/pages/deploying-vclusters/high-availability.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,15 @@ A distro in vcluster is the Kubernetes distribution that runs inside the virtual
- k8s (a Kubernetes with etcd)
The vcluster HA feature is only supported by the k3s and k8s distros. You need to choose one of those to take advantage of HA.

For this tutorial, we will use the k8s distro.
If you're interested in enabling HA in rootless mode, or using the k3s distro, see some examples at the bottom of this page.
For this tutorial, we will use the k8s distro.
If you're interested in enabling HA in rootless mode, or using the k3s distro, see some examples at the bottom of this page.

# 3. Create a values.yaml file
The values.yaml file is used to specify configuration options for the virtual cluster. In the case of the HA feature, we will specify the number of replicas we want to run for each vCluster component.

Create the file called values.yaml on the computer that the vcluster client is installed on with these contents:

```
# Enable HA mode
enableHA: true
# Scale up syncer replicas
syncer:
replicas: 3
Expand Down Expand Up @@ -68,7 +65,7 @@ NAME STATUS ROLES AGE VERSION
minikube Ready control-plane 2m5s v1.26.3
minikube-m02 Ready <none> 105s v1.26.3
minikube-m03 Ready <none> 93s v1.26.3
minikube-m04 Ready <none> 83s v1.26.3
minikube-m04 Ready <none> 83s v1.26.3
```

# 4. Create the HA virtual cluster
Expand Down Expand Up @@ -174,11 +171,9 @@ In order to run vCluster with k3s as Kubernetes distribution in high availabilit
First create a `values.yaml` in the following form and make sure to change the connection string in `K3S_DATASTORE_ENDPOINT`:

```
# Enable HA mode
enableHA: true
# Scale up k3s replicas
replicas: 2
syncer:
replicas: 2
# Set external datastore endpoint
vcluster:
Expand Down Expand Up @@ -232,9 +227,6 @@ Check the [GitHub repository](https://github.com/loft-sh/vcluster/tree/main/char
In order to run vCluster in high availability mode, create a `values.yaml` in the following form:

```
# Enable HA mode
enableHA: true
# Scale up syncer replicas
syncer:
replicas: 3
Expand Down Expand Up @@ -298,9 +290,6 @@ You can find more about rootless mode [here](../security/rootless-mode.mdx).

Below is HA configuration for running rootless vCluster with vanilla Kubernetes distribution.
```
# Enable HA mode
enableHA: true
# Scale up syncer replicas
syncer:
replicas: 3
Expand Down
7 changes: 2 additions & 5 deletions docs/pages/fragments/high-availability-k3s.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,8 @@ In order to run vCluster with k3s as Kubernetes distribution in high availabilit
First create a `values.yaml` in the following form and make sure to change the connection string in `K3S_DATASTORE_ENDPOINT`:

```
# Enable HA mode
enableHA: true
# Scale up k3s replicas
replicas: 2
syncer:
replicas: 3
# Set external datastore endpoint
vcluster:
Expand Down
6 changes: 0 additions & 6 deletions docs/pages/fragments/high-availability-k8s.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
In order to run vCluster in high availability mode, create a `values.yaml` in the following form:

```
# Enable HA mode
enableHA: true
# Scale up syncer replicas
syncer:
replicas: 3
Expand Down Expand Up @@ -69,9 +66,6 @@ You can find more about rootless mode [here](../security/rootless-mode.mdx).

Below is HA configuration for running rootless vCluster with vanilla Kubernetes distribution.
```
# Enable HA mode
enableHA: true
# Scale up syncer replicas
syncer:
replicas: 3
Expand Down
4 changes: 0 additions & 4 deletions load-test/ha-k8s.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@

# Enable HA mode
enableHA: true

# Scale up syncer replicas
syncer:
replicas: 3
Expand Down
3 changes: 0 additions & 3 deletions load-test/vcluster-k8s-3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ sync:
# will sync all nodes instead of only the ones where some pods are running.
syncAllNodes: true

# Enable HA mode
enableHA: true

# Scale up syncer replicas
syncer:
replicas: 3
Expand Down
6 changes: 0 additions & 6 deletions test/values_ha.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
# this is for k3s pro
replicas: 3


# this is for k8s
#
# Enable HA mode
enableHA: true

# Scale up syncer replicas
syncer:
replicas: 3
Expand Down

0 comments on commit 2d90c93

Please sign in to comment.