diff --git a/NOTICE b/NOTICE index 2607ce1a..644932ff 100644 --- a/NOTICE +++ b/NOTICE @@ -155,9 +155,9 @@ License URL: https://github.com/cloudflare/circl/blob/v1.6.3/LICENSE ---------- Module: github.com/codesphere-cloud/cs-go -Version: v0.21.1 +Version: v0.22.0 License: Apache-2.0 -License URL: https://github.com/codesphere-cloud/cs-go/blob/v0.21.1/LICENSE +License URL: https://github.com/codesphere-cloud/cs-go/blob/v0.22.0/LICENSE ---------- Module: github.com/codesphere-cloud/oms/internal/tmpl @@ -797,9 +797,9 @@ License URL: https://github.com/open-telemetry/opentelemetry-proto-go/blob/otlp/ ---------- Module: go.yaml.in/yaml/v2 -Version: v2.4.3 +Version: v2.4.4 License: Apache-2.0 -License URL: https://github.com/yaml/go-yaml/blob/v2.4.3/LICENSE +License URL: https://github.com/yaml/go-yaml/blob/v2.4.4/LICENSE ---------- Module: go.yaml.in/yaml/v3 @@ -929,9 +929,9 @@ License URL: https://github.com/helm/helm/blob/v4.1.3/LICENSE ---------- Module: k8s.io/api -Version: v0.35.2 +Version: v0.35.3 License: Apache-2.0 -License URL: https://github.com/kubernetes/api/blob/v0.35.2/LICENSE +License URL: https://github.com/kubernetes/api/blob/v0.35.3/LICENSE ---------- Module: k8s.io/apiextensions-apiserver/pkg/apis/apiextensions @@ -941,15 +941,15 @@ License URL: https://github.com/kubernetes/apiextensions-apiserver/blob/v0.35.1/ ---------- Module: k8s.io/apimachinery/pkg -Version: v0.35.2 +Version: v0.35.3 License: Apache-2.0 -License URL: https://github.com/kubernetes/apimachinery/blob/v0.35.2/LICENSE +License URL: https://github.com/kubernetes/apimachinery/blob/v0.35.3/LICENSE ---------- Module: k8s.io/apimachinery/third_party/forked/golang -Version: v0.35.2 +Version: v0.35.3 License: BSD-3-Clause -License URL: https://github.com/kubernetes/apimachinery/blob/v0.35.2/third_party/forked/golang/LICENSE +License URL: https://github.com/kubernetes/apimachinery/blob/v0.35.3/third_party/forked/golang/LICENSE ---------- Module: k8s.io/apiserver/pkg/endpoints/deprecation @@ -959,21 +959,21 @@ License URL: https://github.com/kubernetes/apiserver/blob/v0.35.1/LICENSE ---------- Module: k8s.io/cli-runtime/pkg -Version: v0.35.2 +Version: v0.35.3 License: Apache-2.0 -License URL: https://github.com/kubernetes/cli-runtime/blob/v0.35.2/LICENSE +License URL: https://github.com/kubernetes/cli-runtime/blob/v0.35.3/LICENSE ---------- Module: k8s.io/client-go -Version: v0.35.2 +Version: v0.35.3 License: Apache-2.0 -License URL: https://github.com/kubernetes/client-go/blob/v0.35.2/LICENSE +License URL: https://github.com/kubernetes/client-go/blob/v0.35.3/LICENSE ---------- Module: k8s.io/client-go/third_party/forked/golang/template -Version: v0.35.2 +Version: v0.35.3 License: BSD-3-Clause -License URL: https://github.com/kubernetes/client-go/blob/v0.35.2/third_party/forked/golang/LICENSE +License URL: https://github.com/kubernetes/client-go/blob/v0.35.3/third_party/forked/golang/LICENSE ---------- Module: k8s.io/component-base/version diff --git a/cli/cmd/init_install_config_interactive_test.go b/cli/cmd/init_install_config_interactive_test.go index 32583196..179c45be 100644 --- a/cli/cmd/init_install_config_interactive_test.go +++ b/cli/cmd/init_install_config_interactive_test.go @@ -139,7 +139,7 @@ var _ = Describe("Interactive profile usage", func() { // Verify production-specific values Expect(config.Datacenter.Name).To(Equal("production")) - Expect(config.Cluster.Monitoring).To(BeNil()) + Expect(config.Cluster.Monitoring.Loki.Enabled).To(BeTrue()) }) }) }) diff --git a/cli/cmd/init_install_config_test.go b/cli/cmd/init_install_config_test.go index e015b765..21bdad4a 100644 --- a/cli/cmd/init_install_config_test.go +++ b/cli/cmd/init_install_config_test.go @@ -31,7 +31,7 @@ var _ = Describe("ApplyProfile", func() { Entry("development profile", "development", false, "dev"), Entry("prod profile", "prod", false, "production"), Entry("production profile", "production", false, "production"), - Entry("minimal profile", "minimal", false, "minimal"), + Entry("minimal profile", "minimal", false, "dev"), Entry("invalid profile", "invalid", true, ""), ) diff --git a/internal/bootstrap/gcp/gcp.go b/internal/bootstrap/gcp/gcp.go index 108425d3..f7a1f699 100644 --- a/internal/bootstrap/gcp/gcp.go +++ b/internal/bootstrap/gcp/gcp.go @@ -92,14 +92,13 @@ type VMDef struct { // Example VM definitions (expand as needed) var vmDefs = []VMDef{ {"jumpbox", "e2-medium", []string{"jumpbox", "ssh"}, []int64{}, true}, - {"postgres", "e2-standard-8", []string{"postgres"}, []int64{}, true}, - {"ceph-1", "e2-standard-8", []string{"ceph"}, []int64{20, 200}, false}, - {"ceph-2", "e2-standard-8", []string{"ceph"}, []int64{20, 200}, false}, - {"ceph-3", "e2-standard-8", []string{"ceph"}, []int64{20, 200}, false}, - {"ceph-4", "e2-standard-8", []string{"ceph"}, []int64{20, 200}, false}, - {"k0s-1", "e2-standard-16", []string{"k0s"}, []int64{}, false}, - {"k0s-2", "e2-standard-16", []string{"k0s"}, []int64{}, false}, - {"k0s-3", "e2-standard-16", []string{"k0s"}, []int64{}, false}, + {"postgres", "e2-standard-2", []string{"postgres"}, []int64{}, true}, + {"ceph-1", "e2-standard-4", []string{"ceph"}, []int64{10, 100}, false}, + {"ceph-2", "e2-standard-4", []string{"ceph"}, []int64{10, 100}, false}, + {"ceph-3", "e2-standard-4", []string{"ceph"}, []int64{10, 100}, false}, + {"k0s-1", "e2-standard-8", []string{"k0s"}, []int64{}, false}, + {"k0s-2", "e2-standard-8", []string{"k0s"}, []int64{}, false}, + {"k0s-3", "e2-standard-8", []string{"k0s"}, []int64{}, false}, } var DefaultExperiments []string = []string{ @@ -1192,10 +1191,6 @@ func (b *GCPBootstrapper) UpdateInstallConfig() error { Hostname: b.Env.CephNodes[2].GetName(), IPAddress: b.Env.CephNodes[2].GetInternalIP(), }, - { - Hostname: b.Env.CephNodes[3].GetName(), - IPAddress: b.Env.CephNodes[3].GetInternalIP(), - }, } b.Env.InstallConfig.Ceph.OSDs = []files.CephOSD{ { @@ -1204,11 +1199,11 @@ func (b *GCPBootstrapper) UpdateInstallConfig() error { HostPattern: "*", }, DataDevices: files.CephDataDevices{ - Size: "100G:", + Size: "50G:", Limit: 1, }, DBDevices: files.CephDBDevices{ - Size: "10G:500G", + Size: "10G:50G", Limit: 1, }, }, @@ -1235,26 +1230,13 @@ func (b *GCPBootstrapper) UpdateInstallConfig() error { }, }, } - b.Env.InstallConfig.Cluster.Monitoring = &files.MonitoringConfig{ - Prometheus: &files.PrometheusConfig{ - RemoteWrite: &files.RemoteWriteConfig{ - Enabled: false, - ClusterName: "GCP-test", - }, - }, + b.Env.InstallConfig.Cluster.Gateway.ServiceType = "LoadBalancer" + b.Env.InstallConfig.Cluster.Gateway.Annotations = map[string]string{ + "cloud.google.com/load-balancer-ipv4": b.Env.GatewayIP, } - b.Env.InstallConfig.Cluster.Gateway = files.GatewayConfig{ - ServiceType: "LoadBalancer", - //IPAddresses: []string{b.Env.ControlPlaneNodes[0].ExternalIP}, - Annotations: map[string]string{ - "cloud.google.com/load-balancer-ipv4": b.Env.GatewayIP, - }, - } - b.Env.InstallConfig.Cluster.PublicGateway = files.GatewayConfig{ - ServiceType: "LoadBalancer", - Annotations: map[string]string{ - "cloud.google.com/load-balancer-ipv4": b.Env.PublicGatewayIP, - }, + b.Env.InstallConfig.Cluster.PublicGateway.ServiceType = "LoadBalancer" + b.Env.InstallConfig.Cluster.PublicGateway.Annotations = map[string]string{ + "cloud.google.com/load-balancer-ipv4": b.Env.PublicGatewayIP, } dnsProject := b.Env.DNSProjectID @@ -1303,8 +1285,8 @@ func (b *GCPBootstrapper) UpdateInstallConfig() error { BomRef: "workspace-agent-24.04", }, Pool: map[int]int{ - 1: 1, - 2: 1, + 1: 0, + 2: 0, 3: 0, }, }, diff --git a/internal/bootstrap/gcp/gcp_test.go b/internal/bootstrap/gcp/gcp_test.go index 34bfa2d4..85c2dd61 100644 --- a/internal/bootstrap/gcp/gcp_test.go +++ b/internal/bootstrap/gcp/gcp_test.go @@ -113,7 +113,7 @@ var _ = Describe("GCP Bootstrapper", func() { Jumpbox: fakeNode("jumpbox", nodeClient), PostgreSQLNode: fakeNode("postgres", nodeClient), ControlPlaneNodes: []*node.Node{fakeNode("k0s-1", nodeClient), fakeNode("k0s-2", nodeClient), fakeNode("k0s-3", nodeClient)}, - CephNodes: []*node.Node{fakeNode("ceph-1", nodeClient), fakeNode("ceph-2", nodeClient), fakeNode("ceph-3", nodeClient), fakeNode("ceph-4", nodeClient)}, + CephNodes: []*node.Node{fakeNode("ceph-1", nodeClient), fakeNode("ceph-2", nodeClient), fakeNode("ceph-3", nodeClient)}, } }) Describe("NewGCPBootstrapper", func() { @@ -187,7 +187,7 @@ var _ = Describe("GCP Bootstrapper", func() { gc.EXPECT().CreateFirewallRule(projectId, mock.Anything).Return(nil).Times(5) // 11. EnsureComputeInstances - gc.EXPECT().CreateInstance(projectId, "us-central1-a", mock.Anything).Return(nil).Times(9) + gc.EXPECT().CreateInstance(projectId, "us-central1-a", mock.Anything).Return(nil).Times(8) // GetInstance calls to retrieve IPs ipResp := &computepb.Instance{ NetworkInterfaces: []*computepb.NetworkInterface{ @@ -200,7 +200,7 @@ var _ = Describe("GCP Bootstrapper", func() { }, } - gc.EXPECT().GetInstance(projectId, "us-central1-a", mock.Anything).Return(ipResp, nil).Times(9) + gc.EXPECT().GetInstance(projectId, "us-central1-a", mock.Anything).Return(ipResp, nil).Times(8) fw.EXPECT().ReadFile(mock.Anything).Return([]byte("fake-key"), nil).Times(1) // 12. EnsureGatewayIPAddresses @@ -249,10 +249,10 @@ var _ = Describe("GCP Bootstrapper", func() { Expect(bs.Env.ProjectID).To(HavePrefix("test-project-")) // Verify nodes are properly set in the environment - Expect(bs.Env.Jumpbox).NotTo(BeNil(), "Jumpbox should be created") - Expect(bs.Env.PostgreSQLNode).NotTo(BeNil(), "PostgreSQL node should be created") - Expect(bs.Env.CephNodes).To(HaveLen(4), "Should have 4 Ceph nodes") - Expect(bs.Env.ControlPlaneNodes).To(HaveLen(3), "Should have 3 K0s control plane nodes") + Expect(bs.Env.Jumpbox).NotTo(BeNil()) + Expect(bs.Env.PostgreSQLNode).NotTo(BeNil()) + Expect(bs.Env.CephNodes).To(HaveLen(3)) + Expect(bs.Env.ControlPlaneNodes).To(HaveLen(3)) // Verify mock returns expected values Expect(bs.Env.Jumpbox.GetName()).To(Equal("jumpbox")) @@ -1003,10 +1003,10 @@ var _ = Describe("GCP Bootstrapper", func() { // Mock ReadFile for SSH key fw.EXPECT().ReadFile(csEnv.SSHPublicKeyPath).Return([]byte("ssh-rsa AAA..."), nil).Times(1) - // Mock CreateInstance (9 times) - gc.EXPECT().CreateInstance(csEnv.ProjectID, csEnv.Zone, mock.Anything).Return(nil).Times(9) + // Mock CreateInstance (8 times) + gc.EXPECT().CreateInstance(csEnv.ProjectID, csEnv.Zone, mock.Anything).Return(nil).Times(8) - // Mock GetInstance (9 times) + // Mock GetInstance (8 times) ipResp := &computepb.Instance{ NetworkInterfaces: []*computepb.NetworkInterface{ { @@ -1017,12 +1017,12 @@ var _ = Describe("GCP Bootstrapper", func() { }, }, } - gc.EXPECT().GetInstance(csEnv.ProjectID, csEnv.Zone, mock.Anything).Return(ipResp, nil).Times(9) + gc.EXPECT().GetInstance(csEnv.ProjectID, csEnv.Zone, mock.Anything).Return(ipResp, nil).Times(8) err := bs.EnsureComputeInstances() Expect(err).NotTo(HaveOccurred()) Expect(len(bs.Env.ControlPlaneNodes)).To(Equal(3)) - Expect(len(bs.Env.CephNodes)).To(Equal(4)) + Expect(len(bs.Env.CephNodes)).To(Equal(3)) Expect(bs.Env.PostgreSQLNode).NotTo(BeNil()) Expect(bs.Env.Jumpbox).NotTo(BeNil()) }) @@ -1035,14 +1035,14 @@ var _ = Describe("GCP Bootstrapper", func() { }) It("does not fetch GitHub org keys when GitHub team org is set without slug", func() { fw.EXPECT().ReadFile(csEnv.SSHPublicKeyPath).Return([]byte("ssh-rsa AAA..."), nil).Times(1) - gc.EXPECT().CreateInstance(csEnv.ProjectID, csEnv.Zone, mock.Anything).Return(nil).Times(9) + gc.EXPECT().CreateInstance(csEnv.ProjectID, csEnv.Zone, mock.Anything).Return(nil).Times(8) ipResp := &computepb.Instance{ NetworkInterfaces: []*computepb.NetworkInterface{{ NetworkIP: protoString("10.0.0.x"), AccessConfigs: []*computepb.AccessConfig{{NatIP: protoString("1.2.3.x")}}, }}, } - gc.EXPECT().GetInstance(csEnv.ProjectID, csEnv.Zone, mock.Anything).Return(ipResp, nil).Times(9) + gc.EXPECT().GetInstance(csEnv.ProjectID, csEnv.Zone, mock.Anything).Return(ipResp, nil).Times(8) err := bs.EnsureComputeInstances() Expect(err).NotTo(HaveOccurred()) @@ -1067,7 +1067,7 @@ var _ = Describe("GCP Bootstrapper", func() { return fmt.Errorf("expected ssh metadata to include team user key") } return nil - }).Times(9) + }).Times(8) ipResp := &computepb.Instance{ NetworkInterfaces: []*computepb.NetworkInterface{{ @@ -1075,7 +1075,7 @@ var _ = Describe("GCP Bootstrapper", func() { AccessConfigs: []*computepb.AccessConfig{{NatIP: protoString("1.2.3.x")}}, }}, } - gc.EXPECT().GetInstance(csEnv.ProjectID, csEnv.Zone, mock.Anything).Return(ipResp, nil).Times(9) + gc.EXPECT().GetInstance(csEnv.ProjectID, csEnv.Zone, mock.Anything).Return(ipResp, nil).Times(8) err := bs.EnsureComputeInstances() Expect(err).NotTo(HaveOccurred()) diff --git a/internal/installer/config_manager_profile.go b/internal/installer/config_manager_profile.go index dbd79791..be2d0283 100644 --- a/internal/installer/config_manager_profile.go +++ b/internal/installer/config_manager_profile.go @@ -142,20 +142,20 @@ func (g *InstallConfig) ApplyProfile(profile string) error { switch profile { case PROFILE_DEV, PROFILE_DEVELOPMENT: g.Config.Datacenter.Name = "dev" - if err := ApplyResourceProfile(g.Config, ResourceProfileNoRequests); err != nil { - return fmt.Errorf("applying resource profile: %w", err) - } g.Config.Cluster.Monitoring = &files.MonitoringConfig{ Prometheus: &files.PrometheusConfig{ RemoteWrite: &files.RemoteWriteConfig{ Enabled: false, - ClusterName: "local-test", + ClusterName: "dev", }, }, Loki: &files.LokiConfig{Enabled: false}, Grafana: &files.GrafanaConfig{Enabled: false}, GrafanaAlloy: &files.GrafanaAlloyConfig{Enabled: false}, } + if err := ApplyResourceProfile(g.Config, ResourceProfileNoRequests); err != nil { + return fmt.Errorf("applying resource profile: %w", err) + } case PROFILE_PROD, PROFILE_PRODUCTION: g.Config.Datacenter.Name = "production" @@ -167,11 +167,30 @@ func (g *InstallConfig) ApplyProfile(profile string) error { OnDemand: true, }, } + g.Config.Cluster.Monitoring = &files.MonitoringConfig{ + Prometheus: &files.PrometheusConfig{ + RemoteWrite: &files.RemoteWriteConfig{ + Enabled: false, + ClusterName: "production", + }, + }, + Loki: &files.LokiConfig{Enabled: true}, + Grafana: &files.GrafanaConfig{Enabled: true}, + GrafanaAlloy: &files.GrafanaAlloyConfig{Enabled: true}, + } case PROFILE_MINIMAL: - g.Config.Datacenter.Name = "minimal" - if err := ApplyResourceProfile(g.Config, ResourceProfileNoRequests); err != nil { - return fmt.Errorf("applying resource profile: %w", err) + g.Config.Datacenter.Name = "dev" + g.Config.Cluster.Monitoring = &files.MonitoringConfig{ + Prometheus: &files.PrometheusConfig{ + RemoteWrite: &files.RemoteWriteConfig{ + Enabled: false, + ClusterName: "dev", + }, + }, + Loki: &files.LokiConfig{Enabled: true}, + Grafana: &files.GrafanaConfig{Enabled: true}, + GrafanaAlloy: &files.GrafanaAlloyConfig{Enabled: true}, } g.Config.Codesphere.Plans.WorkspacePlans = map[int]files.WorkspacePlan{ 1: { @@ -181,6 +200,9 @@ func (g *InstallConfig) ApplyProfile(profile string) error { OnDemand: true, }, } + if err := ApplyResourceProfile(g.Config, ResourceProfileNoRequests); err != nil { + return fmt.Errorf("applying resource profile: %w", err) + } default: return fmt.Errorf("unknown profile: %s, available profiles: dev, prod, minimal", profile) diff --git a/internal/installer/config_manager_profile_test.go b/internal/installer/config_manager_profile_test.go index 2f09ea2a..510647e5 100644 --- a/internal/installer/config_manager_profile_test.go +++ b/internal/installer/config_manager_profile_test.go @@ -162,7 +162,7 @@ var _ = Describe("ConfigManagerProfile", func() { }) Context("profile-specific differences", func() { - It("should have different datacenter names", func() { + It("should have the expected datacenter names", func() { devManager := installer.NewInstallConfigManager() prodManager := installer.NewInstallConfigManager() minimalManager := installer.NewInstallConfigManager() @@ -175,8 +175,8 @@ var _ = Describe("ConfigManagerProfile", func() { Expect(err).ToNot(HaveOccurred()) Expect(devManager.GetInstallConfig().Datacenter.Name).To(Equal("dev")) + Expect(minimalManager.GetInstallConfig().Datacenter.Name).To(Equal("dev")) Expect(prodManager.GetInstallConfig().Datacenter.Name).To(Equal("production")) - Expect(minimalManager.GetInstallConfig().Datacenter.Name).To(Equal("minimal")) }) It("should have different resource profiles", func() { @@ -192,19 +192,23 @@ var _ = Describe("ConfigManagerProfile", func() { Expect(err).ToNot(HaveOccurred()) Expect(devManager.GetInstallConfig().Datacenter.Name).To(Equal("dev")) + Expect(minimalManager.GetInstallConfig().Datacenter.Name).To(Equal("dev")) Expect(prodManager.GetInstallConfig().Datacenter.Name).To(Equal("production")) - Expect(minimalManager.GetInstallConfig().Datacenter.Name).To(Equal("minimal")) // DEV AssertZeroRequests(getAuthServiceRequests(devManager.GetInstallConfig())) Expect(devManager.GetInstallConfig().Cluster.Monitoring.Grafana.Enabled).To(BeFalse()) // Minimal AssertZeroRequests(getAuthServiceRequests(minimalManager.GetInstallConfig())) - Expect(minimalManager.GetInstallConfig().Cluster.Monitoring.Loki).To(BeNil()) - Expect(minimalManager.GetInstallConfig().Cluster.Monitoring.Grafana).To(BeNil()) - Expect(minimalManager.GetInstallConfig().Cluster.Monitoring.GrafanaAlloy).To(BeNil()) + Expect(minimalManager.GetInstallConfig().Cluster.Monitoring.Loki.Enabled).To(BeTrue()) + Expect(minimalManager.GetInstallConfig().Cluster.Monitoring.Grafana.Enabled).To(BeTrue()) + Expect(minimalManager.GetInstallConfig().Cluster.Monitoring.GrafanaAlloy.Enabled).To(BeTrue()) // Prod - Expect(prodManager.GetInstallConfig().Cluster.Monitoring).To(BeNil()) + Expect(prodManager.GetInstallConfig().Cluster.Monitoring.Loki.Enabled).To(BeTrue()) + Expect(prodManager.GetInstallConfig().Cluster.Monitoring.Grafana.Enabled).To(BeTrue()) + Expect(prodManager.GetInstallConfig().Cluster.Monitoring.GrafanaAlloy.Enabled).To(BeTrue()) + Expect(prodManager.GetInstallConfig().Codesphere.Override).To(BeNil()) + }) }) }) diff --git a/internal/installer/resource_profiles.go b/internal/installer/resource_profiles.go index e6e1a7a1..7122717d 100644 --- a/internal/installer/resource_profiles.go +++ b/internal/installer/resource_profiles.go @@ -105,6 +105,21 @@ func applyNoRequestsProfile(config *files.RootConfig) { }, }) + if config.Cluster.Monitoring.Loki == nil { + config.Cluster.Monitoring.Loki = &files.LokiConfig{} + } + config.Cluster.Monitoring.Loki.Override = util.DeepMergeMaps(config.Cluster.Monitoring.Loki.Override, map[string]any{ + "loki": map[string]any{ + "read": minimalResourceValues(), + "write": minimalResourceValues(), + "backend": minimalResourceValues(), + "resultsCache": minimalResourceValues(), + "chunksCache": minimalResourceValues(), + "canary": minimalResourceValues(), + "gateway": minimalResourceValues(), + }, + }) + if config.Cluster.Monitoring.PushGateway == nil { config.Cluster.Monitoring.PushGateway = &files.PushGatewayConfig{} } @@ -144,10 +159,6 @@ func applyNoRequestsProfile(config *files.RootConfig) { }, }) - if config.Codesphere.Override == nil { - config.Codesphere.Override = map[string]any{} - } - serviceProfiles := map[string]any{} for _, serviceName := range []string{ "auth_service", @@ -166,10 +177,23 @@ func applyNoRequestsProfile(config *files.RootConfig) { "requests": zeroRequests(), } } + serviceProfiles["deployment_service"].(map[string]any)["replicas"] = 2 + serviceProfiles["public_api_service"].(map[string]any)["replicas"] = 2 + serviceProfiles["team_service"].(map[string]any)["replicas"] = 2 + serviceProfiles["workspace_service"].(map[string]any)["replicas"] = 2 + serviceProfiles["auth_service"].(map[string]any)["replicas"] = 2 + + if config.Codesphere.Override == nil { + config.Codesphere.Override = map[string]any{} + } config.Codesphere.Override = util.DeepMergeMaps(config.Codesphere.Override, map[string]any{ "global": map[string]any{ "services": serviceProfiles, + "underprovisionFactors": map[string]string{ + "cpu": "0.01", + "memory": "0.01", + }, }, }) } @@ -180,3 +204,12 @@ func zeroRequests() map[string]int { "memory": 0, } } + +func minimalResourceValues() map[string]any { + return map[string]any{ + "replicas": 1, + "resources": map[string]any{ + "requests": zeroRequests(), + }, + } +} diff --git a/internal/installer/resource_profiles_test.go b/internal/installer/resource_profiles_test.go index d0217014..72e4ea4a 100644 --- a/internal/installer/resource_profiles_test.go +++ b/internal/installer/resource_profiles_test.go @@ -60,8 +60,12 @@ var _ = Describe("ApplyResourceProfile", func() { controller := MustMap[any](MustMap[any](config.Cluster.Gateway.Override["ingress-nginx"])["controller"]) AssertZeroRequests(MustMap[any](controller["resources"])["requests"]) - authService := MustMap[any](MustMap[any](MustMap[any](config.Codesphere.Override["global"])["services"])["auth_service"]) - AssertZeroRequests(authService["requests"]) + deployService := MustMap[any](MustMap[any](MustMap[any](config.Codesphere.Override["global"])["services"])["deployment_service"]) + AssertZeroRequests(deployService["requests"]) + Expect(deployService["replicas"]).To(Equal(2)) + underprovisionFactors := MustMap[string](MustMap[any](config.Codesphere.Override["global"])["underprovisionFactors"]) + Expect(underprovisionFactors["cpu"]).To(Equal("0.01")) + Expect(underprovisionFactors["memory"]).To(Equal("0.01")) Expect(config.Cluster.CertManager).NotTo(BeNil()) Expect(config.Cluster.CertManager.Override).NotTo(BeNil()) diff --git a/internal/tmpl/NOTICE b/internal/tmpl/NOTICE index 2607ce1a..644932ff 100644 --- a/internal/tmpl/NOTICE +++ b/internal/tmpl/NOTICE @@ -155,9 +155,9 @@ License URL: https://github.com/cloudflare/circl/blob/v1.6.3/LICENSE ---------- Module: github.com/codesphere-cloud/cs-go -Version: v0.21.1 +Version: v0.22.0 License: Apache-2.0 -License URL: https://github.com/codesphere-cloud/cs-go/blob/v0.21.1/LICENSE +License URL: https://github.com/codesphere-cloud/cs-go/blob/v0.22.0/LICENSE ---------- Module: github.com/codesphere-cloud/oms/internal/tmpl @@ -797,9 +797,9 @@ License URL: https://github.com/open-telemetry/opentelemetry-proto-go/blob/otlp/ ---------- Module: go.yaml.in/yaml/v2 -Version: v2.4.3 +Version: v2.4.4 License: Apache-2.0 -License URL: https://github.com/yaml/go-yaml/blob/v2.4.3/LICENSE +License URL: https://github.com/yaml/go-yaml/blob/v2.4.4/LICENSE ---------- Module: go.yaml.in/yaml/v3 @@ -929,9 +929,9 @@ License URL: https://github.com/helm/helm/blob/v4.1.3/LICENSE ---------- Module: k8s.io/api -Version: v0.35.2 +Version: v0.35.3 License: Apache-2.0 -License URL: https://github.com/kubernetes/api/blob/v0.35.2/LICENSE +License URL: https://github.com/kubernetes/api/blob/v0.35.3/LICENSE ---------- Module: k8s.io/apiextensions-apiserver/pkg/apis/apiextensions @@ -941,15 +941,15 @@ License URL: https://github.com/kubernetes/apiextensions-apiserver/blob/v0.35.1/ ---------- Module: k8s.io/apimachinery/pkg -Version: v0.35.2 +Version: v0.35.3 License: Apache-2.0 -License URL: https://github.com/kubernetes/apimachinery/blob/v0.35.2/LICENSE +License URL: https://github.com/kubernetes/apimachinery/blob/v0.35.3/LICENSE ---------- Module: k8s.io/apimachinery/third_party/forked/golang -Version: v0.35.2 +Version: v0.35.3 License: BSD-3-Clause -License URL: https://github.com/kubernetes/apimachinery/blob/v0.35.2/third_party/forked/golang/LICENSE +License URL: https://github.com/kubernetes/apimachinery/blob/v0.35.3/third_party/forked/golang/LICENSE ---------- Module: k8s.io/apiserver/pkg/endpoints/deprecation @@ -959,21 +959,21 @@ License URL: https://github.com/kubernetes/apiserver/blob/v0.35.1/LICENSE ---------- Module: k8s.io/cli-runtime/pkg -Version: v0.35.2 +Version: v0.35.3 License: Apache-2.0 -License URL: https://github.com/kubernetes/cli-runtime/blob/v0.35.2/LICENSE +License URL: https://github.com/kubernetes/cli-runtime/blob/v0.35.3/LICENSE ---------- Module: k8s.io/client-go -Version: v0.35.2 +Version: v0.35.3 License: Apache-2.0 -License URL: https://github.com/kubernetes/client-go/blob/v0.35.2/LICENSE +License URL: https://github.com/kubernetes/client-go/blob/v0.35.3/LICENSE ---------- Module: k8s.io/client-go/third_party/forked/golang/template -Version: v0.35.2 +Version: v0.35.3 License: BSD-3-Clause -License URL: https://github.com/kubernetes/client-go/blob/v0.35.2/third_party/forked/golang/LICENSE +License URL: https://github.com/kubernetes/client-go/blob/v0.35.3/third_party/forked/golang/LICENSE ---------- Module: k8s.io/component-base/version