Path: blob/main/install/installer/pkg/config/v1/experimental/experimental.go
2501 views
// Copyright (c) 2021 Gitpod GmbH. All rights reserved.1// Licensed under the GNU Affero General Public License (AGPL).2// See License.AGPL.txt in the project root for license information.34// experimental bundles all internal bits of configuration for which we do not offer5// support. We use those flags internally to operate SaaS, but do not expect anyone6// outside of Gitpod to use.7//8// Changes in this section will NOT be backwards compatible change at will without prior notice.9// If you use any setting herein, you forfeit support from Gitpod.10package experimental1112import (13"time"1415agentSmith "github.com/gitpod-io/gitpod/agent-smith/pkg/config"16"github.com/gitpod-io/gitpod/common-go/grpc"17db "github.com/gitpod-io/gitpod/components/gitpod-db/go"18"github.com/gitpod-io/gitpod/ws-daemon/pkg/cpulimit"19corev1 "k8s.io/api/core/v1"20"k8s.io/apimachinery/pkg/api/resource"21metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"22)2324// Config contains all experimental configuration.25type Config struct {26Workspace *WorkspaceConfig `json:"workspace,omitempty"`27WebApp *WebAppConfig `json:"webapp,omitempty"`28IDE *IDEConfig `json:"ide,omitempty"` // @deprecated29Common *CommonConfig `json:"common,omitempty"` // @deprecated30Overrides *[]Overrides `json:"overrides,omitempty"`31AgentSmith *agentSmith.Config `json:"agentSmith,omitempty"` // @deprecated32}3334type CommonConfig struct {35// Deprecated.36PodConfig map[string]*PodConfig `json:"podConfig,omitempty"`37}3839type PodConfig struct {40Replicas *int32 `json:"replicas,omitempty"`41Resources map[string]*corev1.ResourceRequirements `json:"resources,omitempty"`42}4344type NodeToContainerMappingValues struct {45Path string `json:"path"`46Value string `json:"value"`47}4849type WorkspaceConfig struct {50Tracing *Tracing `json:"tracing,omitempty"`51Stage string `json:"stage,omitempty"`52SchedulerName string `json:"schedulerName,omitempty"`53HostURL string `json:"hostURL,omitempty"`54WorkspaceClusterHost string `json:"workspaceClusterHost,omitempty"`55WorkspaceURLTemplate string `json:"workspaceURLTemplate,omitempty"`56WorkspacePortURLTemplate string `json:"workspacePortURLTemplate,omitempty"`5758WorkspaceCIDR string `json:"workspaceCIDR,omitempty"`5960CPULimits struct {61Enabled bool `json:"enabled"`62NodeCPUBandwidth resource.Quantity `json:"nodeBandwidth"`63Limit resource.Quantity `json:"limit"`64BurstLimit resource.Quantity `json:"burstLimit"`65}66IOLimits struct {67WriteBWPerSecond resource.Quantity `json:"writeBandwidthPerSecond"`68ReadBWPerSecond resource.Quantity `json:"readBandwidthPerSecond"`69WriteIOPS int64 `json:"writeIOPS"`70ReadIOPS int64 `json:"readIOPS"`71} `json:"ioLimits"`72NetworkLimits struct {73Enabled bool `json:"enabled"`74Enforce bool `json:"enforce"`75ConnectionsPerMinute int64 `json:"connectionsPerMinute"`76BucketSize int64 `json:"bucketSize"`77} `json:"networkLimits"`78OOMScores struct {79Enabled bool `json:"enabled"`80Tier1 int `json:"tier1"`81Tier2 int `json:"tier2"`82} `json:"oomScores"`8384ProcLimit int64 `json:"procLimit"`8586WSManagerRateLimits map[string]grpc.RateLimit `json:"wsManagerRateLimits,omitempty"`8788RegistryFacade struct {89IPFSCache struct {90Enabled bool `json:"enabled"`91IPFSAddr string `json:"ipfsAddr"`92} `json:"ipfsCache"`93RedisCache struct {94Enabled bool `json:"enabled"`95SingleHostAddress string `json:"singleHostAddr"`96Username string `json:"username"`97PasswordSecret string `json:"passwordSecret"`98UseTLS bool `json:"useTLS"`99InsecureSkipVerify bool `json:"insecureSkipVerify"`100} `json:"redisCache"`101} `json:"registryFacade"`102103WSDaemon struct {104Runtime struct {105NodeToContainerMapping []NodeToContainerMappingValues `json:"nodeToContainerMapping"`106} `json:"runtime"`107} `json:"wsDaemon"`108109WorkspaceClasses map[string]WorkspaceClass `json:"classes,omitempty"`110PreferredWorkspaceClass string `json:"preferredWorkspaceClass,omitempty"`111112WSProxy struct {113IngressHeader string `json:"ingressHeader"`114BlobServeHost string `json:"blobServeHost"`115GitpodInstallationHostName string `json:"gitpodInstallationHostName"`116GitpodInstallationWorkspaceHostSuffix string `json:"gitpodInstallationWorkspaceHostSuffix"`117GitpodInstallationWorkspaceHostSuffixRegex string `json:"gitpodInstallationWorkspaceHostSuffixRegex"`118} `json:"wsProxy"`119120ContentService struct {121// Deprecated122UsageReportBucketName string `json:"usageReportBucketName"`123} `json:"contentService"`124125EnableProtectedSecrets *bool `json:"enableProtectedSecrets"`126127ImageBuilderMk3 struct {128BaseImageRepositoryName string `json:"baseImageRepositoryName"`129WorkspaceImageRepositoryName string `json:"workspaceImageRepositoryName"`130} `json:"imageBuilderMk3"`131}132133type WorkspaceClass struct {134Name string `json:"name" validate:"required"`135Description string `json:"description"`136Resources WorkspaceResources `json:"resources" validate:"required"`137Templates WorkspaceTemplates `json:"templates,omitempty"`138}139140type WorkspaceResources struct {141Requests corev1.ResourceList `json:"requests" validate:"required"`142Limits WorkspaceLimits `json:"limits,omitempty"`143}144145type WorkspaceLimits struct {146Cpu WorkspaceCpuLimits `json:"cpu"`147Memory string `json:"memory"`148Storage string `json:"storage"`149EphemeralStorage string `json:"ephemeral-storage"`150}151152type WorkspaceCpuLimits struct {153Buckets []cpulimit.Bucket `json:"buckets"`154MinLimit string `json:"min"`155BurstLimit string `json:"burst"`156}157158type WorkspaceTemplates struct {159Default *corev1.Pod `json:"default"`160Prebuild *corev1.Pod `json:"prebuild"`161ImageBuild *corev1.Pod `json:"imagebuild"`162Regular *corev1.Pod `json:"regular"`163}164165type StripePriceIDs struct {166EUR string `json:"eur"`167USD string `json:"usd"`168}169170type StripeConfig struct {171IndividualUsagePriceIDs StripePriceIDs `json:"individualUsagePriceIds"`172TeamUsagePriceIDs StripePriceIDs `json:"teamUsagePriceIds"`173}174175type IAMConfig struct {176OIDCClientsSecretName string `json:"oidsClientsConfigSecret,omitempty"`177}178179type SpiceDBConfig struct {180Enabled bool `json:"enabled"`181182DisableMigrations bool `json:"disableMigrations"`183184// Reference to a k8s secret which contains a "presharedKey" for authentication with SpiceDB185// Required.186SecretRef string `json:"secretRef"`187}188189type RedisConfig struct {190Address string `json:"address,omitempty"`191Username string `json:"username,omitempty"`192SecretRef string `json:"secretRef,omitempty"`193}194195type WebAppConfig struct {196PublicAPI *PublicAPIConfig `json:"publicApi,omitempty"`197198// PublicURL lets you override the publically reachable endpoints of gitpod (currently only public api endpoint)199// If not set, default will be api.${Domain}200PublicURL string `json:"publicUrl,omitempty"`201202Server *ServerConfig `json:"server,omitempty"`203ProxyConfig *ProxyConfig `json:"proxy,omitempty"`204WorkspaceManagerBridge *WsManagerBridgeConfig `json:"wsManagerBridge,omitempty"`205Tracing *Tracing `json:"tracing,omitempty"`206UsePodAntiAffinity bool `json:"usePodAntiAffinity"`207DisableMigration bool `json:"disableMigration"`208Usage *UsageConfig `json:"usage,omitempty"`209ConfigcatKey string `json:"configcatKey"`210WorkspaceClasses []WebAppWorkspaceClass `json:"workspaceClasses"`211Stripe *StripeConfig `json:"stripe,omitempty"`212IAM *IAMConfig `json:"iam,omitempty"`213SpiceDB *SpiceDBConfig `json:"spicedb,omitempty"`214CertmanagerNamespaceOverride string `json:"certmanagerNamespaceOverride,omitempty"`215Redis *RedisConfig `json:"redis"`216217// ProxySettings is used if the gitpod cell uses some proxy for connectivity218ProxySettings *ProxySettings `json:"proxySettings"`219}220221type ProxySettings struct {222HttpProxy string `json:"http_proxy"`223HttpsProxy string `json:"https_proxy"`224// NoProxy setting should be used for the CIDRs and hostnames that should be not using the proxy URLs225NoProxy string `json:"no_proxy"`226}227228type WorkspaceDefaults struct {229// @deprecated use workspace.workspaceImage instead230WorkspaceImage string `json:"workspaceImage"`231}232233type OAuthServer struct {234JWTSecret string `json:"jwtSecret"`235}236237type Session struct {238Secret string `json:"secret"`239}240241type GithubApp struct {242AppId int32 `json:"appId"`243AuthProviderId string `json:"authProviderId"`244BaseUrl string `json:"baseUrl"`245CertPath string `json:"certPath"`246Enabled bool `json:"enabled"`247LogLevel string `json:"logLevel"`248MarketplaceName string `json:"marketplaceName"`249WebhookSecret string `json:"webhookSecret"`250CertSecretName string `json:"certSecretName"`251}252253type WsManagerBridgeConfig struct {254SkipSelf bool `json:"skipSelf"`255}256257type ServerConfig struct {258WorkspaceDefaults WorkspaceDefaults `json:"workspaceDefaults"`259OAuthServer OAuthServer `json:"oauthServer"`260Session Session `json:"session"`261GithubApp *GithubApp `json:"githubApp"`262StripeSecret string `json:"stripeSecret"`263StripeConfig string `json:"stripeConfig"`264LinkedInSecret string `json:"linkedInSecret"`265DisableDynamicAuthProviderLogin bool `json:"disableDynamicAuthProviderLogin"`266EnableLocalApp *bool `json:"enableLocalApp"`267RunDbDeleter *bool `json:"runDbDeleter"`268DisableWorkspaceGarbageCollection bool `json:"disableWorkspaceGarbageCollection"`269DisableCompleteSnapshotJob bool `json:"disableCompleteSnapshotJob"`270InactivityPeriodForReposInDays *int `json:"inactivityPeriodForReposInDays"`271// deprecated: use IsDedicatedInstallation instead272IsSingleOrgInstallation bool `json:"isSingleOrgInstallation"`273IsDedicatedInstallation bool `json:"isDedicatedInstallation"`274275// @deprecated use containerRegistry.privateBaseImageAllowList instead276DefaultBaseImageRegistryWhiteList []string `json:"defaultBaseImageRegistryWhitelist"`277278GoogleCloudProfilerEnabled bool `json:"gcpProfilerEnabled,omitempty"`279}280281type ProxyConfig struct {282StaticIP string `json:"staticIP"`283ServiceAnnotations map[string]string `json:"serviceAnnotations"`284285// @deprecated use components.proxy.service.serviceType instead286ServiceType *corev1.ServiceType `json:"serviceType,omitempty" validate:"omitempty,service_config_type"`287288Configcat *ConfigcatProxyConfig `json:"configcat,omitempty"`289290AnalyticsPlugin *AnalyticsPluginConfig `json:"analyticsPlugin,omitempty"`291292FrontendDevEnabled bool `json:"frontendDevEnabled"`293}294295type ConfigcatProxyConfig struct {296BaseUrl string `json:"baseUrl"`297PollInterval string `json:"pollInterval"`298FromConfigMap string `json:"fromConfigMap"`299}300301type AnalyticsPluginConfig struct {302TrustedSegmentKey string `json:"trustedSegmentKey"`303UntrustedSegmentKey string `json:"untrustedSegmentKey"`304SegmentEndpoint string `json:"segmentEndpoint,omitempty"`305}306307type PublicAPIConfig struct {308// Name of the kubernetes secret to use for Stripe secrets309StripeSecretName string `json:"stripeSecretName"`310311// Name of the kubernetes secret to use for signature of Personal Access Tokens312PersonalAccessTokenSigningKeySecretName string `json:"personalAccessTokenSigningKeySecretName"`313}314315type UsageConfig struct {316Enabled bool `json:"enabled"`317Schedule string `json:"schedule"`318ResetUsageSchedule string `json:"resetUsageSchedule"`319BillInstancesAfter *time.Time `json:"billInstancesAfter"`320DefaultSpendingLimit *db.DefaultSpendingLimit `json:"defaultSpendingLimit"`321CreditsPerMinuteByWorkspaceClass map[string]float64 `json:"creditsPerMinuteByWorkspaceClass"`322}323324type WebAppWorkspaceClass struct {325Id string `json:"id"`326Category string `json:"category"`327DisplayName string `json:"displayName"`328Description string `json:"description"`329PowerUps uint32 `json:"powerups"`330IsDefault bool `json:"isDefault"`331Deprecated bool `json:"deprecated"`332Marker map[string]bool `json:"marker,omitempty"`333Credits *WorkspaceClassCredits `json:"credits,omitempty"`334}335336type WorkspaceClassCredits struct {337PerMinute float64 `json:"perMinute,omitempty"`338}339340// @deprecated341type IDEConfig struct {342// Disable resolution of latest images and use bundled latest versions instead343ResolveLatest *bool `json:"resolveLatest,omitempty"`344IDEProxyConfig *IDEProxyConfig `json:"ideProxy,omitempty"`345VSXProxyConfig *VSXProxyConfig `json:"openvsxProxy,omitempty"`346IDEMetricsConfig *IDEMetricsConfig `json:"ideMetrics,omitempty"`347}348349// @deprecated350type IDEProxyConfig struct {351ServiceAnnotations map[string]string `json:"serviceAnnotations"`352}353354// @deprecated355type IDEMetricsConfig struct {356EnabledErrorReporting bool `json:"enabledErrorReporting,omitempty"`357}358359// @deprecated360type VSXProxyConfig struct {361ServiceAnnotations map[string]string `json:"serviceAnnotations"`362}363364type TracingSampleType string365366type Tracing struct {367SamplerType *TracingSampleType `json:"samplerType,omitempty" validate:"omitempty,tracing_sampler_type"`368SamplerParam *float64 `json:"samplerParam,omitempty" validate:"required_with=SamplerType"`369}370371// Values taken from https://github.com/jaegertracing/jaeger-client-go/blob/967f9c36f0fa5a2617c9a0993b03f9a3279fadc8/config/config.go#L71372const (373TracingSampleTypeConst TracingSampleType = "const"374TracingSampleTypeProbabilistic TracingSampleType = "probabilistic"375TracingSampleTypeRateLimiting TracingSampleType = "rateLimiting"376TracingSampleTypeRemote TracingSampleType = "remote"377)378379type Overrides struct {380metav1.TypeMeta `json:",inline"`381Metadata metav1.ObjectMeta `json:"metadata"`382Override map[string]any `json:"override"`383}384385386