diff --git a/.werft/jobs/build/installer/installer.ts b/.werft/jobs/build/installer/installer.ts index ad05082ec75243..8ac31bd8d05fb4 100644 --- a/.werft/jobs/build/installer/installer.ts +++ b/.werft/jobs/build/installer/installer.ts @@ -248,10 +248,9 @@ EOF`); private configureConfigCat(slice: string) { // This key is not a secret, it is a unique identifier of our ConfigCat application - exec( - `yq w -i ${this.options.installerConfigPath} experimental.webapp.configcatKey "WBLaCPtkjkqKHlHedziE9g/LEAOCNkbuUKiqUZAcVg7dw"`, - { slice: slice }, - ); + exec(`yq w -i ${this.options.installerConfigPath} experimental.webapp.configcatKey "WBLaCPtkjkqKHlHedziE9g/LEAOCNkbuUKiqUZAcVg7dw"`, { slice: slice }); + exec(`yq w -i ${this.options.installerConfigPath} experimental.webapp.configcatBaseUrl "https://cdn-global.configcat.com"`,{ slice: slice }); + exec(`yq w -i ${this.options.installerConfigPath} experimental.webapp.configcatPollInterval "10m"`,{ slice: slice }); } private includeAnalytics(slice: string): void { diff --git a/install/installer/pkg/components/proxy/deployment.go b/install/installer/pkg/components/proxy/deployment.go index a9139545db2b35..99dda8a75d04d3 100644 --- a/install/installer/pkg/components/proxy/deployment.go +++ b/install/installer/pkg/components/proxy/deployment.go @@ -119,6 +119,30 @@ func deployment(ctx *common.RenderContext) ([]runtime.Object, error) { return nil }) + env := common.CustomizeEnvvar(ctx, Component, common.MergeEnv( + common.DefaultEnv(&ctx.Config), + []corev1.EnvVar{{ + Name: "PROXY_DOMAIN", + Value: ctx.Config.Domain, + }}, + )) + + _ = ctx.WithExperimental(func(cfg *experimental.Config) error { + if cfg.WebApp != nil { + env = append(env, corev1.EnvVar{ + Name: "CONFIGCAT_SDK_KEY", + Value: cfg.WebApp.ConfigcatKey, + }, corev1.EnvVar{ + Name: "CONFIGCAT_BASE_URL", + Value: cfg.WebApp.ConfigcatBaseUrl, + }, corev1.EnvVar{ + Name: "CONFIGCAT_POLL_INTERVAL", + Value: cfg.WebApp.ConfigcatPollInterval, + }) + } + return nil + }) + const kubeRbacProxyContainerName = "kube-rbac-proxy" return []runtime.Object{ &appsv1.Deployment{ @@ -244,13 +268,7 @@ func deployment(ctx *common.RenderContext) ([]runtime.Object, error) { FailureThreshold: 3, }, VolumeMounts: volumeMounts, - Env: common.CustomizeEnvvar(ctx, Component, common.MergeEnv( - common.DefaultEnv(&ctx.Config), - []corev1.EnvVar{{ - Name: "PROXY_DOMAIN", - Value: ctx.Config.Domain, - }}, - )), + Env: env, }}, }, }, diff --git a/install/installer/pkg/config/v1/experimental/experimental.go b/install/installer/pkg/config/v1/experimental/experimental.go index fb65cc3bd118e6..b17563141e8635 100644 --- a/install/installer/pkg/config/v1/experimental/experimental.go +++ b/install/installer/pkg/config/v1/experimental/experimental.go @@ -172,6 +172,9 @@ type WebAppConfig struct { DisableMigration bool `json:"disableMigration"` Usage *UsageConfig `json:"usage,omitempty"` ConfigcatKey string `json:"configcatKey"` + ConfigcatBaseUrl string `json:"configcatBaseUrl"` + ConfigcatPollInterval string `json:"configcatPollInterval"` + ConfigcatDefaultConfig string `json:"configcatDefaultConfig"` WorkspaceClasses []WebAppWorkspaceClass `json:"workspaceClasses"` }