Skip to content

Commit d1793cc

Browse files
authored
Merge pull request #87 from projectsyn/refactor
Refactor component-vcluster to use helm chart
2 parents 947e943 + e0c14c0 commit d1793cc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1786
-2824
lines changed

class/defaults.yml

Lines changed: 87 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,56 +6,115 @@ parameters:
66
namespace: syn-${_instance}
77
namespaceMetadata: {}
88

9-
host_service_cidr: null
9+
charts:
10+
vcluster:
11+
source: https://charts.loft.sh
12+
version: 0.24.1
1013

1114
images:
1215
k3s:
1316
registry: docker.io
1417
image: rancher/k3s
15-
tag: v1.25.15-k3s1
18+
tag: v1.32.1-k3s1
1619
syncer:
17-
registry: docker.io
18-
image: loftsh/vcluster
19-
tag: "0.14.1"
20+
registry: ghcr.io
21+
image: loft-sh/vcluster-oss
22+
tag: "0.24.1"
2023
kubectl:
2124
registry: docker.io
2225
image: bitnami/kubectl
23-
tag: "1.28.15"
26+
tag: "1.32.1"
2427

2528
storage:
26-
persistence: true
29+
persistence: auto
2730
size: 5Gi
2831
class_name: null
2932

30-
resources:
31-
k3s:
32-
requests:
33-
cpu: 200m
34-
memory: 256Mi
35-
limits:
36-
memory: 2Gi
37-
syncer:
38-
requests:
39-
cpu: 100m
40-
memory: 128Mi
41-
limits:
42-
memory: 1Gi
33+
k3s:
34+
additional_args: []
4335

4436
ingress:
37+
enabled: true
4538
host: null
46-
labels: {}
4739
annotations:
4840
cert-manager.io/cluster-issuer: letsencrypt-production
4941

50-
ocp_route:
51-
host: null
42+
backing_store: {}
5243

53-
k3s:
54-
additional_args: []
55-
syncer:
56-
additional_args: []
44+
additional_manifests: nil
45+
46+
resources:
47+
k3s:
48+
requests:
49+
cpu: 40m
50+
memory: 64Mi
51+
limits:
52+
cpu: 100m
53+
memory: 256Mi
54+
syncer:
55+
requests:
56+
cpu: 200m
57+
memory: 256Mi
58+
limits:
59+
memory: 2Gi
5760

58-
additional_manifests: {}
61+
helm_values:
62+
sync:
63+
toHost:
64+
ingresses:
65+
enabled: true
66+
controlPlane:
67+
distro:
68+
k3s:
69+
enabled: true
70+
extraArgs: ${vcluster:k3s:additional_args}
71+
image:
72+
registry: ${vcluster:images:k3s:registry}
73+
repository: ${vcluster:images:k3s:image}
74+
tag: ${vcluster:images:k3s:tag}
75+
resources: ${vcluster:resources:k3s}
5976

77+
statefulSet:
78+
security:
79+
containerSecurityContext:
80+
allowPrivilegeEscalation: false
81+
runAsUser: null
82+
runAsGroup: null
83+
resources:
84+
${vcluster:resources:syncer}
85+
image:
86+
registry: ${vcluster:images:syncer:registry}
87+
repository: ${vcluster:images:syncer:image}
88+
tag: ${vcluster:images:syncer:tag}
89+
persistence:
90+
volumeClaim:
91+
enabled: ${vcluster:storage:persistence}
92+
size: ${vcluster:storage:size}
93+
storageClass: ${vcluster:storage:class_name}
94+
backingStore: ${vcluster:backing_store}
95+
ingress:
96+
enabled: ${vcluster:ingress:enabled}
97+
host: ${vcluster:ingress:host}
98+
annotations: ${vcluster:ingress:annotations}
99+
spec:
100+
tls:
101+
- hosts:
102+
- ${vcluster:ingress:host}
103+
secretName: ${_instance}-tls
104+
rbac:
105+
role:
106+
extraRules:
107+
- apiGroups: [""]
108+
resources: ["endpoints/restricted"]
109+
verbs: ["create"]
110+
exportKubeConfig:
111+
server: https://${vcluster:ingress:host}
112+
serviceAccount:
113+
name: ${_instance}-admin
114+
clusterRole: cluster-admin
115+
experimental:
116+
deploy:
117+
vcluster:
118+
manifests: ${vcluster:additional_manifests}
60119
syn:
61120
registration_url: null

class/vcluster.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
parameters:
22
kapitan:
3+
dependencies:
4+
- type: helm
5+
source: ${vcluster:charts:vcluster:source}
6+
chart_name: vcluster
7+
version: ${vcluster:charts:vcluster:version}
8+
output_path: ${_base_directory}/helmcharts/vcluster/${vcluster:charts:vcluster:version}
39
compile:
410
- input_paths:
511
- vcluster/component/app.jsonnet
@@ -9,3 +15,12 @@ parameters:
915
- vcluster/component/main.jsonnet
1016
input_type: jsonnet
1117
output_path: ${_instance}/
18+
- output_path: ${_instance}/01_vcluster_helmchart
19+
input_type: helm
20+
output_type: yaml
21+
input_paths:
22+
- ${_base_directory}/helmcharts/vcluster/${vcluster:charts:vcluster:version}
23+
helm_params:
24+
name: "${_instance}"
25+
namespace: "${vcluster:namespace}"
26+
helm_values: ${vcluster:helm_values}

component/app.jsonnet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ local params = inv.parameters.vcluster;
44
local instance = inv.parameters._instance;
55
local argocd = import 'lib/argocd.libjsonnet';
66

7-
local app = argocd.App(instance, params.namespace);
7+
local app = argocd.App(instance, params.namespace, base='vcluster');
88

99
local appPath =
1010
local project = std.get(std.get(app, 'spec', {}), 'project', 'syn');

0 commit comments

Comments
 (0)