Skip to content

Commit 54fc322

Browse files
authored
Merge branch 'loft-sh:main' into ebcloud-dev
2 parents 29a925a + 0c93504 commit 54fc322

File tree

481 files changed

+90232
-21529
lines changed

Some content is hidden

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

481 files changed

+90232
-21529
lines changed

.backportrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"repoOwner": "loft-sh",
33
"repoName": "vcluster",
44
"targetBranchChoices": ["v0.19", "v0.20", "v0.21", "v0.22", "v0.23", "v0.24"],
5-
"prDescription": "Backport from `{{sourceBranch}}` to `{{targetBranch}}`\n\nOriginal PR Nr.: #{{sourcePullRequest.number}}\n\n### Backported Commits:\n{{#each commits}}\n- {{shortSha this.sourceCommit.sha}} {{this.sourceCommit.message}}\n{{/each}}\n\n## Original PR Description:\n{{sourcePullRequest}}",
5+
"prDescription": "Backport from `{{sourceBranch}}` to `{{targetBranch}}`\n\nOriginal PR Nr.: #{{sourcePullRequest.number}}\n\n### Backported Commits:\n{{#each commits}}\n- {{shortSha this.sourceCommit.sha}} {{this.sourceCommit.message}}\n{{/each}}",
66
"branchLabelMapping": {
77
"^backport-to-(.+)$": "$1"
88
}

.github/workflows/backport.yaml

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -18,26 +18,6 @@ jobs:
1818
- name: Install GH CLI
1919
uses: dev-hanz-ops/install-gh-cli-action@v0.2.1
2020

21-
- name: Fetch PR description and update backportrc
22-
env:
23-
GH_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
24-
PR_NUMBER: ${{ github.event.pull_request.number }}
25-
REPO: ${{ github.repository }}
26-
run: |
27-
# Grab raw original PR body, gh CLI uses the default token.
28-
BODY_CONTENT="$(gh api "/repos/$REPO/pulls/$PR_NUMBER" | jq -r .body)"
29-
30-
# Escape the markdown content so that sed can produce valid JSON.
31-
# Remove starting and ending quites and replace new lines with literals.
32-
ESCAPED_CONTENT=$(echo "$BODY_CONTENT" | jq -aRs .)
33-
ESCAPED_CONTENT="${ESCAPED_CONTENT%\"}"
34-
ESCAPED_CONTENT="${ESCAPED_CONTENT#\"}"
35-
ESCAPED_CONTENT=$(echo "$ESCAPED_CONTENT" | sed 's/[\/&]/\\&/g')
36-
37-
# sourcePullRequest is an actual variable, but the PR description is not provided by the action or the CLI.
38-
# Instead we are using it as a substitution target and replacing it with the markdown content.
39-
sed -i "s/{{sourcePullRequest}}/$ESCAPED_CONTENT/g" .backportrc.json
40-
4121
- name: Backport Action
4222
uses: sorenlouv/backport-github-action@v9.5.1
4323
with:

.github/workflows/compatibility.yaml

Lines changed: 0 additions & 27 deletions
This file was deleted.

.github/workflows/docs.yaml

Lines changed: 0 additions & 70 deletions
This file was deleted.

.github/workflows/e2e.yaml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ jobs:
170170
strategy:
171171
fail-fast: false
172172
matrix:
173-
distribution: ["k3s", "k8s", "k0s"]
173+
distribution: ["k3s", "k8s"]
174174
steps:
175175
- name: Checkout repository
176176
uses: actions/checkout@v4
@@ -255,7 +255,7 @@ jobs:
255255
strategy:
256256
fail-fast: false
257257
matrix:
258-
distribution: ["k3s", "k8s", "k0s"]
258+
distribution: ["k3s", "k8s"]
259259
test-suite-path: ${{fromJson(needs.get-testsuites-dir.outputs.matrix)}}
260260
multinamespace-mode: ["false", "true"]
261261
ha: ["false", "true"]
@@ -268,16 +268,10 @@ jobs:
268268
ha: "true"
269269
test-suite-path: "./test/e2e"
270270
multinamespace-mode: "false"
271-
- distribution: "k0s"
272-
ha: "true"
273-
test-suite-path: "./test/e2e"
274-
multinamespace-mode: "false"
275271
exclude:
276272
- ha: "true"
277273
- distribution: "k8s"
278274
multinamespace-mode: "true"
279-
- distribution: "k0s"
280-
multinamespace-mode: "true"
281275
- distribution: "k3s"
282276
multinamespace-mode: "true"
283277
test-suite-path: "./test/e2e_target_namespace"

