From a40652b82e3a79b992cf222cff48f20703a1c087 Mon Sep 17 00:00:00 2001 From: Fabian Kramm Date: Thu, 27 Jun 2024 15:51:42 +0200 Subject: [PATCH 1/2] chore: bump deps --- go.mod | 6 +- go.sum | 12 +- hack/platform/util/schema.go | 2 +- hack/vcluster/partials/main.go | 1 - vcluster/_partials/config/controlPlane.mdx | 17 ++ .../config/controlPlane/statefulSet.mdx | 17 ++ vcluster/_partials/config/experimental.mdx | 92 ++++++-- .../_partials/config/experimental/deploy.mdx | 92 ++++++-- vcluster/_partials/config/platform.mdx | 198 ------------------ .../fromHost/virtual-scheduler-auto-syncs.mdx | 1 - vcluster/configure/vcluster-yaml/platform.mdx | 14 -- .../management/zz_generated.api.register.go | 4 +- .../v1/devpodworkspacetemplate_types.go | 4 + .../apis/storage/v1/zz_generated.deepcopy.go | 7 + .../loft-sh/vcluster-config/config/config.go | 116 ++++++---- .../vcluster-config/config/values.yaml | 28 +-- vendor/modules.txt | 6 +- 17 files changed, 300 insertions(+), 317 deletions(-) delete mode 100755 vcluster/_partials/config/platform.mdx delete mode 100644 vcluster/_partials/config/sync/fromHost/virtual-scheduler-auto-syncs.mdx delete mode 100644 vcluster/configure/vcluster-yaml/platform.mdx diff --git a/go.mod b/go.mod index af47fbe33..2b79333c0 100644 --- a/go.mod +++ b/go.mod @@ -6,9 +6,9 @@ require ( github.com/gertd/go-pluralize v0.2.1 github.com/ghodss/yaml v1.0.0 github.com/invopop/jsonschema v0.12.1-0.20240219232115-a4467074499d - github.com/loft-sh/agentapi/v4 v4.0.0-alpha.11 - github.com/loft-sh/api/v4 v4.0.0-alpha.6.0.20240618092712-6b5276c8407d - github.com/loft-sh/vcluster-config v0.0.0-20240522133807-821170af4934 + github.com/loft-sh/agentapi/v4 v4.0.0-alpha.16 + github.com/loft-sh/api/v4 v4.0.0-alpha.16 + github.com/loft-sh/vcluster-config v0.0.0-20240626114406-e551a685416f k8s.io/apimachinery v0.30.1 sigs.k8s.io/controller-runtime v0.18.4 ) diff --git a/go.sum b/go.sum index 28cc4c092..5ca8e2712 100644 --- a/go.sum +++ b/go.sum @@ -110,16 +110,16 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/loft-sh/admin-apis v0.0.0-20240203010124-3600c1c582a8 h1:nuY9Vgvabh2FlaTYp9yhzh3cBzY6jjFEFSsOvw9ZAJw= github.com/loft-sh/admin-apis v0.0.0-20240203010124-3600c1c582a8/go.mod h1:MWczNwKvWssHo1KaeZKaWDdRLYSNbWqQBGsTLoCNd7U= -github.com/loft-sh/agentapi/v4 v4.0.0-alpha.11 h1:OQW5k1XELUdvX5T3a7N5TnsY0C/3hLoKOn7OTkpIlJs= -github.com/loft-sh/agentapi/v4 v4.0.0-alpha.11/go.mod h1:RMUME+v+LxjqG05t7JdLq5WYfnSwGgchp93S1gdT2aw= -github.com/loft-sh/api/v4 v4.0.0-alpha.6.0.20240618092712-6b5276c8407d h1:0bdZoDJ/8/Jyc1umv4wzxXqyYMqJtUrkFoMV6iOwBGU= -github.com/loft-sh/api/v4 v4.0.0-alpha.6.0.20240618092712-6b5276c8407d/go.mod h1:paBEWkIUDcjG1oiPxD4QjGInkP+aTreKpUJg0j0OskU= +github.com/loft-sh/agentapi/v4 v4.0.0-alpha.16 h1:GWV4s+PPAGSN7QcAG1GlLtRQfnge+Z0Zo4YcwROKMMA= +github.com/loft-sh/agentapi/v4 v4.0.0-alpha.16/go.mod h1:RMUME+v+LxjqG05t7JdLq5WYfnSwGgchp93S1gdT2aw= +github.com/loft-sh/api/v4 v4.0.0-alpha.16 h1:yux8oQRIFzqY5mXMtwf+wOfMTQoHHgWUWhARsR/sfD0= +github.com/loft-sh/api/v4 v4.0.0-alpha.16/go.mod h1:tMX2kgGqcRH1byBCdwByivozMEKL6rKKYaEl0XVIE68= github.com/loft-sh/apiserver v0.0.0-20240607231110-634aeeab2b36 h1:1euJ7mNHMI2MMA+g+jEYYKtoMrHZTkUMapHnmjHb9lM= github.com/loft-sh/apiserver v0.0.0-20240607231110-634aeeab2b36/go.mod h1:XxI95azXiqXHiIDRiyDTpZcxdtXQlUqeU5VMMDz8INA= github.com/loft-sh/jsonschema v0.0.0-20240411094214-6b88fd9d2a31 h1:fQOxqGdVGSkoaPe2H31eFmEC+0CzCXq7D5TqBJM0eXo= github.com/loft-sh/jsonschema v0.0.0-20240411094214-6b88fd9d2a31/go.mod h1:ffZ5Km5SWWRAIN6wbDXItl95euhFz2uON45H2qjYt+0= -github.com/loft-sh/vcluster-config v0.0.0-20240522133807-821170af4934 h1:2KrUdwm26zLD6L6zsSml0yoYpFkOh1c1Vt/z2YAZRuM= -github.com/loft-sh/vcluster-config v0.0.0-20240522133807-821170af4934/go.mod h1:WOpmiPADZYvI3lzBd47KL/aTH4jSL8YQvI0kDy4YvFg= +github.com/loft-sh/vcluster-config v0.0.0-20240626114406-e551a685416f h1:z5KxZMtxse0LFZuHBCo+z1PNxBIW6OPO2qZezem8wAs= +github.com/loft-sh/vcluster-config v0.0.0-20240626114406-e551a685416f/go.mod h1:WOpmiPADZYvI3lzBd47KL/aTH4jSL8YQvI0kDy4YvFg= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= diff --git a/hack/platform/util/schema.go b/hack/platform/util/schema.go index 005811d45..768cc86bb 100644 --- a/hack/platform/util/schema.go +++ b/hack/platform/util/schema.go @@ -331,7 +331,7 @@ func GenerateFromPath(schema *jsonschema.Schema, basePath string, schemaPath str lastProperty = property fieldSchema, ok = fieldSchema.Properties.Get(property) if !ok { - panic("Couldn't find schema path " + schemaPath + " at " + property) + panic("Couldn't find schema path '" + schemaPath + "' at '" + property + "'") } if i+1 == len(splittedSchemaPath) { diff --git a/hack/vcluster/partials/main.go b/hack/vcluster/partials/main.go index 73e0b9db3..e7c01568b 100644 --- a/hack/vcluster/partials/main.go +++ b/hack/vcluster/partials/main.go @@ -44,7 +44,6 @@ var paths = []string{ "policies/centralAdmission", "policies", "plugins", - "platform", "observability/metrics", "observability", "networking/resolveDNS", diff --git a/vcluster/_partials/config/controlPlane.mdx b/vcluster/_partials/config/controlPlane.mdx index 8f654119a..7c45f878b 100755 --- a/vcluster/_partials/config/controlPlane.mdx +++ b/vcluster/_partials/config/controlPlane.mdx @@ -3600,6 +3600,23 @@ VolumeClaimTemplates defines the volumeClaimTemplates for the statefulSet +
+ + +##### `binariesVolume` required object[] pro {#controlPlane-statefulSet-persistence-binariesVolume} + +BinariesVolume defines a binaries volume that is used to retrieve +distro specific executables to be run by the syncer controller. +This volume doesn't need to be persistent. + + + + + +
+ + +
diff --git a/vcluster/_partials/config/controlPlane/statefulSet.mdx b/vcluster/_partials/config/controlPlane/statefulSet.mdx index b7503c3ec..6cfce842f 100755 --- a/vcluster/_partials/config/controlPlane/statefulSet.mdx +++ b/vcluster/_partials/config/controlPlane/statefulSet.mdx @@ -504,6 +504,23 @@ VolumeClaimTemplates defines the volumeClaimTemplates for the statefulSet +
+ + +#### `binariesVolume` required object[] pro {#statefulSet-persistence-binariesVolume} + +BinariesVolume defines a binaries volume that is used to retrieve +distro specific executables to be run by the syncer controller. +This volume doesn't need to be persistent. + + + + + +
+ + +
diff --git a/vcluster/_partials/config/experimental.mdx b/vcluster/_partials/config/experimental.mdx index 8f488b53a..950b07578 100755 --- a/vcluster/_partials/config/experimental.mdx +++ b/vcluster/_partials/config/experimental.mdx @@ -23,10 +23,67 @@ Deploy allows you to configure manifests and Helm charts to deploy within the vi +
+ + +#### `host` required object pro {#experimental-deploy-host} + +Host defines what manifests to deploy into the host cluster + + + + + + +
+ + +##### `manifests` required string pro {#experimental-deploy-host-manifests} + +Manifests are raw Kubernetes manifests that should get applied within the virtual cluster. + + + + + +
+ + + +
+ + +##### `manifestsTemplate` required string pro {#experimental-deploy-host-manifestsTemplate} + +ManifestsTemplate is a Kubernetes manifest template that will be rendered with vCluster values before applying it within the virtual cluster. + + + + + +
+ + +
+ + + +
+ + +#### `vcluster` required object pro {#experimental-deploy-vcluster} + +VCluster defines what manifests and charts to deploy into the vCluster + + + + + +
-#### `manifests` required string pro {#experimental-deploy-manifests} +##### `manifests` required string pro {#experimental-deploy-vcluster-manifests} Manifests are raw Kubernetes manifests that should get applied within the virtual cluster. @@ -41,7 +98,7 @@ Manifests are raw Kubernetes manifests that should get applied within the virtua
-#### `manifestsTemplate` required string pro {#experimental-deploy-manifestsTemplate} +##### `manifestsTemplate` required string pro {#experimental-deploy-vcluster-manifestsTemplate} ManifestsTemplate is a Kubernetes manifest template that will be rendered with vCluster values before applying it within the virtual cluster. @@ -56,7 +113,7 @@ ManifestsTemplate is a Kubernetes manifest template that will be rendered with v
-#### `helm` required object[] pro {#experimental-deploy-helm} +##### `helm` required object[] pro {#experimental-deploy-vcluster-helm} Helm are Helm charts that should get deployed into the virtual cluster @@ -68,7 +125,7 @@ Helm are Helm charts that should get deployed into the virtual cluster
-##### `chart` required object pro {#experimental-deploy-helm-chart} +##### `chart` required object pro {#experimental-deploy-vcluster-helm-chart} Chart defines what chart should get deployed. @@ -80,7 +137,7 @@ Chart defines what chart should get deployed.
-##### `name` required string pro {#experimental-deploy-helm-chart-name} +##### `name` required string pro {#experimental-deploy-vcluster-helm-chart-name} @@ -95,7 +152,7 @@ Chart defines what chart should get deployed.
-##### `repo` required string pro {#experimental-deploy-helm-chart-repo} +##### `repo` required string pro {#experimental-deploy-vcluster-helm-chart-repo} @@ -110,7 +167,7 @@ Chart defines what chart should get deployed.
-##### `insecure` required boolean false pro {#experimental-deploy-helm-chart-insecure} +##### `insecure` required boolean false pro {#experimental-deploy-vcluster-helm-chart-insecure} @@ -125,7 +182,7 @@ Chart defines what chart should get deployed.
-##### `version` required string pro {#experimental-deploy-helm-chart-version} +##### `version` required string pro {#experimental-deploy-vcluster-helm-chart-version} @@ -140,7 +197,7 @@ Chart defines what chart should get deployed.
-##### `username` required string pro {#experimental-deploy-helm-chart-username} +##### `username` required string pro {#experimental-deploy-vcluster-helm-chart-username} @@ -155,7 +212,7 @@ Chart defines what chart should get deployed.
-##### `password` required string pro {#experimental-deploy-helm-chart-password} +##### `password` required string pro {#experimental-deploy-vcluster-helm-chart-password} @@ -173,7 +230,7 @@ Chart defines what chart should get deployed.
-##### `release` required object pro {#experimental-deploy-helm-release} +##### `release` required object pro {#experimental-deploy-vcluster-helm-release} Release defines what release should get deployed. @@ -185,7 +242,7 @@ Release defines what release should get deployed.
-##### `name` required string pro {#experimental-deploy-helm-release-name} +##### `name` required string pro {#experimental-deploy-vcluster-helm-release-name} Name of the release @@ -200,7 +257,7 @@ Name of the release
-##### `namespace` required string pro {#experimental-deploy-helm-release-namespace} +##### `namespace` required string pro {#experimental-deploy-vcluster-helm-release-namespace} Namespace of the release @@ -218,7 +275,7 @@ Namespace of the release
-##### `values` required string pro {#experimental-deploy-helm-values} +##### `values` required string pro {#experimental-deploy-vcluster-helm-values} Values defines what values should get used. @@ -233,7 +290,7 @@ Values defines what values should get used.
-##### `timeout` required string pro {#experimental-deploy-helm-timeout} +##### `timeout` required string pro {#experimental-deploy-vcluster-helm-timeout} Timeout defines the timeout for Helm @@ -248,7 +305,7 @@ Timeout defines the timeout for Helm
-##### `bundle` required string pro {#experimental-deploy-helm-bundle} +##### `bundle` required string pro {#experimental-deploy-vcluster-helm-bundle} Bundle allows to compress the Helm chart and specify this instead of an online chart @@ -265,6 +322,9 @@ Bundle allows to compress the Helm chart and specify this instead of an online c
+
+ +
diff --git a/vcluster/_partials/config/experimental/deploy.mdx b/vcluster/_partials/config/experimental/deploy.mdx index 40856a91a..bda1a586f 100755 --- a/vcluster/_partials/config/experimental/deploy.mdx +++ b/vcluster/_partials/config/experimental/deploy.mdx @@ -11,10 +11,67 @@ Deploy allows you to configure manifests and Helm charts to deploy within the vi +
+ + +### `host` required object pro {#deploy-host} + +Host defines what manifests to deploy into the host cluster + + + + + + +
+ + +#### `manifests` required string pro {#deploy-host-manifests} + +Manifests are raw Kubernetes manifests that should get applied within the virtual cluster. + + + + + +
+ + + +
+ + +#### `manifestsTemplate` required string pro {#deploy-host-manifestsTemplate} + +ManifestsTemplate is a Kubernetes manifest template that will be rendered with vCluster values before applying it within the virtual cluster. + + + + + +
+ + +
+ + + +
+ + +### `vcluster` required object pro {#deploy-vcluster} + +VCluster defines what manifests and charts to deploy into the vCluster + + + + + +
-### `manifests` required string pro {#deploy-manifests} +#### `manifests` required string pro {#deploy-vcluster-manifests} Manifests are raw Kubernetes manifests that should get applied within the virtual cluster. @@ -29,7 +86,7 @@ Manifests are raw Kubernetes manifests that should get applied within the virtua
-### `manifestsTemplate` required string pro {#deploy-manifestsTemplate} +#### `manifestsTemplate` required string pro {#deploy-vcluster-manifestsTemplate} ManifestsTemplate is a Kubernetes manifest template that will be rendered with vCluster values before applying it within the virtual cluster. @@ -44,7 +101,7 @@ ManifestsTemplate is a Kubernetes manifest template that will be rendered with v
-### `helm` required object[] pro {#deploy-helm} +#### `helm` required object[] pro {#deploy-vcluster-helm} Helm are Helm charts that should get deployed into the virtual cluster @@ -56,7 +113,7 @@ Helm are Helm charts that should get deployed into the virtual cluster
-#### `chart` required object pro {#deploy-helm-chart} +##### `chart` required object pro {#deploy-vcluster-helm-chart} Chart defines what chart should get deployed. @@ -68,7 +125,7 @@ Chart defines what chart should get deployed.
-##### `name` required string pro {#deploy-helm-chart-name} +##### `name` required string pro {#deploy-vcluster-helm-chart-name} @@ -83,7 +140,7 @@ Chart defines what chart should get deployed.
-##### `repo` required string pro {#deploy-helm-chart-repo} +##### `repo` required string pro {#deploy-vcluster-helm-chart-repo} @@ -98,7 +155,7 @@ Chart defines what chart should get deployed.
-##### `insecure` required boolean false pro {#deploy-helm-chart-insecure} +##### `insecure` required boolean false pro {#deploy-vcluster-helm-chart-insecure} @@ -113,7 +170,7 @@ Chart defines what chart should get deployed.
-##### `version` required string pro {#deploy-helm-chart-version} +##### `version` required string pro {#deploy-vcluster-helm-chart-version} @@ -128,7 +185,7 @@ Chart defines what chart should get deployed.
-##### `username` required string pro {#deploy-helm-chart-username} +##### `username` required string pro {#deploy-vcluster-helm-chart-username} @@ -143,7 +200,7 @@ Chart defines what chart should get deployed.
-##### `password` required string pro {#deploy-helm-chart-password} +##### `password` required string pro {#deploy-vcluster-helm-chart-password} @@ -161,7 +218,7 @@ Chart defines what chart should get deployed.
-#### `release` required object pro {#deploy-helm-release} +##### `release` required object pro {#deploy-vcluster-helm-release} Release defines what release should get deployed. @@ -173,7 +230,7 @@ Release defines what release should get deployed.
-##### `name` required string pro {#deploy-helm-release-name} +##### `name` required string pro {#deploy-vcluster-helm-release-name} Name of the release @@ -188,7 +245,7 @@ Name of the release
-##### `namespace` required string pro {#deploy-helm-release-namespace} +##### `namespace` required string pro {#deploy-vcluster-helm-release-namespace} Namespace of the release @@ -206,7 +263,7 @@ Namespace of the release
-#### `values` required string pro {#deploy-helm-values} +##### `values` required string pro {#deploy-vcluster-helm-values} Values defines what values should get used. @@ -221,7 +278,7 @@ Values defines what values should get used.
-#### `timeout` required string pro {#deploy-helm-timeout} +##### `timeout` required string pro {#deploy-vcluster-helm-timeout} Timeout defines the timeout for Helm @@ -236,7 +293,7 @@ Timeout defines the timeout for Helm
-#### `bundle` required string pro {#deploy-helm-bundle} +##### `bundle` required string pro {#deploy-vcluster-helm-bundle} Bundle allows to compress the Helm chart and specify this instead of an online chart @@ -250,4 +307,7 @@ Bundle allows to compress the Helm chart and specify this instead of an online c
+
+ +
diff --git a/vcluster/_partials/config/platform.mdx b/vcluster/_partials/config/platform.mdx deleted file mode 100755 index 09cb20c98..000000000 --- a/vcluster/_partials/config/platform.mdx +++ /dev/null @@ -1,198 +0,0 @@ - -
- - -## `platform` required object pro {#platform} - -Platform holds options for connecting to vCluster Platform. - - - - - - -
- - -### `api` required object pro {#platform-api} - -API defines how vCluster can contact the platform api. - - - - - - -
- - -#### `accessKey` required string pro {#platform-api-accessKey} - -AccessKey specifies the access key as a regular text value. - - - - - -
- - - -
- - -#### `host` required string pro {#platform-api-host} - -Host specifies the platform host to use. - - - - - -
- - - -
- - -#### `insecure` required boolean false pro {#platform-api-insecure} - -Insecure specifies if the host uses a self-signed certificate. - - - - - -
- - - -
- - -#### `secretRef` required object pro {#platform-api-secretRef} - -SecretRef defines where to find the platform access key and host. By default, vCluster will search in the following locations in this precedence: -* platform.api.accessKey -* environment variable called LICENSE -* secret specified under platform.api.secretRef.name -* secret called "vcluster-platform-api-key" in the vCluster namespace - - - - - - -
- - -##### `name` required string pro {#platform-api-secretRef-name} - -Name is the name of the secret where the platform access key is stored. This defaults to vcluster-platform-api-key if undefined. - - - - - -
- - - -
- - -##### `namespace` required string pro {#platform-api-secretRef-namespace} - -Namespace defines the namespace where the access key secret should be retrieved from. If this is not equal to the namespace -where the vCluster instance is deployed, you need to make sure vCluster has access to this other namespace. - - - - - -
- - -
- - -
- - - -
- - -### `name` required string pro {#platform-name} - -Name is the name of the vCluster instance in the vCluster platform - - - - - -
- - - -
- - -### `owner` required object pro {#platform-owner} - -Owner is the desired owner of the vCluster instance within the vCluster platform. If empty will take the current user. - - - - - - -
- - -#### `user` required string pro {#platform-owner-user} - -User is the user id within the platform. This is mutually exclusive with team. - - - - - -
- - - -
- - -#### `team` required string pro {#platform-owner-team} - -Team is the team id within the platform. This is mutually exclusive with user. - - - - - -
- - -
- - - -
- - -### `project` required string pro {#platform-project} - -Project is the project within the platform where the vCluster instance should connect. - - - - - -
- - -
diff --git a/vcluster/_partials/config/sync/fromHost/virtual-scheduler-auto-syncs.mdx b/vcluster/_partials/config/sync/fromHost/virtual-scheduler-auto-syncs.mdx deleted file mode 100644 index 2709b73a1..000000000 --- a/vcluster/_partials/config/sync/fromHost/virtual-scheduler-auto-syncs.mdx +++ /dev/null @@ -1 +0,0 @@ -vCluster disables syncing by default but automatically enables this feature when you enable the [virtual scheduler](../../../vcluster-yaml/control-plane/other/advanced/virtual-scheduler/). Disabling this feature while using the virtual scheduler may result in incorrect pod scheduling. \ No newline at end of file diff --git a/vcluster/configure/vcluster-yaml/platform.mdx b/vcluster/configure/vcluster-yaml/platform.mdx deleted file mode 100644 index 970c8ad18..000000000 --- a/vcluster/configure/vcluster-yaml/platform.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -title: Platform -sidebar_label: platform -sidebar_position: 9 -description: Configure connections to your vCluster Platform installation. ---- - -import Platform from '@site/vcluster/_partials/config/platform.mdx' - -Configure connections to your vCluster Platform installation. - -## Config reference - - diff --git a/vendor/github.com/loft-sh/api/v4/pkg/apis/management/zz_generated.api.register.go b/vendor/github.com/loft-sh/api/v4/pkg/apis/management/zz_generated.api.register.go index fca1508e6..18465c800 100644 --- a/vendor/github.com/loft-sh/api/v4/pkg/apis/management/zz_generated.api.register.go +++ b/vendor/github.com/loft-sh/api/v4/pkg/apis/management/zz_generated.api.register.go @@ -1977,7 +1977,7 @@ type KioskStatus struct { } // +genclient -// +genclient:nonNamespaced +// +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type License struct { @@ -2426,7 +2426,7 @@ type SpaceInstanceStatus struct { } // +genclient -// +genclient +// +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type SpaceTemplate struct { diff --git a/vendor/github.com/loft-sh/api/v4/pkg/apis/storage/v1/devpodworkspacetemplate_types.go b/vendor/github.com/loft-sh/api/v4/pkg/apis/storage/v1/devpodworkspacetemplate_types.go index 7aeacf0d2..9525f0889 100644 --- a/vendor/github.com/loft-sh/api/v4/pkg/apis/storage/v1/devpodworkspacetemplate_types.go +++ b/vendor/github.com/loft-sh/api/v4/pkg/apis/storage/v1/devpodworkspacetemplate_types.go @@ -97,6 +97,10 @@ type DevPodWorkspaceTemplateDefinition struct { // +optional WorkspaceEnv map[string]DevPodProviderOption `json:"workspaceEnv,omitempty"` + // InitEnv are environment variables that should be available during the initialization phase of the created workspace. + // +optional + InitEnv map[string]DevPodProviderOption `json:"initEnv,omitempty"` + // InstanceTemplate holds the workspace instance template // +optional InstanceTemplate DevPodWorkspaceInstanceTemplateDefinition `json:"instanceTemplate,omitempty"` diff --git a/vendor/github.com/loft-sh/api/v4/pkg/apis/storage/v1/zz_generated.deepcopy.go b/vendor/github.com/loft-sh/api/v4/pkg/apis/storage/v1/zz_generated.deepcopy.go index 7692f58da..52f25399a 100644 --- a/vendor/github.com/loft-sh/api/v4/pkg/apis/storage/v1/zz_generated.deepcopy.go +++ b/vendor/github.com/loft-sh/api/v4/pkg/apis/storage/v1/zz_generated.deepcopy.go @@ -1728,6 +1728,13 @@ func (in *DevPodWorkspaceTemplateDefinition) DeepCopyInto(out *DevPodWorkspaceTe (*out)[key] = *val.DeepCopy() } } + if in.InitEnv != nil { + in, out := &in.InitEnv, &out.InitEnv + *out = make(map[string]DevPodProviderOption, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } in.InstanceTemplate.DeepCopyInto(&out.InstanceTemplate) return } diff --git a/vendor/github.com/loft-sh/vcluster-config/config/config.go b/vendor/github.com/loft-sh/vcluster-config/config/config.go index 0e3246ba1..da9d0158f 100644 --- a/vendor/github.com/loft-sh/vcluster-config/config/config.go +++ b/vendor/github.com/loft-sh/vcluster-config/config/config.go @@ -57,12 +57,12 @@ type Config struct { // Define which vCluster plugins to load. Plugins map[string]Plugins `json:"plugins,omitempty"` - // Platform holds options for connecting to vCluster Platform. - Platform Platform `json:"platform,omitempty"` - // Experimental features for vCluster. Configuration here might change, so be careful with this. Experimental Experimental `json:"experimental,omitempty"` + // External holds configuration for tools that are external to the vCluster. + External map[string]ExternalConfig `json:"external,omitempty"` + // Configuration related to telemetry gathered about vCluster usage. Telemetry Telemetry `json:"telemetry,omitempty"` @@ -76,10 +76,52 @@ type Config struct { Plugin map[string]Plugin `json:"plugin,omitempty"` } +// ExternalConfig holds external tool configuration +type ExternalConfig map[string]interface{} + func (c *Config) UnmarshalYAMLStrict(data []byte) error { return UnmarshalYAMLStrict(data, c) } +func (c *Config) GetPlatformConfig() (*PlatformConfig, error) { + if c.External == nil { + return &PlatformConfig{}, nil + } + if c.External["platform"] == nil { + return &PlatformConfig{}, nil + } + + yamlBytes, err := yaml.Marshal(c.External["platform"]) + if err != nil { + return nil, fmt.Errorf("%w: %w", ErrInvalidConfig, err) + } + + retConfig := &PlatformConfig{} + if err := yaml.Unmarshal(yamlBytes, retConfig); err != nil { + return nil, fmt.Errorf("%w: %w", ErrInvalidConfig, err) + } + + return retConfig, nil +} + +func (c *Config) SetPlatformConfig(platformConfig *PlatformConfig) error { + yamlBytes, err := yaml.Marshal(platformConfig) + if err != nil { + return fmt.Errorf("%w: %w", ErrInvalidConfig, err) + } + + setConfig := ExternalConfig{} + if err := yaml.Unmarshal(yamlBytes, &setConfig); err != nil { + return fmt.Errorf("%w: %w", ErrInvalidConfig, err) + } + + if c.External == nil { + c.External = map[string]ExternalConfig{} + } + c.External["platform"] = setConfig + return nil +} + // BackingStoreType returns the backing store type of the vCluster. // If no backing store is enabled, it returns StoreTypeUnknown. func (c *Config) BackingStoreType() StoreType { @@ -1117,6 +1159,11 @@ type ControlPlanePersistence struct { // VolumeClaimTemplates defines the volumeClaimTemplates for the statefulSet VolumeClaimTemplates []map[string]interface{} `json:"volumeClaimTemplates,omitempty"` + // BinariesVolume defines a binaries volume that is used to retrieve + // distro specific executables to be run by the syncer controller. + // This volume doesn't need to be persistent. + BinariesVolume []map[string]interface{} `json:"binariesVolume,omitempty"` + // AddVolumes defines extra volumes for the pod AddVolumes []map[string]interface{} `json:"addVolumes,omitempty"` @@ -1627,6 +1674,22 @@ func (e ExperimentalSyncSettings) JSONSchemaExtend(base *jsonschema.Schema) { } type ExperimentalDeploy struct { + // Host defines what manifests to deploy into the host cluster + Host ExperimentalDeployHost `json:"host,omitempty"` + + // VCluster defines what manifests and charts to deploy into the vCluster + VCluster ExperimentalDeployVCluster `json:"vcluster,omitempty"` +} + +type ExperimentalDeployHost struct { + // Manifests are raw Kubernetes manifests that should get applied within the virtual cluster. + Manifests string `json:"manifests,omitempty"` + + // ManifestsTemplate is a Kubernetes manifest template that will be rendered with vCluster values before applying it within the virtual cluster. + ManifestsTemplate string `json:"manifestsTemplate,omitempty"` +} + +type ExperimentalDeployVCluster struct { // Manifests are raw Kubernetes manifests that should get applied within the virtual cluster. Manifests string `json:"manifests,omitempty"` @@ -1671,50 +1734,19 @@ type ExperimentalDeployHelmChart struct { Password string `json:"password,omitempty"` } -type Platform struct { - // API defines how vCluster can contact the platform api. - API PlatformAPI `json:"api,omitempty"` - - // Name is the name of the vCluster instance in the vCluster platform - Name string `json:"name,omitempty"` - - // Owner is the desired owner of the vCluster instance within the vCluster platform. If empty will take the current user. - Owner PlatformOwner `json:"owner,omitempty"` - - // Project is the project within the platform where the vCluster instance should connect. - Project string `json:"project,omitempty"` -} - -type PlatformOwner struct { - // User is the user id within the platform. This is mutually exclusive with team. - User string `json:"user,omitempty"` - - // Team is the team id within the platform. This is mutually exclusive with user. - Team string `json:"team,omitempty"` -} - -type PlatformAPI struct { - // AccessKey specifies the access key as a regular text value. - AccessKey string `json:"accessKey,omitempty"` - - // Host specifies the platform host to use. - Host string `json:"host,omitempty"` - - // Insecure specifies if the host uses a self-signed certificate. - Insecure bool `json:"insecure,omitempty"` - - // SecretRef defines where to find the platform access key and host. By default, vCluster will search in the following locations in this precedence: +type PlatformConfig struct { + // APIKey defines where to find the platform access key and host. By default, vCluster will search in the following locations in this precedence: // * platform.api.accessKey // * environment variable called LICENSE - // * secret specified under platform.api.secretRef.name + // * secret specified under external.platform.apiKey.secretName // * secret called "vcluster-platform-api-key" in the vCluster namespace - SecretRef PlatformAccessKeySecretReference `json:"secretRef,omitempty"` + APIKey PlatformAPIKey `json:"apiKey,omitempty"` } -// PlatformAccessKeySecretReference defines where to find the platform access key. The secret key name doesn't matter as long as the secret only contains a single key. -type PlatformAccessKeySecretReference struct { - // Name is the name of the secret where the platform access key is stored. This defaults to vcluster-platform-api-key if undefined. - Name string `json:"name,omitempty"` +// PlatformAPIKey defines where to find the platform access key. The secret key name doesn't matter as long as the secret only contains a single key. +type PlatformAPIKey struct { + // SecretName is the name of the secret where the platform access key is stored. This defaults to vcluster-platform-api-key if undefined. + SecretName string `json:"secretName,omitempty"` // Namespace defines the namespace where the access key secret should be retrieved from. If this is not equal to the namespace // where the vCluster instance is deployed, you need to make sure vCluster has access to this other namespace. diff --git a/vendor/github.com/loft-sh/vcluster-config/config/values.yaml b/vendor/github.com/loft-sh/vcluster-config/config/values.yaml index 1d7b1488a..7c4ea91a1 100644 --- a/vendor/github.com/loft-sh/vcluster-config/config/values.yaml +++ b/vendor/github.com/loft-sh/vcluster-config/config/values.yaml @@ -23,7 +23,7 @@ sync: rewriteHosts: enabled: true initContainer: - image: "library/alpine:3.13.1" + image: "library/alpine:3.20" resources: limits: cpu: 30m @@ -321,7 +321,7 @@ controlPlane: ephemeral-storage: 8Gi memory: 2Gi requests: - ephemeral-storage: 200Mi + ephemeral-storage: 300Mi cpu: 200m memory: 256Mi @@ -352,6 +352,9 @@ controlPlane: volumeClaimTemplates: [] addVolumeMounts: [] addVolumes: [] + binariesVolume: + - name: binaries + emptyDir: {} enableServiceLinks: true @@ -495,6 +498,8 @@ exportKubeConfig: name: "" namespace: "" +external: {} + plugins: {} experimental: @@ -512,9 +517,13 @@ experimental: headless: false deploy: - manifests: "" - manifestsTemplate: '' - helm: [] + host: + manifests: "" + manifestsTemplate: "" + vcluster: + manifests: "" + manifestsTemplate: "" + helm: [] genericSync: clusterRole: @@ -522,14 +531,5 @@ experimental: role: extraRules: [] -platform: - api: - accessKey: "" - host: "" - insecure: false - secretRef: - name: "" - namespace: "" - telemetry: enabled: true diff --git a/vendor/modules.txt b/vendor/modules.txt index 717743221..0f3539c2b 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -158,12 +158,12 @@ github.com/json-iterator/go # github.com/loft-sh/admin-apis v0.0.0-20240203010124-3600c1c582a8 ## explicit; go 1.21.1 github.com/loft-sh/admin-apis/pkg/licenseapi -# github.com/loft-sh/agentapi/v4 v4.0.0-alpha.11 +# github.com/loft-sh/agentapi/v4 v4.0.0-alpha.16 ## explicit; go 1.22.4 github.com/loft-sh/agentapi/v4/pkg/apis/loft/cluster github.com/loft-sh/agentapi/v4/pkg/apis/loft/cluster/v1 github.com/loft-sh/agentapi/v4/pkg/apis/loft/storage/v1 -# github.com/loft-sh/api/v4 v4.0.0-alpha.6.0.20240618092712-6b5276c8407d +# github.com/loft-sh/api/v4 v4.0.0-alpha.16 ## explicit; go 1.22.4 github.com/loft-sh/api/v4/pkg/apis/audit/v1 github.com/loft-sh/api/v4/pkg/apis/management @@ -174,7 +174,7 @@ github.com/loft-sh/api/v4/pkg/managerfactory # github.com/loft-sh/apiserver v0.0.0-20240607231110-634aeeab2b36 ## explicit; go 1.22.4 github.com/loft-sh/apiserver/pkg/builders -# github.com/loft-sh/vcluster-config v0.0.0-20240522133807-821170af4934 +# github.com/loft-sh/vcluster-config v0.0.0-20240626114406-e551a685416f ## explicit; go 1.22.0 github.com/loft-sh/vcluster-config/config # github.com/mailru/easyjson v0.7.7 From 9e335cffea66e04f6573603d08e05844150a4c0a Mon Sep 17 00:00:00 2001 From: Fabian Kramm Date: Thu, 27 Jun 2024 16:07:43 +0200 Subject: [PATCH 2/2] fix: small improvements --- vcluster/configure/vcluster-yaml/README.mdx | 2 - .../vcluster-yaml/experimental/deploy.mdx | 122 +++++++++++------- .../sync/from-host/csi-drivers.mdx | 5 +- .../sync/from-host/csi-nodes.mdx | 7 +- .../sync/from-host/csi-storage-capacities.mdx | 5 +- .../integrations/metrics/metrics-server.mdx | 8 +- 6 files changed, 86 insertions(+), 63 deletions(-) diff --git a/vcluster/configure/vcluster-yaml/README.mdx b/vcluster/configure/vcluster-yaml/README.mdx index a8d36c6b4..88b6b0197 100644 --- a/vcluster/configure/vcluster-yaml/README.mdx +++ b/vcluster/configure/vcluster-yaml/README.mdx @@ -14,7 +14,6 @@ import Observability from '@site/vcluster/_partials/config/observability.mdx' import ControlPlane from '@site/vcluster/_partials/config/controlPlane.mdx' import RBAC from '@site/vcluster/_partials/config/rbac.mdx' import Plugins from '@site/vcluster/_partials/config/plugins.mdx' -import Platform from '@site/vcluster/_partials/config/platform.mdx' import Experimental from '@site/vcluster/_partials/config/experimental.mdx' import Telemetry from '@site/vcluster/_partials/config/telemetry.mdx' import DeployChanges from '@site/vcluster/_partials/deploy/deploy-changes.mdx' @@ -40,6 +39,5 @@ Configure your vCluster installation in a `vcluster.yaml` configuration file. Th - diff --git a/vcluster/configure/vcluster-yaml/experimental/deploy.mdx b/vcluster/configure/vcluster-yaml/experimental/deploy.mdx index 74531dd3a..f9ea0a7dc 100644 --- a/vcluster/configure/vcluster-yaml/experimental/deploy.mdx +++ b/vcluster/configure/vcluster-yaml/experimental/deploy.mdx @@ -7,82 +7,112 @@ description: Configuration for ... import ExperimentalDeploy from '@site/vcluster/_partials/config/experimental/deploy.mdx' -## Apply manifests on initialization +## Apply manifests on initialization in vCluster Apply Kubernetes manifests when the virtual cluster starts. This is useful for configuring internal vCluster resources. For example: ```yaml -deploy: - manifests: |- - apiVersion: v1 - kind: Service - ... - apiVersion: v1 - kind: ConfigMap - ... +experimental: + deploy: + vcluster: + manifests: |- + apiVersion: v1 + kind: Service + ... + apiVersion: v1 + kind: ConfigMap + ... ``` -## Apply manifest templates on initialization +## Apply manifest templates on initialization in vCluster Add a manifest template that uses Helm values. For example: ```yaml -deploy: - manifestsTemplate: |- - apiVersion: v1 - kind: ConfigMap - data: - example: {{ .Release.Name }} +experimental: + deploy: + vcluster: + manifestsTemplate: |- + apiVersion: v1 + kind: ConfigMap + data: + example: {{ .Release.Name }} ``` -## Apply Helm charts on initialization +## Apply Helm charts on initialization in vCluster ### Upstream chart Apply a Helm chart from public and private upstream chart repositories. This example deploys from public and private: ```yaml -deploy: - helm: - # public chart - - chart: - name: cert-manager - repo: https://charts.jetstack.io - version: v1.8.0 - # optional field - values: |- - installCRDs: true - release: - name: cert-manager - namespace: cert-manager - # private chart - - chart: - name: my-chart - repo: https://my-company.com/private-repo/ - version: 1.0 - username: my-username - password: my-password - release: - name: my-release - namespace: my-release-namespace +experimental: + deploy: + vcluster: + helm: + # public chart + - chart: + name: cert-manager + repo: https://charts.jetstack.io + version: v1.8.0 + # optional field + values: |- + installCRDs: true + release: + name: cert-manager + namespace: cert-manager + # private chart + - chart: + name: my-chart + repo: https://my-company.com/private-repo/ + version: 1.0 + username: my-username + password: my-password + release: + name: my-release + namespace: my-release-namespace ``` ### Local chart -Apply a chart that exists locally as a compressed `tar` archive. +Apply a chart that exists locally as a compressed `tar` archive. ```yaml -deploy: - helm: - bundle: COMPRESSED_STRING +experimental: + deploy: + vcluster: + helm: + bundle: COMPRESSED_STRING ``` Replace _`COMPRESSED_STRING`_ with a compressed base64 string that has the chart's contents, which are then directly embedded in the vCluster values file. +## Apply manifests on initialization in host + +Apply Kubernetes manifests when the virtual cluster starts into the host namespace. This is useful for configuring external vCluster resources. For example: + +```yaml +experimental: + deploy: + host: + manifests: |- + apiVersion: v1 + kind: Secret + ... + apiVersion: v1 + kind: ConfigMap + ... + manifestsTemplate: |- + apiVersion: v1 + kind: ConfigMap + data: + example: {{ .Release.Name }} +``` + ## Config reference :::info -The `init.helm[].chart.version` scheme only supports absolute versions and not any constraints. +The `experimental.deploy.vcluster.helm[].chart.version` scheme only supports absolute versions and not any constraints. ::: - \ No newline at end of file + diff --git a/vcluster/configure/vcluster-yaml/sync/from-host/csi-drivers.mdx b/vcluster/configure/vcluster-yaml/sync/from-host/csi-drivers.mdx index de1244938..6b4874398 100644 --- a/vcluster/configure/vcluster-yaml/sync/from-host/csi-drivers.mdx +++ b/vcluster/configure/vcluster-yaml/sync/from-host/csi-drivers.mdx @@ -5,7 +5,6 @@ sidebar_position: 6 description: Configuration for ... --- -import DefaultNote from '@site/vcluster/_partials/config/sync/fromHost/virtual-scheduler-auto-syncs.mdx' import EnableSwitch from '@site/vcluster/_partials/config/sync/fromHost/csiDrivers.mdx' {/* @@ -20,9 +19,7 @@ Sync [CSIDriver](https://kubernetes.io/blog/2019/01/15/container-storage-interfa ## Default value -Default: `enabled: auto`. - - +Default: `enabled: auto`. ## Sync CSIDrivers from the host to virtual cluster diff --git a/vcluster/configure/vcluster-yaml/sync/from-host/csi-nodes.mdx b/vcluster/configure/vcluster-yaml/sync/from-host/csi-nodes.mdx index fdc998943..539071a6f 100644 --- a/vcluster/configure/vcluster-yaml/sync/from-host/csi-nodes.mdx +++ b/vcluster/configure/vcluster-yaml/sync/from-host/csi-nodes.mdx @@ -5,7 +5,6 @@ sidebar_position: 5 description: Configuration for ... --- -import DefaultNote from '@site/vcluster/_partials/config/sync/fromHost/virtual-scheduler-auto-syncs.mdx' import EnableSwitch from '@site/vcluster/_partials/config/sync/fromHost/csiNodes.mdx' {/* @@ -20,9 +19,7 @@ Sync [CSINode](https://kubernetes.io/docs/reference/kubernetes-api/config-and-st ## Default value -Default: `enabled: auto`. - - +Default: `enabled: auto`. ## Sync CSINodes from the host to virtual cluster @@ -37,4 +34,4 @@ sync: ## Config reference - \ No newline at end of file + diff --git a/vcluster/configure/vcluster-yaml/sync/from-host/csi-storage-capacities.mdx b/vcluster/configure/vcluster-yaml/sync/from-host/csi-storage-capacities.mdx index 74c75f3f9..75af732d3 100644 --- a/vcluster/configure/vcluster-yaml/sync/from-host/csi-storage-capacities.mdx +++ b/vcluster/configure/vcluster-yaml/sync/from-host/csi-storage-capacities.mdx @@ -5,7 +5,6 @@ sidebar_position: 7 description: Configuration for ... --- -import DefaultNote from '@site/vcluster/_partials/config/sync/fromHost/virtual-scheduler-auto-syncs.mdx' import EnableSwitch from '@site/vcluster/_partials/config/sync/fromHost/csiStorageCapacities.mdx' {/* @@ -21,8 +20,6 @@ Sync [CSIStorageCapacity](https://kubernetes.io/docs/concepts/storage/storage-ca Default: `enabled: auto`. - - ## Sync CSIStorageCapacities from the host to virtual cluster Configure `enabled: true` if you aren't using the virtual schedular but want to sync CSIStorageCapacity resources. @@ -36,4 +33,4 @@ sync: ## Config reference - \ No newline at end of file + diff --git a/vcluster/integrations/metrics/metrics-server.mdx b/vcluster/integrations/metrics/metrics-server.mdx index b3da76c85..2c36bd627 100644 --- a/vcluster/integrations/metrics/metrics-server.mdx +++ b/vcluster/integrations/metrics/metrics-server.mdx @@ -1,6 +1,6 @@ --- -title: Metrics Server -sidebar_label: Metrics Server +title: Metrics Server +sidebar_label: Metrics Server sidebar_position: 3 --- @@ -19,6 +19,8 @@ kube-system coredns-854c77959c-q5878 3m 17Mi kube-system metrics-server-5fbdc54f8c-fgrqk 0m 6Mi ``` +:::info K3s Errors + If you see the below error after installing metrics-server (check [k3s#5334](https://github.com/k3s-io/k3s/issues/5344) for more information): ``` @@ -42,6 +44,8 @@ and apply the patch with kubectl: kubectl patch deployment metrics-server --patch-file metrics_patch.yaml -n kube-system ``` +::: + ### How does it work? By default, vCluster will create a service for each node that redirects incoming traffic from within the vCluster to the node kubelet to vCluster itself. This means that if workloads within the vCluster try to scrape node metrics the traffic reaches vCluster first. Vcluster will redirect the incoming request to the host cluster, rewrite the response (pod names, pod namespaces etc) and return it to the requester.