From 910150da902e0f0115321d500310cfb7e8482339 Mon Sep 17 00:00:00 2001 From: "Baker, Scott" Date: Tue, 21 Oct 2025 18:06:18 -0700 Subject: [PATCH 01/17] WIP --- mage/Magefile.go | 9 +-- mage/config.go | 66 +++++++++++++++------ mage/deploy.go | 94 +++++++++++++++++++++++++++++- orch-configs/templates/cluster.tpl | 4 ++ 4 files changed, 147 insertions(+), 26 deletions(-) diff --git a/mage/Magefile.go b/mage/Magefile.go index 701705fcc..a52340489 100644 --- a/mage/Magefile.go +++ b/mage/Magefile.go @@ -474,12 +474,9 @@ func (d Deploy) KindMinimal() error { // Deploy kind cluster, Argo CD, and Orchestrator services with customized settings. func (d Deploy) KindCustom() error { - targetEnv, err := Config{}.createCluster() - if err != nil { - return fmt.Errorf("failed to create cluster: %w", err) - } - - return d.all(targetEnv) + fmt.Println("Interactive cluster configuration is not currently supported.") + fmt.Println("Use config:usePreset with a manually generated preset file until this functionality is supported.") + return fmt.Errorf("unsupported") } // Deploy kind cluster, Argo CD, and Orchestrator services with preset settings. diff --git a/mage/config.go b/mage/config.go index ff899f29d..0789ab649 100644 --- a/mage/config.go +++ b/mage/config.go @@ -22,6 +22,8 @@ var ( "targetCluster": "kind", "clusterDomain": serviceDomain, "argoServiceType": "LoadBalancer", + "enableAppOrch": true, + "enableClusterOrch": true, "enableObservability": true, "enableAuditLogging": false, "enableKyverno": true, @@ -37,23 +39,6 @@ var ( } ) -func (c Config) createCluster() (string, error) { - fmt.Println("Interactive cluster configuration is not currently supported.") - fmt.Println("Use config:usePreset with a manually generated preset file until this functionality is supported.") - - // TBD: Implement interactive queryClusterPresetSettings interface - // clusterSettings, err := queryClusterPresetSettings() - // if err != nil { - // return "", fmt.Errorf("invalid cluster settings: %w", err) - // } - - // Render the cluster deployment configuration template. - // clusterName, err := renderClusterTemplate(clusterSettings) - // return clusterName, nil - - return "", nil -} - // writeMapAsYAML writes a map[string]interface{} as a YAML string. func writeMapAsYAML(data map[string]interface{}) (string, error) { var sb strings.Builder @@ -139,8 +124,46 @@ func parseClusterValues(clusterConfigPath string) (map[string]interface{}, error return clusterValues, nil } +// XXX smbaker - cleanup - abandoned this approach +/* +func (Config) overrideFromEnvironment(presetData map[string]interface{}) error { + // DISABLE_AO_PROFILE, DISABLE_CO_PROFILE, DISABLE_O11Y_PROFILE environment + // variables may be used to disable specific subsystems. These environment variable + // names are chosen to maintain parity with the AWS and OnPrem installer environment + // variable names. + + disableAOStr := os.Getenv("DISABLE_AO_PROFILE") + disableAO, err := strconv.ParseBool(disableAOStr) + if err != nil { + return fmt.Errorf("failed to parse DISABLE_AO_PROFILE environment variable: %w", err) + } + if disableAO { + presetData["enableAppOrch"] = false + } + + disableCOStr := os.Getenv("DISABLE_AO_PROFILE") + disableCO, err := strconv.ParseBool(disableCOStr) + if err != nil { + return fmt.Errorf("failed to parse DISABLE_CO_PROFILE environment variable: %w", err) + } + if disableCO { + presetData["enableClusterOrch"] = false + presetData["enableAppOrch"] = false + } + + disableO11yStr := os.Getenv("DISABLE_O11Y_PROFILE") + disableO11y, err := strconv.ParseBool(disableO11yStr) + if err != nil { + return fmt.Errorf("failed to parse DISABLE_O11Y_PROFILE environment variable: %w", err) + } + if disableO11y { + presetData["enableObservability"] = false + } +} +*/ + // Create a cluster deployment configuration from a cluster values file. -func (Config) usePreset(clusterPresetFile string) (string, error) { +func (c Config) usePreset(clusterPresetFile string) (string, error) { clusterValues, err := os.ReadFile(clusterPresetFile) if err != nil { return "", fmt.Errorf("failed to read cluster preset file: %w", err) @@ -164,6 +187,13 @@ func (Config) usePreset(clusterPresetFile string) (string, error) { presetData["proxyProfile"] = proxyProfilePath } + // XXX smbaker - cleanup - abandoned this approach + // apply any overrides from environment variables + //err = c.overrideFromEnvironment(presetData) + //if err != nil { + //return "", fmt.Errorf("failed to override preset data from environment: %w", err) + //} + var clusterName string if clusterName, err = renderClusterTemplate(presetData); err != nil { return "", fmt.Errorf("failed to render cluster template: %w", err) diff --git a/mage/deploy.go b/mage/deploy.go index 7189682f1..5d26ce6ae 100644 --- a/mage/deploy.go +++ b/mage/deploy.go @@ -21,6 +21,7 @@ import ( "os" "os/exec" "path/filepath" + "strconv" "strings" "text/template" "time" @@ -28,6 +29,7 @@ import ( "github.com/bitfield/script" "github.com/magefile/mage/mg" "github.com/magefile/mage/sh" + "gopkg.in/yaml.v3" ) var pwChars = []rune(`abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789`) @@ -1539,16 +1541,99 @@ func getOrchestratorVersionParam() (string, error) { return fmt.Sprintf("--set-string argo.orchestratorVersion=%s ", version), nil } +func (d Deploy) removeProfile(configMap map[string]interface{}, profilePath string) { + // Modify the profiles list to remove "ao" profile + if profiles, ok := configMap["profiles"].([]interface{}); ok { + var updatedProfiles []interface{} + for _, profile := range profiles { + if profileStr, ok := profile.(string); ok && profileStr != "ao" { + updatedProfiles = append(updatedProfiles, profileStr) + } + } + configMap["profiles"] = updatedProfiles + } +} + +// There are multiple ways that cluster templates might be use. +// 1. By using a preset, which in turn uses cluster.tpl to generate a cluster.yaml +// 2. By using "deploy:kind" or "deploy:kindminimal" which uses a specifically-named cluster.yaml +// 3. By using "deploy:orch" or "deploy:orchLocal" which uses a user-named cluster.yaml +// To handle environment variable overrides from any of these paths that might have led us here, +// just do a final pass over the cluster.yaml we were given, and modify it. + +func (d Deploy) handleEnvOverride(targetConfig string) (string, error) { + orchConfigsDir := getConfigsDir() + + disableAOStr := os.Getenv("DISABLE_AO_PROFILE") + disableAO, err := strconv.ParseBool(disableAOStr) + if err != nil { + return fmt.Errorf("failed to parse DISABLE_AO_PROFILE environment variable: %w", err) + } + + disableCOStr := os.Getenv("DISABLE_AO_PROFILE") + disableCO, err := strconv.ParseBool(disableCOStr) + if err != nil { + return fmt.Errorf("failed to parse DISABLE_CO_PROFILE environment variable: %w", err) + } + if disableCO { + disableAO = true + } + + disableO11yStr := os.Getenv("DISABLE_O11Y_PROFILE") + disableO11y, err := strconv.ParseBool(disableO11yStr) + if err != nil { + return fmt.Errorf("failed to parse DISABLE_O11Y_PROFILE environment variable: %w", err) + } + + // Parse the YAML file in targetConfig + yamlData, err := os.ReadFile(targetConfig) + if err != nil { + fmt.Printf("failed to read target config file: %v\n", err) + return targetConfig + } + var configMap map[string]interface{} + if err := yaml.Unmarshal(yamlData, &configMap); err != nil { + fmt.Printf("failed to parse target config YAML: %v\n", err) + return targetConfig + } + + if disableAO { + removeProfile(configMap, "orch-configs/profiles/enable-app-orch.yaml") + } + if disableCO { + removeProfile(configMap, "orch-configs/profiles/enable-cluster-orch.yaml") + } + if disableO11y { + removeProfile(configMap, "orch-configs/profiles/enable-o11y.yaml") + } + + // Write the modified configMap to a new profile file and return its path + newProfilePath := fmt.Sprintf("%s/clusters/deploy.yaml", orchConfigsDir) + outData, err := yaml.Marshal(configMap) + if err != nil { + return "", fmt.Errorf("failed to marshal modified config YAML: %v", err) + } + if err := os.WriteFile(newProfilePath, outData, 0o644); err != nil { + return "", fmt.Errorf("failed to write new profile file: %v", err) + } + return newProfilePath, nil +} + // Root app that starts the deployment of children apps. func (d Deploy) orch(targetEnv string) error { targetConfig := getTargetConfig(targetEnv) + finalConfig, err := d.handleEnvOverride(targetConfig) + if err != nil { + return err + } + // Clone and update the Gitea deployment repo if err := (Deploy{}).updateDeployRepo(targetEnv, deployRepoPath, deployRepoName, deployGiteaRepoDir); err != nil { return fmt.Errorf("error updating deployment repo content: %w", err) } - cmd := fmt.Sprintf("helm upgrade --install root-app argocd/root-app -f %s -n %s --create-namespace", targetConfig, targetEnv) + cmd := fmt.Sprintf("helm upgrade --install root-app argocd/root-app -f %s -n %s --create-namespace", finalConfig, targetEnv) _, err := script.Exec(cmd).Stdout() return err } @@ -1576,6 +1661,11 @@ func getAWSAvailabilityZone() (string, error) { func (d Deploy) orchLocal(targetEnv string) error { targetConfig := getTargetConfig(targetEnv) + finalConfig, err := d.handleEnvOverride(targetConfig) + if err != nil { + return err + } + // Clone and update the Gitea deployment repo if err := (Deploy{}).updateDeployRepo(targetEnv, deployRepoPath, deployRepoName, deployGiteaRepoDir); err != nil { return fmt.Errorf("error updating deployment repo content: %w", err) @@ -1589,7 +1679,7 @@ func (d Deploy) orchLocal(targetEnv string) error { } cmd := fmt.Sprintf("helm upgrade --install root-app argocd/root-app -f %s -n %s --create-namespace %s %s"+ - "--set root.useLocalValues=true", targetConfig, targetEnv, deployRevision, orchVersion) + "--set root.useLocalValues=true", finalConfig, targetEnv, deployRevision, orchVersion) // only for coder deployments targetAutoCertEnabled, _ := (Config{}).isAutoCertEnabled(targetEnv) diff --git a/orch-configs/templates/cluster.tpl b/orch-configs/templates/cluster.tpl index 42b732700..a4c84c21a 100644 --- a/orch-configs/templates/cluster.tpl +++ b/orch-configs/templates/cluster.tpl @@ -16,8 +16,12 @@ root: {{- if .Values.enableKyverno }} - orch-configs/profiles/enable-kyverno.yaml {{- end }} +{{- if .Values.enableAppOrch }} - orch-configs/profiles/enable-app-orch.yaml +{{- endif }} +{{- if .Values.enableClusterOrch }} - orch-configs/profiles/enable-cluster-orch.yaml +{{ -endif }} {{- if .Values.enableEdgeInfra }} - orch-configs/profiles/enable-edgeinfra.yaml {{- end }} From b48c460d0320945cddb6ff2716047a0cccfde6a1 Mon Sep 17 00:00:00 2001 From: "Baker, Scott" Date: Tue, 21 Oct 2025 18:09:04 -0700 Subject: [PATCH 02/17] fix errors --- mage/Magefile.go | 8 -------- mage/deploy.go | 19 +++++++++---------- 2 files changed, 9 insertions(+), 18 deletions(-) diff --git a/mage/Magefile.go b/mage/Magefile.go index a52340489..df86ddcfe 100644 --- a/mage/Magefile.go +++ b/mage/Magefile.go @@ -1831,14 +1831,6 @@ func (g Gen) FirewallDoc() error { type Config mg.Namespace -func (c Config) CreateCluster() error { - _, err := c.createCluster() - if err != nil { - return fmt.Errorf("failed to create cluster: %w", err) - } - return nil -} - // Create a cluster deployment configuration from a cluster values file. func (c Config) UsePreset(clusterPresetFile string) error { _, err := c.usePreset(clusterPresetFile) diff --git a/mage/deploy.go b/mage/deploy.go index 5d26ce6ae..50cd9eccc 100644 --- a/mage/deploy.go +++ b/mage/deploy.go @@ -1567,13 +1567,13 @@ func (d Deploy) handleEnvOverride(targetConfig string) (string, error) { disableAOStr := os.Getenv("DISABLE_AO_PROFILE") disableAO, err := strconv.ParseBool(disableAOStr) if err != nil { - return fmt.Errorf("failed to parse DISABLE_AO_PROFILE environment variable: %w", err) + return "", fmt.Errorf("failed to parse DISABLE_AO_PROFILE environment variable: %w", err) } disableCOStr := os.Getenv("DISABLE_AO_PROFILE") disableCO, err := strconv.ParseBool(disableCOStr) if err != nil { - return fmt.Errorf("failed to parse DISABLE_CO_PROFILE environment variable: %w", err) + return "", fmt.Errorf("failed to parse DISABLE_CO_PROFILE environment variable: %w", err) } if disableCO { disableAO = true @@ -1582,29 +1582,28 @@ func (d Deploy) handleEnvOverride(targetConfig string) (string, error) { disableO11yStr := os.Getenv("DISABLE_O11Y_PROFILE") disableO11y, err := strconv.ParseBool(disableO11yStr) if err != nil { - return fmt.Errorf("failed to parse DISABLE_O11Y_PROFILE environment variable: %w", err) + return "", fmt.Errorf("failed to parse DISABLE_O11Y_PROFILE environment variable: %w", err) } // Parse the YAML file in targetConfig yamlData, err := os.ReadFile(targetConfig) if err != nil { fmt.Printf("failed to read target config file: %v\n", err) - return targetConfig + return targetConfig, nil } var configMap map[string]interface{} if err := yaml.Unmarshal(yamlData, &configMap); err != nil { - fmt.Printf("failed to parse target config YAML: %v\n", err) - return targetConfig + return "", fmt.Errorf("failed to unmarshal config YAML: %v", err) } if disableAO { - removeProfile(configMap, "orch-configs/profiles/enable-app-orch.yaml") + d.removeProfile(configMap, "orch-configs/profiles/enable-app-orch.yaml") } if disableCO { - removeProfile(configMap, "orch-configs/profiles/enable-cluster-orch.yaml") + d.removeProfile(configMap, "orch-configs/profiles/enable-cluster-orch.yaml") } if disableO11y { - removeProfile(configMap, "orch-configs/profiles/enable-o11y.yaml") + d.removeProfile(configMap, "orch-configs/profiles/enable-o11y.yaml") } // Write the modified configMap to a new profile file and return its path @@ -1634,7 +1633,7 @@ func (d Deploy) orch(targetEnv string) error { } cmd := fmt.Sprintf("helm upgrade --install root-app argocd/root-app -f %s -n %s --create-namespace", finalConfig, targetEnv) - _, err := script.Exec(cmd).Stdout() + _, err = script.Exec(cmd).Stdout() return err } From 559aca172b029a869e3dcf99091a2ef2e82d0fb3 Mon Sep 17 00:00:00 2001 From: "Baker, Scott" Date: Wed, 22 Oct 2025 10:41:38 -0700 Subject: [PATCH 03/17] back to the original plan --- mage/Magefile.go | 5 +- mage/config.go | 15 ++-- mage/deploy.go | 82 +-------------------- orch-configs/clusters/dev-minimal.yaml | 69 ----------------- orch-configs/clusters/dev.yaml | 79 -------------------- orch-configs/presets/dev-coder-minimal.yaml | 11 +++ orch-configs/presets/dev-coder.yaml | 12 +++ 7 files changed, 35 insertions(+), 238 deletions(-) delete mode 100644 orch-configs/clusters/dev-minimal.yaml delete mode 100644 orch-configs/clusters/dev.yaml create mode 100644 orch-configs/presets/dev-coder-minimal.yaml create mode 100644 orch-configs/presets/dev-coder.yaml diff --git a/mage/Magefile.go b/mage/Magefile.go index df86ddcfe..32426c687 100644 --- a/mage/Magefile.go +++ b/mage/Magefile.go @@ -464,12 +464,12 @@ type Deploy mg.Namespace // Deploy kind cluster, Argo CD, and all Orchestrator services. func (d Deploy) KindAll() error { - return d.all("dev") + return d.KindPreset("../orch-configs/presets/dev-coder.yaml") } // Deploy kind cluster, Argo CD, and all Orchestrator services except o11y and kyverno. func (d Deploy) KindMinimal() error { - return d.all("dev-minimal") + return d.KindPreset("../orch-configs/presets/dev-coder-minimal.yaml") } // Deploy kind cluster, Argo CD, and Orchestrator services with customized settings. @@ -1200,6 +1200,7 @@ func (d Deploy) OrchLocal(targetEnv string) error { return d.orchLocal(targetEnv) } +// OrchCA Saves Orchestrators's CA certificate to `orch-ca.crt` so it can be imported to trust store for web access. func (d Deploy) OrchCA() error { return d.orchCA() } diff --git a/mage/config.go b/mage/config.go index 0789ab649..29508a713 100644 --- a/mage/config.go +++ b/mage/config.go @@ -10,6 +10,7 @@ import ( "io" "os" "path/filepath" + "strconv" "strings" "text/template" @@ -124,8 +125,6 @@ func parseClusterValues(clusterConfigPath string) (map[string]interface{}, error return clusterValues, nil } -// XXX smbaker - cleanup - abandoned this approach -/* func (Config) overrideFromEnvironment(presetData map[string]interface{}) error { // DISABLE_AO_PROFILE, DISABLE_CO_PROFILE, DISABLE_O11Y_PROFILE environment // variables may be used to disable specific subsystems. These environment variable @@ -159,8 +158,8 @@ func (Config) overrideFromEnvironment(presetData map[string]interface{}) error { if disableO11y { presetData["enableObservability"] = false } + return nil } -*/ // Create a cluster deployment configuration from a cluster values file. func (c Config) usePreset(clusterPresetFile string) (string, error) { @@ -187,12 +186,10 @@ func (c Config) usePreset(clusterPresetFile string) (string, error) { presetData["proxyProfile"] = proxyProfilePath } - // XXX smbaker - cleanup - abandoned this approach - // apply any overrides from environment variables - //err = c.overrideFromEnvironment(presetData) - //if err != nil { - //return "", fmt.Errorf("failed to override preset data from environment: %w", err) - //} + err = c.overrideFromEnvironment(presetData) + if err != nil { + return "", fmt.Errorf("failed to override preset data from environment: %w", err) + } var clusterName string if clusterName, err = renderClusterTemplate(presetData); err != nil { diff --git a/mage/deploy.go b/mage/deploy.go index 50cd9eccc..0b882c8f0 100644 --- a/mage/deploy.go +++ b/mage/deploy.go @@ -21,7 +21,6 @@ import ( "os" "os/exec" "path/filepath" - "strconv" "strings" "text/template" "time" @@ -29,7 +28,6 @@ import ( "github.com/bitfield/script" "github.com/magefile/mage/mg" "github.com/magefile/mage/sh" - "gopkg.in/yaml.v3" ) var pwChars = []rune(`abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789`) @@ -1554,86 +1552,17 @@ func (d Deploy) removeProfile(configMap map[string]interface{}, profilePath stri } } -// There are multiple ways that cluster templates might be use. -// 1. By using a preset, which in turn uses cluster.tpl to generate a cluster.yaml -// 2. By using "deploy:kind" or "deploy:kindminimal" which uses a specifically-named cluster.yaml -// 3. By using "deploy:orch" or "deploy:orchLocal" which uses a user-named cluster.yaml -// To handle environment variable overrides from any of these paths that might have led us here, -// just do a final pass over the cluster.yaml we were given, and modify it. - -func (d Deploy) handleEnvOverride(targetConfig string) (string, error) { - orchConfigsDir := getConfigsDir() - - disableAOStr := os.Getenv("DISABLE_AO_PROFILE") - disableAO, err := strconv.ParseBool(disableAOStr) - if err != nil { - return "", fmt.Errorf("failed to parse DISABLE_AO_PROFILE environment variable: %w", err) - } - - disableCOStr := os.Getenv("DISABLE_AO_PROFILE") - disableCO, err := strconv.ParseBool(disableCOStr) - if err != nil { - return "", fmt.Errorf("failed to parse DISABLE_CO_PROFILE environment variable: %w", err) - } - if disableCO { - disableAO = true - } - - disableO11yStr := os.Getenv("DISABLE_O11Y_PROFILE") - disableO11y, err := strconv.ParseBool(disableO11yStr) - if err != nil { - return "", fmt.Errorf("failed to parse DISABLE_O11Y_PROFILE environment variable: %w", err) - } - - // Parse the YAML file in targetConfig - yamlData, err := os.ReadFile(targetConfig) - if err != nil { - fmt.Printf("failed to read target config file: %v\n", err) - return targetConfig, nil - } - var configMap map[string]interface{} - if err := yaml.Unmarshal(yamlData, &configMap); err != nil { - return "", fmt.Errorf("failed to unmarshal config YAML: %v", err) - } - - if disableAO { - d.removeProfile(configMap, "orch-configs/profiles/enable-app-orch.yaml") - } - if disableCO { - d.removeProfile(configMap, "orch-configs/profiles/enable-cluster-orch.yaml") - } - if disableO11y { - d.removeProfile(configMap, "orch-configs/profiles/enable-o11y.yaml") - } - - // Write the modified configMap to a new profile file and return its path - newProfilePath := fmt.Sprintf("%s/clusters/deploy.yaml", orchConfigsDir) - outData, err := yaml.Marshal(configMap) - if err != nil { - return "", fmt.Errorf("failed to marshal modified config YAML: %v", err) - } - if err := os.WriteFile(newProfilePath, outData, 0o644); err != nil { - return "", fmt.Errorf("failed to write new profile file: %v", err) - } - return newProfilePath, nil -} - // Root app that starts the deployment of children apps. func (d Deploy) orch(targetEnv string) error { targetConfig := getTargetConfig(targetEnv) - finalConfig, err := d.handleEnvOverride(targetConfig) - if err != nil { - return err - } - // Clone and update the Gitea deployment repo if err := (Deploy{}).updateDeployRepo(targetEnv, deployRepoPath, deployRepoName, deployGiteaRepoDir); err != nil { return fmt.Errorf("error updating deployment repo content: %w", err) } - cmd := fmt.Sprintf("helm upgrade --install root-app argocd/root-app -f %s -n %s --create-namespace", finalConfig, targetEnv) - _, err = script.Exec(cmd).Stdout() + cmd := fmt.Sprintf("helm upgrade --install root-app argocd/root-app -f %s -n %s --create-namespace", targetConfig, targetEnv) + _, err := script.Exec(cmd).Stdout() return err } @@ -1660,11 +1589,6 @@ func getAWSAvailabilityZone() (string, error) { func (d Deploy) orchLocal(targetEnv string) error { targetConfig := getTargetConfig(targetEnv) - finalConfig, err := d.handleEnvOverride(targetConfig) - if err != nil { - return err - } - // Clone and update the Gitea deployment repo if err := (Deploy{}).updateDeployRepo(targetEnv, deployRepoPath, deployRepoName, deployGiteaRepoDir); err != nil { return fmt.Errorf("error updating deployment repo content: %w", err) @@ -1678,7 +1602,7 @@ func (d Deploy) orchLocal(targetEnv string) error { } cmd := fmt.Sprintf("helm upgrade --install root-app argocd/root-app -f %s -n %s --create-namespace %s %s"+ - "--set root.useLocalValues=true", finalConfig, targetEnv, deployRevision, orchVersion) + "--set root.useLocalValues=true", targetConfig, targetEnv, deployRevision, orchVersion) // only for coder deployments targetAutoCertEnabled, _ := (Config{}).isAutoCertEnabled(targetEnv) diff --git a/orch-configs/clusters/dev-minimal.yaml b/orch-configs/clusters/dev-minimal.yaml deleted file mode 100644 index cc4d4f948..000000000 --- a/orch-configs/clusters/dev-minimal.yaml +++ /dev/null @@ -1,69 +0,0 @@ -# SPDX-FileCopyrightText: 2025 Intel Corporation -# -# SPDX-License-Identifier: Apache-2.0 - -# Cluster specific values applied to root-app only -root: - useLocalValues: false - clusterValues: - - orch-configs/profiles/enable-platform.yaml - - orch-configs/profiles/enable-app-orch.yaml - - orch-configs/profiles/enable-cluster-orch.yaml - - orch-configs/profiles/enable-edgeinfra.yaml - - orch-configs/profiles/enable-full-ui.yaml - - orch-configs/profiles/enable-dev.yaml - # proxy group should be specified as the first post-"enable" profile - - orch-configs/profiles/proxy-none.yaml - - orch-configs/profiles/profile-dev.yaml - - orch-configs/profiles/artifact-rs-production-noauth.yaml - - orch-configs/profiles/enable-osrm-manual-mode.yaml - - orch-configs/profiles/resource-default.yaml - - orch-configs/clusters/dev-minimal.yaml - -# Values applied to both root app and shared among all child apps -argo: - ## Basic cluster information - project: dev - namespace: dev - clusterName: dev - # Base domain name for all Orchestrator services. This base domain will be concatenated with a service's subdomain - # name to produce the service's domain name. For example, given the domain name of `orchestrator.io`, the Web UI - # service will be accessible via `web-ui.orchestrator.io`. Not to be confused with the K8s cluster domain. - clusterDomain: kind.internal - - ## Argo CD configs - deployRepoURL: "https://gitea-http.gitea.svc.cluster.local/argocd/edge-manageability-framework" - deployRepoRevision: main - - targetServer: "https://kubernetes.default.svc" - autosync: true - - # # rate limit is applicable to each cluster. - # # please see https://doc.traefik.io/traefik/middlewares/http/ratelimit/ - # traefik: - # rateLimit: - # # When rateLimit section is not specified or average is set to 0 (default setting), rate limiting will be disabled. - # average: 5 - # # period, in combination with average, defines the actual maximum rate: average / period - # period: 1m - # # burst is the maximum number of requests allowed to go through in the same arbitrarily small period of time. - # burst: 20 - # # If depth is specified, excludedIPs is ignored. - # ipStrategyDepth: 1 - # # Contrary to what the name might suggest, this option is not about excluding an IP from the rate limiter, - # # and therefore cannot be used to deactivate rate limiting for some IPs. - # excludedIps: - # - 10.244.0.1 - -orchestratorDeployment: - targetCluster: kind - enableMailpit: true - argoServiceType: LoadBalancer - -# Post custom template overwrite values should go to /root-app/environments//.yaml -# This is a placeholder to prevent error when there isn't any overwrite needed -postCustomTemplateOverwrite: - traefik: - logs: - general: - level: DEBUG diff --git a/orch-configs/clusters/dev.yaml b/orch-configs/clusters/dev.yaml deleted file mode 100644 index 9f336ca01..000000000 --- a/orch-configs/clusters/dev.yaml +++ /dev/null @@ -1,79 +0,0 @@ -# SPDX-FileCopyrightText: 2025 Intel Corporation -# -# SPDX-License-Identifier: Apache-2.0 - -# Cluster specific values applied to root-app only -root: - useLocalValues: false - clusterValues: - - orch-configs/profiles/enable-platform.yaml - - orch-configs/profiles/enable-o11y.yaml - - orch-configs/profiles/enable-audit.yaml - - orch-configs/profiles/enable-kyverno.yaml - - orch-configs/profiles/enable-app-orch.yaml - - orch-configs/profiles/enable-cluster-orch.yaml - - orch-configs/profiles/enable-edgeinfra.yaml - - orch-configs/profiles/enable-full-ui.yaml - - orch-configs/profiles/enable-dev.yaml - - orch-configs/profiles/enable-sre.yaml - # proxy group should be specified as the first post-"enable" profile - - orch-configs/profiles/proxy-none.yaml - - orch-configs/profiles/profile-dev.yaml - - orch-configs/profiles/artifact-rs-production-noauth.yaml - - orch-configs/profiles/o11y-dev.yaml - - orch-configs/profiles/alerting-emails-dev.yaml - - orch-configs/profiles/enable-osrm-manual-mode.yaml - - orch-configs/profiles/resource-default.yaml - - orch-configs/clusters/dev.yaml - -# Values applied to both root app and shared among all child apps -argo: - ## Basic cluster information - project: dev - namespace: dev - clusterName: dev - # Base domain name for all Orchestrator services. This base domain will be concatenated with a service's subdomain - # name to produce the service's domain name. For example, given the domain name of `orchestrator.io`, the Web UI - # service will be accessible via `web-ui.orchestrator.io`. Not to be confused with the K8s cluster domain. - clusterDomain: kind.internal - - ## Argo CD configs - deployRepoURL: "https://gitea-http.gitea.svc.cluster.local/argocd/edge-manageability-framework" - deployRepoRevision: main - - targetServer: "https://kubernetes.default.svc" - autosync: true - - o11y: - sre: - customerLabel: local - - # # rate limit is applicable to each cluster. - # # please see https://doc.traefik.io/traefik/middlewares/http/ratelimit/ - # traefik: - # rateLimit: - # # When rateLimit section is not specified or average is set to 0 (default setting), rate limiting will be disabled. - # average: 5 - # # period, in combination with average, defines the actual maximum rate: average / period - # period: 1m - # # burst is the maximum number of requests allowed to go through in the same arbitrarily small period of time. - # burst: 20 - # # If depth is specified, excludedIPs is ignored. - # ipStrategyDepth: 1 - # # Contrary to what the name might suggest, this option is not about excluding an IP from the rate limiter, - # # and therefore cannot be used to deactivate rate limiting for some IPs. - # excludedIps: - # - 10.244.0.1 - -orchestratorDeployment: - targetCluster: kind - enableMailpit: true - argoServiceType: LoadBalancer - -# Post custom template overwrite values should go to /root-app/environments//.yaml -# This is a placeholder to prevent error when there isn't any overwrite needed -postCustomTemplateOverwrite: - traefik: - logs: - general: - level: DEBUG diff --git a/orch-configs/presets/dev-coder-minimal.yaml b/orch-configs/presets/dev-coder-minimal.yaml new file mode 100644 index 000000000..391b62795 --- /dev/null +++ b/orch-configs/presets/dev-coder-minimal.yaml @@ -0,0 +1,11 @@ +name: dev-coder-minimal +id: dev +enableObservability: false +enableKyverno: false +enableUiDev: true +enableAutoProvision: false +enableAutoCert: true +enableCoder: true +enableMailpit: true +targetCluster: kind +enableOsrmManualMode: true diff --git a/orch-configs/presets/dev-coder.yaml b/orch-configs/presets/dev-coder.yaml new file mode 100644 index 000000000..886bac149 --- /dev/null +++ b/orch-configs/presets/dev-coder.yaml @@ -0,0 +1,12 @@ +name: dev-coder +id: dev +enableObservability: true +enableAuditLogging: true +enableKyverno: true +enableAutoProvision: false +enableUiDev: true +enableAutoCert: true +enableCoder: true +enableMailpit: true +targetCluster: kind +enableOsrmManualMode: true From 0a3a10d72f684573a512794a90fdd960229e8b42 Mon Sep 17 00:00:00 2001 From: "Baker, Scott" Date: Wed, 22 Oct 2025 11:03:08 -0700 Subject: [PATCH 04/17] fix error if env variables empty --- mage/config.go | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/mage/config.go b/mage/config.go index 29508a713..a4bbe062d 100644 --- a/mage/config.go +++ b/mage/config.go @@ -131,29 +131,39 @@ func (Config) overrideFromEnvironment(presetData map[string]interface{}) error { // names are chosen to maintain parity with the AWS and OnPrem installer environment // variable names. + var err error + var disableAO bool disableAOStr := os.Getenv("DISABLE_AO_PROFILE") - disableAO, err := strconv.ParseBool(disableAOStr) - if err != nil { - return fmt.Errorf("failed to parse DISABLE_AO_PROFILE environment variable: %w", err) + if disableAOStr != "" { + disableAO, err = strconv.ParseBool(disableAOStr) + if err != nil { + return fmt.Errorf("failed to parse DISABLE_AO_PROFILE environment variable: %w", err) + } } if disableAO { presetData["enableAppOrch"] = false } + var disableCO bool disableCOStr := os.Getenv("DISABLE_AO_PROFILE") - disableCO, err := strconv.ParseBool(disableCOStr) - if err != nil { - return fmt.Errorf("failed to parse DISABLE_CO_PROFILE environment variable: %w", err) + if disableCOStr != "" { + disableCO, err = strconv.ParseBool(disableCOStr) + if err != nil { + return fmt.Errorf("failed to parse DISABLE_CO_PROFILE environment variable: %w", err) + } } if disableCO { presetData["enableClusterOrch"] = false presetData["enableAppOrch"] = false } + var disableO11y bool disableO11yStr := os.Getenv("DISABLE_O11Y_PROFILE") - disableO11y, err := strconv.ParseBool(disableO11yStr) - if err != nil { - return fmt.Errorf("failed to parse DISABLE_O11Y_PROFILE environment variable: %w", err) + if disableO11yStr != "" { + disableO11y, err = strconv.ParseBool(disableO11yStr) + if err != nil { + return fmt.Errorf("failed to parse DISABLE_O11Y_PROFILE environment variable: %w", err) + } } if disableO11y { presetData["enableObservability"] = false From 5f5ec33d63d0dc1104ed46e6f20168b267d1d012 Mon Sep 17 00:00:00 2001 From: "Baker, Scott" Date: Wed, 22 Oct 2025 11:16:56 -0700 Subject: [PATCH 05/17] fix template issue --- orch-configs/templates/cluster.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/orch-configs/templates/cluster.tpl b/orch-configs/templates/cluster.tpl index a4c84c21a..8bd214dbd 100644 --- a/orch-configs/templates/cluster.tpl +++ b/orch-configs/templates/cluster.tpl @@ -21,7 +21,7 @@ root: {{- endif }} {{- if .Values.enableClusterOrch }} - orch-configs/profiles/enable-cluster-orch.yaml -{{ -endif }} +{{ -end }} {{- if .Values.enableEdgeInfra }} - orch-configs/profiles/enable-edgeinfra.yaml {{- end }} From 8343baacfb670c659a227d01867ce04d7575f3c9 Mon Sep 17 00:00:00 2001 From: "Baker, Scott" Date: Wed, 22 Oct 2025 11:17:30 -0700 Subject: [PATCH 06/17] fix template issue --- orch-configs/templates/cluster.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/orch-configs/templates/cluster.tpl b/orch-configs/templates/cluster.tpl index 8bd214dbd..f514bc97c 100644 --- a/orch-configs/templates/cluster.tpl +++ b/orch-configs/templates/cluster.tpl @@ -18,7 +18,7 @@ root: {{- end }} {{- if .Values.enableAppOrch }} - orch-configs/profiles/enable-app-orch.yaml -{{- endif }} +{{- end }} {{- if .Values.enableClusterOrch }} - orch-configs/profiles/enable-cluster-orch.yaml {{ -end }} From 2ed97395bfeecf03466d06794a8efa65d940838e Mon Sep 17 00:00:00 2001 From: "Baker, Scott" Date: Wed, 22 Oct 2025 11:18:14 -0700 Subject: [PATCH 07/17] fix template issue --- orch-configs/templates/cluster.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/orch-configs/templates/cluster.tpl b/orch-configs/templates/cluster.tpl index f514bc97c..316c217f3 100644 --- a/orch-configs/templates/cluster.tpl +++ b/orch-configs/templates/cluster.tpl @@ -21,7 +21,7 @@ root: {{- end }} {{- if .Values.enableClusterOrch }} - orch-configs/profiles/enable-cluster-orch.yaml -{{ -end }} +{{- end }} {{- if .Values.enableEdgeInfra }} - orch-configs/profiles/enable-edgeinfra.yaml {{- end }} From 673b9b5b24e8cc39e17df3622f47c0d59ca0e81f Mon Sep 17 00:00:00 2001 From: "Baker, Scott" Date: Wed, 22 Oct 2025 13:50:35 -0700 Subject: [PATCH 08/17] remove unused function --- mage/deploy.go | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/mage/deploy.go b/mage/deploy.go index 0b882c8f0..7189682f1 100644 --- a/mage/deploy.go +++ b/mage/deploy.go @@ -1539,19 +1539,6 @@ func getOrchestratorVersionParam() (string, error) { return fmt.Sprintf("--set-string argo.orchestratorVersion=%s ", version), nil } -func (d Deploy) removeProfile(configMap map[string]interface{}, profilePath string) { - // Modify the profiles list to remove "ao" profile - if profiles, ok := configMap["profiles"].([]interface{}); ok { - var updatedProfiles []interface{} - for _, profile := range profiles { - if profileStr, ok := profile.(string); ok && profileStr != "ao" { - updatedProfiles = append(updatedProfiles, profileStr) - } - } - configMap["profiles"] = updatedProfiles - } -} - // Root app that starts the deployment of children apps. func (d Deploy) orch(targetEnv string) error { targetConfig := getTargetConfig(targetEnv) From 7f38f85de0b41d1ca57b52a3079ab8f93400408b Mon Sep 17 00:00:00 2001 From: "Baker, Scott" Date: Wed, 22 Oct 2025 13:53:51 -0700 Subject: [PATCH 09/17] fix license --- orch-configs/presets/dev-coder-minimal.yaml | 4 ++++ orch-configs/presets/dev-coder.yaml | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/orch-configs/presets/dev-coder-minimal.yaml b/orch-configs/presets/dev-coder-minimal.yaml index 391b62795..095291994 100644 --- a/orch-configs/presets/dev-coder-minimal.yaml +++ b/orch-configs/presets/dev-coder-minimal.yaml @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2025 Intel Corporation +# +# SPDX-License-Identifier: Apache-2.0 + name: dev-coder-minimal id: dev enableObservability: false diff --git a/orch-configs/presets/dev-coder.yaml b/orch-configs/presets/dev-coder.yaml index 886bac149..a4bb2111b 100644 --- a/orch-configs/presets/dev-coder.yaml +++ b/orch-configs/presets/dev-coder.yaml @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2025 Intel Corporation +# +# SPDX-License-Identifier: Apache-2.0 + name: dev-coder id: dev enableObservability: true From 9d9ff0951a7621e614f35596e34129247477189c Mon Sep 17 00:00:00 2001 From: "Baker, Scott" Date: Wed, 22 Oct 2025 14:32:40 -0700 Subject: [PATCH 10/17] working on dev profiles --- mage/Magefile.go | 4 ++-- orch-configs/templates/cluster.tpl | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/mage/Magefile.go b/mage/Magefile.go index 32426c687..6de32577f 100644 --- a/mage/Magefile.go +++ b/mage/Magefile.go @@ -464,12 +464,12 @@ type Deploy mg.Namespace // Deploy kind cluster, Argo CD, and all Orchestrator services. func (d Deploy) KindAll() error { - return d.KindPreset("../orch-configs/presets/dev-coder.yaml") + return d.KindPreset(filepath.Join(getConfigsDir(), "presets", "dev-coder.yaml")) } // Deploy kind cluster, Argo CD, and all Orchestrator services except o11y and kyverno. func (d Deploy) KindMinimal() error { - return d.KindPreset("../orch-configs/presets/dev-coder-minimal.yaml") + return d.KindPreset(filepath.Join(getConfigsDir(), "presets", "dev-coder-minimal.yaml")) } // Deploy kind cluster, Argo CD, and Orchestrator services with customized settings. diff --git a/orch-configs/templates/cluster.tpl b/orch-configs/templates/cluster.tpl index 316c217f3..a4d136c03 100644 --- a/orch-configs/templates/cluster.tpl +++ b/orch-configs/templates/cluster.tpl @@ -134,7 +134,9 @@ orchestratorDeployment: targetCluster: {{ .Values.targetCluster }} enableMailpit: {{ .Values.enableMailpit }} argoServiceType: {{ .Values.argoServiceType }} +{{- if .Values.dockerCache }} dockerCache: "{{ .Values.dockerCache }}" +{{- end }} {{- if and .Values.dockerCacheCert }} dockerCacheCert: | {{ .Values.dockerCacheCert | indent 4 }} From f7bb9e0aa606aeb65f380dfb647ea632775fea73 Mon Sep 17 00:00:00 2001 From: "Baker, Scott" Date: Wed, 22 Oct 2025 15:34:04 -0700 Subject: [PATCH 11/17] fix wrong env var name --- mage/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mage/config.go b/mage/config.go index a4bbe062d..257f35c1a 100644 --- a/mage/config.go +++ b/mage/config.go @@ -145,7 +145,7 @@ func (Config) overrideFromEnvironment(presetData map[string]interface{}) error { } var disableCO bool - disableCOStr := os.Getenv("DISABLE_AO_PROFILE") + disableCOStr := os.Getenv("DISABLE_CO_PROFILE") if disableCOStr != "" { disableCO, err = strconv.ParseBool(disableCOStr) if err != nil { From 78f47da3b90e8abedc964e445c94315b4315252e Mon Sep 17 00:00:00 2001 From: "Baker, Scott" Date: Mon, 27 Oct 2025 14:15:27 -0700 Subject: [PATCH 12/17] change dev-coder to dev --- mage/Magefile.go | 4 ++-- .../presets/{dev-coder-minimal.yaml => dev-minimal.yaml} | 0 orch-configs/presets/{dev-coder.yaml => dev.yaml} | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename orch-configs/presets/{dev-coder-minimal.yaml => dev-minimal.yaml} (100%) rename orch-configs/presets/{dev-coder.yaml => dev.yaml} (100%) diff --git a/mage/Magefile.go b/mage/Magefile.go index 6de32577f..55d601328 100644 --- a/mage/Magefile.go +++ b/mage/Magefile.go @@ -464,12 +464,12 @@ type Deploy mg.Namespace // Deploy kind cluster, Argo CD, and all Orchestrator services. func (d Deploy) KindAll() error { - return d.KindPreset(filepath.Join(getConfigsDir(), "presets", "dev-coder.yaml")) + return d.KindPreset(filepath.Join(getConfigsDir(), "presets", "dev.yaml")) } // Deploy kind cluster, Argo CD, and all Orchestrator services except o11y and kyverno. func (d Deploy) KindMinimal() error { - return d.KindPreset(filepath.Join(getConfigsDir(), "presets", "dev-coder-minimal.yaml")) + return d.KindPreset(filepath.Join(getConfigsDir(), "presets", "dev-minimal.yaml")) } // Deploy kind cluster, Argo CD, and Orchestrator services with customized settings. diff --git a/orch-configs/presets/dev-coder-minimal.yaml b/orch-configs/presets/dev-minimal.yaml similarity index 100% rename from orch-configs/presets/dev-coder-minimal.yaml rename to orch-configs/presets/dev-minimal.yaml diff --git a/orch-configs/presets/dev-coder.yaml b/orch-configs/presets/dev.yaml similarity index 100% rename from orch-configs/presets/dev-coder.yaml rename to orch-configs/presets/dev.yaml From 8045eb1a9da975bf1235bc692c40d5a1873a8437 Mon Sep 17 00:00:00 2001 From: "Baker, Scott" Date: Mon, 27 Oct 2025 14:18:21 -0700 Subject: [PATCH 13/17] disable auto-cert in dev and dev-minimal presets --- orch-configs/presets/dev-minimal.yaml | 2 +- orch-configs/presets/dev.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/orch-configs/presets/dev-minimal.yaml b/orch-configs/presets/dev-minimal.yaml index 095291994..b348d8719 100644 --- a/orch-configs/presets/dev-minimal.yaml +++ b/orch-configs/presets/dev-minimal.yaml @@ -8,7 +8,7 @@ enableObservability: false enableKyverno: false enableUiDev: true enableAutoProvision: false -enableAutoCert: true +enableAutoCert: false enableCoder: true enableMailpit: true targetCluster: kind diff --git a/orch-configs/presets/dev.yaml b/orch-configs/presets/dev.yaml index a4bb2111b..937cbb108 100644 --- a/orch-configs/presets/dev.yaml +++ b/orch-configs/presets/dev.yaml @@ -9,7 +9,7 @@ enableAuditLogging: true enableKyverno: true enableAutoProvision: false enableUiDev: true -enableAutoCert: true +enableAutoCert: false enableCoder: true enableMailpit: true targetCluster: kind From 525624171d4878d45f606900ce0fc94afec96c32 Mon Sep 17 00:00:00 2001 From: "Baker, Scott" Date: Mon, 27 Oct 2025 17:32:27 -0700 Subject: [PATCH 14/17] try to get enic deploy working --- mage/Magefile.go | 4 ++-- mage/config.go | 15 ++++++++++++++- mage/dev_utils.go | 3 +++ 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/mage/Magefile.go b/mage/Magefile.go index 55d601328..bf26602d2 100644 --- a/mage/Magefile.go +++ b/mage/Magefile.go @@ -464,12 +464,12 @@ type Deploy mg.Namespace // Deploy kind cluster, Argo CD, and all Orchestrator services. func (d Deploy) KindAll() error { - return d.KindPreset(filepath.Join(getConfigsDir(), "presets", "dev.yaml")) + return d.KindPreset("dev") } // Deploy kind cluster, Argo CD, and all Orchestrator services except o11y and kyverno. func (d Deploy) KindMinimal() error { - return d.KindPreset(filepath.Join(getConfigsDir(), "presets", "dev-minimal.yaml")) + return d.KindPreset("dev-minimal") } // Deploy kind cluster, Argo CD, and Orchestrator services with customized settings. diff --git a/mage/config.go b/mage/config.go index 257f35c1a..502230ab3 100644 --- a/mage/config.go +++ b/mage/config.go @@ -8,6 +8,7 @@ import ( "bytes" "fmt" "io" + "log" "os" "path/filepath" "strconv" @@ -171,8 +172,20 @@ func (Config) overrideFromEnvironment(presetData map[string]interface{}) error { return nil } -// Create a cluster deployment configuration from a cluster values file. +// Create a cluster deployment configuration from a cluster template and a preset file. func (c Config) usePreset(clusterPresetFile string) (string, error) { + // For compatibility with older mage usage + // "dev" -> use the dev.yaml preset + // "dev-minimal" -> use the dev-minimal.yaml preset + switch clusterPresetFile { + case "dev": + clusterPresetFile = filepath.Join(getConfigsDir(), "presets", "dev.yaml") + log.Printf("Using preset file: %s\n", clusterPresetFile) + case "dev-minimal": + clusterPresetFile = filepath.Join(getConfigsDir(), "presets", "dev-minimal.yaml") + log.Printf("Using preset file: %s\n", clusterPresetFile) + } + clusterValues, err := os.ReadFile(clusterPresetFile) if err != nil { return "", fmt.Errorf("failed to read cluster preset file: %w", err) diff --git a/mage/dev_utils.go b/mage/dev_utils.go index 267e0612e..b2481a8e2 100644 --- a/mage/dev_utils.go +++ b/mage/dev_utils.go @@ -33,6 +33,9 @@ import ( // Deploys the ENiC (indicates the number of instances, optionally set env variables: ORCH_FQDN, ORCH_IP, ORCH_USER, ORCH_PASS, ORCH_ORG, ORCH_PROJECT). func (DevUtils) DeployEnic(replicas int, targetEnv string) error { + var err error + targetEnv, err = Config{}.usePreset(targetEnv) + deployRevision := giteaDeployRevisionParam() namespace := "utils" orchestratorIp, err := getPrimaryIP() From d7f2cc39c43b133daac7da3ea28286c03457a504 Mon Sep 17 00:00:00 2001 From: "Baker, Scott" Date: Mon, 27 Oct 2025 18:03:25 -0700 Subject: [PATCH 15/17] fix lint --- mage/dev_utils.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mage/dev_utils.go b/mage/dev_utils.go index b2481a8e2..4f282b956 100644 --- a/mage/dev_utils.go +++ b/mage/dev_utils.go @@ -33,8 +33,10 @@ import ( // Deploys the ENiC (indicates the number of instances, optionally set env variables: ORCH_FQDN, ORCH_IP, ORCH_USER, ORCH_PASS, ORCH_ORG, ORCH_PROJECT). func (DevUtils) DeployEnic(replicas int, targetEnv string) error { - var err error - targetEnv, err = Config{}.usePreset(targetEnv) + targetEnv, err := Config{}.usePreset(targetEnv) + if err != nil { + return err + } deployRevision := giteaDeployRevisionParam() namespace := "utils" From 72f7bcfbde0f8e87f48ff4735f97d5ec66f95d12 Mon Sep 17 00:00:00 2001 From: "Baker, Scott" Date: Mon, 27 Oct 2025 18:55:14 -0700 Subject: [PATCH 16/17] revert all changes related to mage deploy:kind and deploy:kindMinimal --- mage/Magefile.go | 4 +- mage/config.go | 13 ----- mage/dev_utils.go | 5 -- orch-configs/clusters/dev-minimal.yaml | 69 ++++++++++++++++++++++ orch-configs/clusters/dev.yaml | 79 ++++++++++++++++++++++++++ orch-configs/presets/dev-minimal.yaml | 15 ----- orch-configs/presets/dev.yaml | 16 ------ 7 files changed, 150 insertions(+), 51 deletions(-) create mode 100644 orch-configs/clusters/dev-minimal.yaml create mode 100644 orch-configs/clusters/dev.yaml delete mode 100644 orch-configs/presets/dev-minimal.yaml delete mode 100644 orch-configs/presets/dev.yaml diff --git a/mage/Magefile.go b/mage/Magefile.go index bf26602d2..493a99bed 100644 --- a/mage/Magefile.go +++ b/mage/Magefile.go @@ -464,12 +464,12 @@ type Deploy mg.Namespace // Deploy kind cluster, Argo CD, and all Orchestrator services. func (d Deploy) KindAll() error { - return d.KindPreset("dev") + return d.all("dev") } // Deploy kind cluster, Argo CD, and all Orchestrator services except o11y and kyverno. func (d Deploy) KindMinimal() error { - return d.KindPreset("dev-minimal") + return d.all("dev-minimal") } // Deploy kind cluster, Argo CD, and Orchestrator services with customized settings. diff --git a/mage/config.go b/mage/config.go index 502230ab3..a544341e3 100644 --- a/mage/config.go +++ b/mage/config.go @@ -8,7 +8,6 @@ import ( "bytes" "fmt" "io" - "log" "os" "path/filepath" "strconv" @@ -174,18 +173,6 @@ func (Config) overrideFromEnvironment(presetData map[string]interface{}) error { // Create a cluster deployment configuration from a cluster template and a preset file. func (c Config) usePreset(clusterPresetFile string) (string, error) { - // For compatibility with older mage usage - // "dev" -> use the dev.yaml preset - // "dev-minimal" -> use the dev-minimal.yaml preset - switch clusterPresetFile { - case "dev": - clusterPresetFile = filepath.Join(getConfigsDir(), "presets", "dev.yaml") - log.Printf("Using preset file: %s\n", clusterPresetFile) - case "dev-minimal": - clusterPresetFile = filepath.Join(getConfigsDir(), "presets", "dev-minimal.yaml") - log.Printf("Using preset file: %s\n", clusterPresetFile) - } - clusterValues, err := os.ReadFile(clusterPresetFile) if err != nil { return "", fmt.Errorf("failed to read cluster preset file: %w", err) diff --git a/mage/dev_utils.go b/mage/dev_utils.go index 4f282b956..267e0612e 100644 --- a/mage/dev_utils.go +++ b/mage/dev_utils.go @@ -33,11 +33,6 @@ import ( // Deploys the ENiC (indicates the number of instances, optionally set env variables: ORCH_FQDN, ORCH_IP, ORCH_USER, ORCH_PASS, ORCH_ORG, ORCH_PROJECT). func (DevUtils) DeployEnic(replicas int, targetEnv string) error { - targetEnv, err := Config{}.usePreset(targetEnv) - if err != nil { - return err - } - deployRevision := giteaDeployRevisionParam() namespace := "utils" orchestratorIp, err := getPrimaryIP() diff --git a/orch-configs/clusters/dev-minimal.yaml b/orch-configs/clusters/dev-minimal.yaml new file mode 100644 index 000000000..cc4d4f948 --- /dev/null +++ b/orch-configs/clusters/dev-minimal.yaml @@ -0,0 +1,69 @@ +# SPDX-FileCopyrightText: 2025 Intel Corporation +# +# SPDX-License-Identifier: Apache-2.0 + +# Cluster specific values applied to root-app only +root: + useLocalValues: false + clusterValues: + - orch-configs/profiles/enable-platform.yaml + - orch-configs/profiles/enable-app-orch.yaml + - orch-configs/profiles/enable-cluster-orch.yaml + - orch-configs/profiles/enable-edgeinfra.yaml + - orch-configs/profiles/enable-full-ui.yaml + - orch-configs/profiles/enable-dev.yaml + # proxy group should be specified as the first post-"enable" profile + - orch-configs/profiles/proxy-none.yaml + - orch-configs/profiles/profile-dev.yaml + - orch-configs/profiles/artifact-rs-production-noauth.yaml + - orch-configs/profiles/enable-osrm-manual-mode.yaml + - orch-configs/profiles/resource-default.yaml + - orch-configs/clusters/dev-minimal.yaml + +# Values applied to both root app and shared among all child apps +argo: + ## Basic cluster information + project: dev + namespace: dev + clusterName: dev + # Base domain name for all Orchestrator services. This base domain will be concatenated with a service's subdomain + # name to produce the service's domain name. For example, given the domain name of `orchestrator.io`, the Web UI + # service will be accessible via `web-ui.orchestrator.io`. Not to be confused with the K8s cluster domain. + clusterDomain: kind.internal + + ## Argo CD configs + deployRepoURL: "https://gitea-http.gitea.svc.cluster.local/argocd/edge-manageability-framework" + deployRepoRevision: main + + targetServer: "https://kubernetes.default.svc" + autosync: true + + # # rate limit is applicable to each cluster. + # # please see https://doc.traefik.io/traefik/middlewares/http/ratelimit/ + # traefik: + # rateLimit: + # # When rateLimit section is not specified or average is set to 0 (default setting), rate limiting will be disabled. + # average: 5 + # # period, in combination with average, defines the actual maximum rate: average / period + # period: 1m + # # burst is the maximum number of requests allowed to go through in the same arbitrarily small period of time. + # burst: 20 + # # If depth is specified, excludedIPs is ignored. + # ipStrategyDepth: 1 + # # Contrary to what the name might suggest, this option is not about excluding an IP from the rate limiter, + # # and therefore cannot be used to deactivate rate limiting for some IPs. + # excludedIps: + # - 10.244.0.1 + +orchestratorDeployment: + targetCluster: kind + enableMailpit: true + argoServiceType: LoadBalancer + +# Post custom template overwrite values should go to /root-app/environments//.yaml +# This is a placeholder to prevent error when there isn't any overwrite needed +postCustomTemplateOverwrite: + traefik: + logs: + general: + level: DEBUG diff --git a/orch-configs/clusters/dev.yaml b/orch-configs/clusters/dev.yaml new file mode 100644 index 000000000..9f336ca01 --- /dev/null +++ b/orch-configs/clusters/dev.yaml @@ -0,0 +1,79 @@ +# SPDX-FileCopyrightText: 2025 Intel Corporation +# +# SPDX-License-Identifier: Apache-2.0 + +# Cluster specific values applied to root-app only +root: + useLocalValues: false + clusterValues: + - orch-configs/profiles/enable-platform.yaml + - orch-configs/profiles/enable-o11y.yaml + - orch-configs/profiles/enable-audit.yaml + - orch-configs/profiles/enable-kyverno.yaml + - orch-configs/profiles/enable-app-orch.yaml + - orch-configs/profiles/enable-cluster-orch.yaml + - orch-configs/profiles/enable-edgeinfra.yaml + - orch-configs/profiles/enable-full-ui.yaml + - orch-configs/profiles/enable-dev.yaml + - orch-configs/profiles/enable-sre.yaml + # proxy group should be specified as the first post-"enable" profile + - orch-configs/profiles/proxy-none.yaml + - orch-configs/profiles/profile-dev.yaml + - orch-configs/profiles/artifact-rs-production-noauth.yaml + - orch-configs/profiles/o11y-dev.yaml + - orch-configs/profiles/alerting-emails-dev.yaml + - orch-configs/profiles/enable-osrm-manual-mode.yaml + - orch-configs/profiles/resource-default.yaml + - orch-configs/clusters/dev.yaml + +# Values applied to both root app and shared among all child apps +argo: + ## Basic cluster information + project: dev + namespace: dev + clusterName: dev + # Base domain name for all Orchestrator services. This base domain will be concatenated with a service's subdomain + # name to produce the service's domain name. For example, given the domain name of `orchestrator.io`, the Web UI + # service will be accessible via `web-ui.orchestrator.io`. Not to be confused with the K8s cluster domain. + clusterDomain: kind.internal + + ## Argo CD configs + deployRepoURL: "https://gitea-http.gitea.svc.cluster.local/argocd/edge-manageability-framework" + deployRepoRevision: main + + targetServer: "https://kubernetes.default.svc" + autosync: true + + o11y: + sre: + customerLabel: local + + # # rate limit is applicable to each cluster. + # # please see https://doc.traefik.io/traefik/middlewares/http/ratelimit/ + # traefik: + # rateLimit: + # # When rateLimit section is not specified or average is set to 0 (default setting), rate limiting will be disabled. + # average: 5 + # # period, in combination with average, defines the actual maximum rate: average / period + # period: 1m + # # burst is the maximum number of requests allowed to go through in the same arbitrarily small period of time. + # burst: 20 + # # If depth is specified, excludedIPs is ignored. + # ipStrategyDepth: 1 + # # Contrary to what the name might suggest, this option is not about excluding an IP from the rate limiter, + # # and therefore cannot be used to deactivate rate limiting for some IPs. + # excludedIps: + # - 10.244.0.1 + +orchestratorDeployment: + targetCluster: kind + enableMailpit: true + argoServiceType: LoadBalancer + +# Post custom template overwrite values should go to /root-app/environments//.yaml +# This is a placeholder to prevent error when there isn't any overwrite needed +postCustomTemplateOverwrite: + traefik: + logs: + general: + level: DEBUG diff --git a/orch-configs/presets/dev-minimal.yaml b/orch-configs/presets/dev-minimal.yaml deleted file mode 100644 index b348d8719..000000000 --- a/orch-configs/presets/dev-minimal.yaml +++ /dev/null @@ -1,15 +0,0 @@ -# SPDX-FileCopyrightText: 2025 Intel Corporation -# -# SPDX-License-Identifier: Apache-2.0 - -name: dev-coder-minimal -id: dev -enableObservability: false -enableKyverno: false -enableUiDev: true -enableAutoProvision: false -enableAutoCert: false -enableCoder: true -enableMailpit: true -targetCluster: kind -enableOsrmManualMode: true diff --git a/orch-configs/presets/dev.yaml b/orch-configs/presets/dev.yaml deleted file mode 100644 index 937cbb108..000000000 --- a/orch-configs/presets/dev.yaml +++ /dev/null @@ -1,16 +0,0 @@ -# SPDX-FileCopyrightText: 2025 Intel Corporation -# -# SPDX-License-Identifier: Apache-2.0 - -name: dev-coder -id: dev -enableObservability: true -enableAuditLogging: true -enableKyverno: true -enableAutoProvision: false -enableUiDev: true -enableAutoCert: false -enableCoder: true -enableMailpit: true -targetCluster: kind -enableOsrmManualMode: true From 861f2d06c16d32e90e35826a516539fb33bbbd06 Mon Sep 17 00:00:00 2001 From: "Baker, Scott" Date: Mon, 27 Oct 2025 19:04:00 -0700 Subject: [PATCH 17/17] more comments --- mage/config.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mage/config.go b/mage/config.go index a544341e3..9ef2e77fd 100644 --- a/mage/config.go +++ b/mage/config.go @@ -130,6 +130,10 @@ func (Config) overrideFromEnvironment(presetData map[string]interface{}) error { // variables may be used to disable specific subsystems. These environment variable // names are chosen to maintain parity with the AWS and OnPrem installer environment // variable names. + // + // Note that these are only use when using presents, i.e. "mage deploy:kindPreset". + // The "mage deploy:Kind" and "deploy: KindMinimal" targets do not use presets and + // are not affected by these environment variables. var err error var disableAO bool