.github/workflows/lint.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,6 @@ jobs:
5050
fi
5151
5252
- name: Run golangci-lint
53-
uses: golangci/golangci-lint-action@v7
53+
uses: golangci/golangci-lint-action@v8
5454
with:
55-
version: v2.0
55+
version: v2.1

.github/workflows/release.yaml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
with:
3737
cosign-release: "v2.2.3"
3838
- name: Setup Syft
39-
uses: anchore/sbom-action/download-syft@v0.18.0
39+
uses: anchore/sbom-action/download-syft@v0.19.0
4040
- name: Set up QEMU
4141
uses: docker/setup-qemu-action@v3
4242
- name: Set up Docker Buildx
@@ -122,10 +122,28 @@ jobs:
122122
CHART_MUSEUM_PASSWORD: ${{ secrets.CHART_MUSEUM_PASSWORD }}
123123
# The workflow will only trigger on non-draft releases
124124
# https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#release
125+
sync_linear:
126+
needs:
127+
- publish
128+
- publish-chart
129+
runs-on: ubuntu-latest
130+
steps:
131+
- uses: actions/checkout@v4
132+
- uses: actions/setup-go@v5
133+
with:
134+
go-version-file: go.mod
135+
- name: Update linear issues
136+
run: go run . -release-tag="${{ needs.publish.outputs.release_version }}"
137+
working-directory: hack/linear-sync
138+
env:
139+
GITHUB_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
140+
LINEAR_TOKEN: ${{ secrets.LINEAR_TOKEN }}
141+
125142
notify_release:
126143
needs:
127144
- publish
128145
- publish-chart
146+
- sync_linear
129147
runs-on: ubuntu-22.04
130148
steps:
131149
- uses: actions/checkout@v4

Justfile

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ generate-vcluster-latest-images version="0.0.0":
5757

5858
# Generate the vcluster optional images file
5959
[private]
60-
generate-vcluster-optional-images:
61-
{{ASSETS_RUN}} --optional > ./release/images-optional.txt
60+
generate-vcluster-optional-images version="0.0.0":
61+
{{ASSETS_RUN}} --optional {{ version }} > ./release/images-optional.txt
6262

6363
# Generate versioned vCluster image files for multiple versions and distros
6464
[private]
@@ -73,10 +73,6 @@ generate-matrix-specific-images version="0.0.0":
7373
done
7474
done
7575

76-
# Generate the CLI docs
77-
generate-cli-docs:
78-
go run -mod vendor -tags pro ./hack/docs/main.go
79-
8076
# Generate the vcluster.yaml config schema
8177
generate-config-schema:
8278
go run -mod vendor ./hack/schema/main.go
@@ -86,6 +82,9 @@ generate-config-schema:
8682
embed-chart version="0.0.0":
8783
RELEASE_VERSION={{ version }} go generate -tags embed_chart ./...
8884

