Skip to content

Commit 66a13b4

Browse files
add vcluster as subchart
1 parent 6f84e81 commit 66a13b4

Some content is hidden

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

62 files changed

+12117
-46
lines changed
File renamed without changes.

charts/cf-vcluster/Chart.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: v2
2+
name: cf-vcluster
3+
description: Umbrella chart over vCluster adjusted for Codefresh use cases - mainly in Crossplane compositions
4+
type: application
5+
version: 0.28.0-0
6+
appVersion: "0.28.0"

charts/cf-vcluster/README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# cf-vcluster
2+
3+
![Version: 0.28.0-0](https://img.shields.io/badge/Version-0.28.0--0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.28.0](https://img.shields.io/badge/AppVersion-0.28.0-informational?style=flat-square)
4+
5+
Umbrella chart over vCluster adjusted for Codefresh use cases - mainly in Crossplane compositions
6+
7+
## Requirements
8+
9+
| Repository | Name | Version |
10+
|------------|------|---------|
11+
| https://charts.loft.sh | vcluster | 0.28.0 |
12+
13+
## Values
14+
15+
| Key | Type | Default | Description |
16+
|-----|------|---------|-------------|
17+
| ingress.internal.annotations | object | `{}` | |
18+
| ingress.internal.backendService | object | `{}` | Possibility to override backend service name for ingress. If not set default vcluster backend service will be used |
19+
| ingress.internal.enabled | bool | `false` | |
20+
| ingress.internal.host.domain | string | `"example.com"` | |
21+
| ingress.internal.host.name | string | `"{{ .Release.Name }}"` | |
22+
| ingress.internal.ingressClassName | string | `"nginx-internal"` | |
23+
| ingress.public.annotations | object | `{}` | |
24+
| ingress.public.backendService | object | `{}` | Possibility to override backend service name for ingress. If not set default vcluster backend service will be used |
25+
| ingress.public.enabled | bool | `false` | |
26+
| ingress.public.host.domain | string | `"example.com"` | |
27+
| ingress.public.host.name | string | `"{{ .Release.Name }}"` | |
28+
| ingress.public.ingressClassName | string | `"nginx-public"` | |
29+
| vcluster.controlPlane.distro.k8s.apiServer.extraArgs[0] | string | `"--oidc-issuer-url=https://dexidp.shared-services.cf-infra.com"` | |
30+
| vcluster.controlPlane.distro.k8s.apiServer.extraArgs[1] | string | `"--oidc-client-id=vcluster-login"` | |
31+
| vcluster.controlPlane.distro.k8s.apiServer.extraArgs[2] | string | `"--oidc-username-claim=email"` | |
32+
| vcluster.controlPlane.distro.k8s.apiServer.extraArgs[3] | string | `"--oidc-groups-claim=groups"` | |
33+
| vcluster.controlPlane.distro.k8s.enabled | bool | `true` | |
34+
35+
----------------------------------------------
36+
Autogenerated from chart metadata using [helm-docs v1.9.1](https://github.com/norwoodj/helm-docs/releases/v1.9.1)
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
6+
# Common VCS dirs
7+
.git/
8+
.gitignore
9+
.bzr/
10+
.bzrignore
11+
.hg/
12+
.hgignore
13+
.svn/
14+
15+
# Common backup files
16+
*.swp
17+
*.bak
18+
*.tmp
19+
*~
20+
21+
# Various IDEs
22+
.project
23+
.idea/
24+
*.tmproj
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
apiVersion: v2
2+
appVersion: 0.28.0
3+
description: vcluster - Virtual Kubernetes Clusters
4+
home: https://vcluster.com
5+
icon: https://static.loft.sh/branding/logos/vcluster/vertical/vcluster_vertical.svg
6+
keywords:
7+
- developer
8+
- development
9+
- sharing
10+
- share
11+
- multi-tenancy
12+
- tenancy
13+
- cluster
14+
- space
15+
- namespace
16+
- vcluster
17+
- vclusters
18+
maintainers:
19+
20+
name: Loft Labs, Inc.
21+
url: https://twitter.com/loft_sh
22+
name: vcluster
23+
sources:
24+
- https://github.com/loft-sh/vcluster
25+
type: application
26+
version: 0.28.0
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
2+
# vcluster
3+
4+
## **[GitHub](https://github.com/loft-sh/vcluster)****[Website](https://www.vcluster.com)****[Quickstart](https://www.vcluster.com/docs/getting-started/setup)****[Documentation](https://www.vcluster.com/docs/what-are-virtual-clusters)****[Blog](https://loft.sh/blog)****[Twitter](https://twitter.com/loft_sh)****[Slack](https://slack.loft.sh/)**
5+
6+
Create fully functional virtual Kubernetes clusters - Each vcluster runs inside a namespace of the underlying k8s cluster. It's cheaper than creating separate full-blown clusters and it offers better multi-tenancy and isolation than regular namespaces.
7+
8+
## Prerequisites
9+
10+
- Kubernetes 1.18+
11+
- Helm 3.10.0+
12+
13+
## Get Helm Repository Info
14+
15+
```bash
16+
helm repo add loft-sh https://charts.loft.sh
17+
helm repo update
18+
```
19+
20+
See [helm repo](https://helm.sh/docs/helm/helm_repo/) for command documentation.
21+
22+
## Install Helm Chart
23+
24+
```bash
25+
helm upgrade [RELEASE_NAME] loft-sh/vcluster -n [RELEASE_NAMESPACE] --create-namespace --install
26+
```
27+
28+
See [vcluster docs](https://vcluster.com/docs) for configuration options.
29+
30+
See [helm upgrade](https://helm.sh/docs/helm/helm_upgrade/) for command documentation.
31+
32+
## Connect to the vcluster
33+
34+
In order to connect to the installed vcluster, please install [vcluster cli](https://www.vcluster.com/docs/getting-started/setup) and run:
35+
36+
```bash
37+
vcluster connect [RELEASE_NAME] -n [RELEASE_NAMESPACE]
38+
```
39+
40+
## Uninstall Helm Chart
41+
42+
```bash
43+
helm uninstall [RELEASE_NAME]
44+
```
45+
46+
This removes all the Kubernetes components associated with the chart and deletes the release.
47+
48+
See [helm uninstall](https://helm.sh/docs/helm/helm_uninstall/) for command documentation.
49+
50+
### Why Virtual Kubernetes Clusters?
51+
52+
- **Cluster Scoped Resources**: much more powerful than simple namespaces (virtual clusters allow users to use CRDs, namespaces, cluster roles etc.)
53+
- **Ease of Use**: usable in any Kubernetes cluster and created in seconds either via a single command or [cluster-api](https://github.com/loft-sh/cluster-api-provider-vcluster)
54+
- **Cost Efficient**: much cheaper and efficient than "real" clusters (single pod and shared resources just like for namespaces)
55+
- **Lightweight**: built upon the ultra-fast k3s distribution with minimal overhead per virtual cluster (other distributions work as well)
56+
- **Strict isolation**: complete separate Kubernetes control plane and access point for each vcluster while still being able to share certain services of the underlying host cluster
57+
- **Cluster Wide Permissions**: allow users to install apps which require cluster-wide permissions while being limited to actually just one namespace within the host cluster
58+
- **Great for Testing**: allow you to test different Kubernetes versions inside a single host cluster which may have a different version than the virtual clusters
59+
60+
Learn more on [www.vcluster.com](https://vcluster.com).
61+
62+
![vcluster Intro](https://github.com/loft-sh/vcluster/raw/main/docs/static/media/vcluster-comparison.png)
63+
64+
Learn more in the [documentation](https://vcluster.com/docs/what-are-virtual-clusters).
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{{/*
2+
is deploy etcd enabled?
3+
*/}}
4+
{{- define "vcluster.database.embedded.enabled" -}}
5+
{{- $backingStores := 0 -}}
6+
{{- if .Values.controlPlane.backingStore.etcd.embedded.enabled -}}
7+
{{- $backingStores = add1 $backingStores -}}
8+
{{- end -}}
9+
{{- if .Values.controlPlane.backingStore.etcd.deploy.enabled -}}
10+
{{- $backingStores = add1 $backingStores -}}
11+
{{- end -}}
12+
{{- if .Values.controlPlane.backingStore.etcd.external.enabled -}}
13+
{{- $backingStores = add1 $backingStores -}}
14+
{{- end -}}
15+
{{- if .Values.controlPlane.backingStore.database.embedded.enabled -}}
16+
{{- $backingStores = add1 $backingStores -}}
17+
{{- end -}}
18+
{{- if .Values.controlPlane.backingStore.database.external.enabled -}}
19+
{{- $backingStores = add1 $backingStores -}}
20+
{{- end -}}
21+
{{- if gt $backingStores 1 -}}
22+
{{- fail "you can only enable one backingStore at the same time" -}}
23+
{{- else if or (eq $backingStores 0) .Values.controlPlane.backingStore.database.embedded.enabled -}}
24+
{{- true -}}
25+
{{- end -}}
26+
{{- end -}}
27+
28+
{{/*
29+
migrate from deployed etcd?
30+
*/}}
31+
{{- define "vcluster.etcd.embedded.migrate" -}}
32+
{{- if and .Values.controlPlane.backingStore.etcd.embedded.enabled .Values.controlPlane.backingStore.etcd.embedded.migrateFromDeployedEtcd -}}
33+
{{- true -}}
34+
{{- end -}}
35+
{{- end -}}
36+
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{{- define "vcluster.distro.env" -}}
2+
{{- if and (eq (include "vcluster.distro" .) "k3s") .Values.controlPlane.distro.k3s.env -}}
3+
{{ toYaml .Values.controlPlane.distro.k3s.env }}
4+
{{- else if and (eq (include "vcluster.distro" .) "k8s") .Values.controlPlane.distro.k8s.env -}}
5+
{{ toYaml .Values.controlPlane.distro.k8s.env }}
6+
{{- end -}}
7+
{{- end -}}
8+
9+
{{/*
10+
vCluster Distro
11+
*/}}
12+
{{- define "vcluster.distro" -}}
13+
{{- $distros := 0 -}}
14+
{{- if .Values.controlPlane.distro.k3s.enabled -}}
15+
k3s
16+
{{- $distros = add1 $distros -}}
17+
{{- end -}}
18+
{{- if .Values.controlPlane.distro.k8s.enabled -}}
19+
k8s
20+
{{- $distros = add1 $distros -}}
21+
{{- end -}}
22+
{{- if eq $distros 0 -}}
23+
k8s
24+
{{- else if gt $distros 1 -}}
25+
{{- fail "you can only enable one distro at the same time" -}}
26+
{{- end -}}
27+
{{- end -}}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{{- define "vcluster.exportKubeConfig.validate" }}
2+
{{- /*
3+
Verify that exportKubeConfig.secret and exportKubeConfig.additionalSecrets are
4+
not set at the same time.
5+
*/}}
6+
{{- $secretSet := false }}
7+
{{- if .Values.exportKubeConfig.secret }}
8+
{{- $secretSet = or (.Values.exportKubeConfig.secret.name | trim | ne "") (.Values.exportKubeConfig.secret.namespace | trim | ne "") }}
9+
{{- end }}
10+
{{- $additionalSecretsSet := false }}
11+
{{- if .Values.exportKubeConfig.additionalSecrets }}
12+
{{- $additionalSecretsSet = gt (len .Values.exportKubeConfig.additionalSecrets) 0 }}
13+
{{- end }}
14+
{{- if and $secretSet $additionalSecretsSet }}
15+
{{- fail "exportKubeConfig.secret and exportKubeConfig.additionalSecrets cannot be set at the same time" }}
16+
{{- end }}
17+
{{- /*
18+
Verify that additional secrets have name or namespace set.
19+
*/}}
20+
{{- range $_, $additionalSecret := .Values.exportKubeConfig.additionalSecrets }}
21+
{{- $nameSet := false }}
22+
{{- $namespaceSet := false }}
23+
{{- if $additionalSecret.name }}
24+
{{- if $additionalSecret.name | trim | ne "" }}
25+
{{- $nameSet = true }}
26+
{{- end }}
27+
{{- end }}
28+
{{- if $additionalSecret.namespace }}
29+
{{- if $additionalSecret.namespace | trim | ne "" }}
30+
{{- $namespaceSet = true }}
31+
{{- end }}
32+
{{- end }}
33+
{{- if not (or $nameSet $namespaceSet) }}
34+
{{- fail (cat "additional secret must have name and/or namespace set, found:" (toJson $additionalSecret)) }}
35+
{{- end }}
36+
{{- end }}
37+
{{- end }}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{{- define "vcluster.controlPlane.image" -}}
2+
{{- $tag := .Chart.Version -}}
3+
{{- if .Values.controlPlane.statefulSet.image.tag -}}
4+
{{- $tag = .Values.controlPlane.statefulSet.image.tag -}}
5+
{{- end -}}
6+
{{- include "vcluster.image" (dict "defaultImageRegistry" .Values.controlPlane.advanced.defaultImageRegistry "tag" $tag "registry" .Values.controlPlane.statefulSet.image.registry "repository" .Values.controlPlane.statefulSet.image.repository) -}}
7+
{{- end -}}
8+
9+
{{- define "vcluster.image" -}}
10+
{{- if .defaultImageRegistry -}}
11+
{{ .defaultImageRegistry }}/{{ .repository }}:{{ .tag }}
12+
{{- else if .registry -}}
13+
{{ .registry }}/{{ .repository }}:{{ .tag }}
14+
{{- else -}}
15+
{{ .repository }}:{{ .tag }}
16+
{{- end -}}
17+
{{- end -}}

0 commit comments

Comments
 (0)