85+
test-chart:
86+
helm unittest chart
87+
8988
# Run e2e tests
9089
e2e distribution="k3s" path="./test/e2e" multinamespace="false": create-kind && delete-kind
9190
echo "Execute test suites ({{ distribution }}, {{ path }}, {{ multinamespace }})"

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ brew install loft-sh/tap/vcluster
3333
vcluster create my-vcluster --namespace team-x
3434
```
3535

36-
https://github.com/user-attachments/assets/d97c21ae-5d23-499c-a1e8-e8d784493be4
36+
![vCluster gif](./docs/static/media/vcluster-github-gif-1280.gif)
3737

3838
For detailed steps, visit our [Quickstart Documentation](https://www.vcluster.com/docs/get-started).
3939

@@ -90,7 +90,7 @@ For detailed steps, visit our [Quickstart Documentation](https://www.vcluster.co
9090
<summary><strong>Enhanced Flexibility and Compatibility</strong></summary>
9191

9292
- **Diverse Kubernetes Environments**:
93-
vCluster supports different Kubernetes versions and distributions (including K8s, K3s, and K0s), allowing version skews. This makes it possible to tailor each virtual cluster to specific requirements without impacting others.
93+
vCluster supports different Kubernetes versions and distributions (including K8s and K3s), allowing version skews. This makes it possible to tailor each virtual cluster to specific requirements without impacting others.
9494

9595
- **Adaptable Backing Stores**:
9696
Choose from a range of data stores, from lightweight (SQLite) to enterprise-grade options (embedded etcd, external data stores like Global RDS), catering to various scalability and durability needs.

chart/templates/_coredns.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Corefile: |-
2727
fallthrough in-addr.arpa ip6.arpa
2828
{{- end }}
2929
}
30-
hosts /etc/NodeHosts {
30+
hosts /etc/coredns/NodeHosts {
3131
ttl 60
3232
reload 15s
3333
fallthrough

chart/templates/_distro.tpl

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
{{ toYaml .Values.controlPlane.distro.k3s.env }}
44
{{- else if and (eq (include "vcluster.distro" .) "k8s") .Values.controlPlane.distro.k8s.env -}}
55
{{ toYaml .Values.controlPlane.distro.k8s.env }}
6-
{{- else if and (eq (include "vcluster.distro" .) "k0s") .Values.controlPlane.distro.k0s.env -}}
7-
{{ toYaml .Values.controlPlane.distro.k0s.env }}
86
{{- end -}}
97
{{- end -}}
108

@@ -17,10 +15,6 @@
1715
k3s
1816
{{- $distros = add1 $distros -}}
1917
{{- end -}}
20-
{{- if .Values.controlPlane.distro.k0s.enabled -}}
21-
k0s
22-
{{- $distros = add1 $distros -}}
23-
{{- end -}}
2418
{{- if .Values.controlPlane.distro.k8s.enabled -}}
2519
k8s
2620
{{- $distros = add1 $distros -}}

chart/templates/_init-containers.tpl

Lines changed: 1 addition & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -3,35 +3,17 @@
33
{{ include "vcluster.k3s.initContainers" . }}
44
{{- else if eq (include "vcluster.distro" .) "k8s" -}}
55
{{ include "vcluster.k8s.initContainers" . }}
6-
{{- else if eq (include "vcluster.distro" .) "k0s" -}}
7-
{{ include "vcluster.k0s.initContainers" . }}
8-
{{- end -}}
9-
{{- end -}}
10-
11-
{{- define "vcluster.k8s.capabilities.version" -}}
12-
{{/* We need to workaround here for unit tests because Capabilities.KubeVersion.Version is not supported, so we use .Chart.Version */}}
13-
{{- if hasPrefix "test-" .Chart.Version -}}
14-
{{- regexFind "^v[0-9]+\\.[0-9]+\\.[0-9]+" (trimPrefix "test-" .Chart.Version) -}}
15-
{{- else -}}
16-
{{- regexFind "^v[0-9]+\\.[0-9]+\\.[0-9]+" .Capabilities.KubeVersion.Version -}}
176
{{- end -}}
187
{{- end -}}
198

209
{{/* Bump $defaultTag value whenever k8s version is bumped */}}
2110
{{- define "vcluster.k8s.image.tag" -}}
22-
{{- $defaultTag := "v1.32.1" -}}
23-
{{- if and (not (empty .Values.controlPlane.distro.k8s.version)) (eq .Values.controlPlane.distro.k8s.image.tag $defaultTag) -}}
11+
{{- if not (empty .Values.controlPlane.distro.k8s.version) -}}
2412
{{ .Values.controlPlane.distro.k8s.version }}
2513
{{- else -}}
26-
{{- if not (eq .Values.controlPlane.distro.k8s.image.tag $defaultTag) -}}
27-
{{ .Values.controlPlane.distro.k8s.image.tag }}
28-
{{- else if not (empty (include "vcluster.k8s.capabilities.version" .)) -}}
29-
{{ include "vcluster.k8s.capabilities.version" . }}
30-
{{- else -}}
3114
{{ .Values.controlPlane.distro.k8s.image.tag }}
3215
{{- end -}}
3316
{{- end -}}
34-
{{- end -}}
3517

3618
{{- define "vcluster.k8s.initContainers" -}}
3719
{{- include "vcluster.oldPlugins.initContainers" . }}
@@ -78,28 +60,6 @@
7860
{{ toYaml .Values.controlPlane.distro.k3s.resources | indent 4 }}
7961
{{- end -}}
8062

81-
{{- define "vcluster.k0s.initContainers" -}}
82-
{{- include "vcluster.oldPlugins.initContainers" . }}
83-
{{- include "vcluster.plugins.initContainers" . }}
84-
- name: vcluster
85-
image: "{{ include "vcluster.image" (dict "defaultImageRegistry" .Values.controlPlane.advanced.defaultImageRegistry "registry" .Values.controlPlane.distro.k0s.image.registry "repository" .Values.controlPlane.distro.k0s.image.repository "tag" .Values.controlPlane.distro.k0s.image.tag) }}"
86-
command:
87-
- /bin/sh
88-
args:
89-
- -c
90-
- "cp /usr/local/bin/k0s /binaries/k0s"
91-
{{- if .Values.controlPlane.distro.k0s.imagePullPolicy }}
92-
imagePullPolicy: {{ .Values.controlPlane.distro.k0s.imagePullPolicy }}
93-
{{- end }}
94-
securityContext:
95-
{{ toYaml .Values.controlPlane.distro.k0s.securityContext | indent 4 }}
96-
volumeMounts:
97-
- name: binaries
98-
mountPath: /binaries
99-
resources:
100-
{{ toYaml .Values.controlPlane.distro.k0s.resources | indent 4 }}
101-
{{- end -}}
102-
10363
{{/*
10464
Plugin init container definition
10565
*/}}

chart/templates/coredns-configmap.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,11 +171,16 @@ data:
171171
topologySpreadConstraints:
172172
{{ toYaml .Values.controlPlane.coredns.deployment.topologySpreadConstraints | indent 12 }}
173173
{{- end }}
174+
{{- if .Values.controlPlane.coredns.security.podSecurityContext }}
175+
securityContext:
176+
{{ toYaml .Values.controlPlane.coredns.security.podSecurityContext | indent 12 }}
177+
{{- else }}
174178
{{- if .Values.policies.podSecurityStandard }}
175179
securityContext:
176180
seccompProfile:
177181
type: RuntimeDefault
178182
{{- end }}
183+
{{- end }}
179184
containers:
180185
- name: coredns
181186
{{- if .Values.controlPlane.coredns.deployment.image }}
@@ -200,6 +205,10 @@ data:
200205
- name: custom-config-volume
201206
mountPath: /etc/coredns/custom
202207
readOnly: true
208+
{{- if .Values.controlPlane.coredns.security.containerSecurityContext }}
209+
securityContext:
210+
{{ toYaml .Values.controlPlane.coredns.security.containerSecurityContext | indent 16 }}
211+
{{- else }}
203212
securityContext:
204213
runAsNonRoot: true
205214
runAsUser: {{`{{.RUN_AS_USER}}`}}
@@ -211,6 +220,7 @@ data:
211220
drop:
212221
- ALL
213222
readOnlyRootFilesystem: true
223+
{{- end }}
214224
livenessProbe:
215225
httpGet:
216226
path: /health

0 commit comments

Comments
 (0)