Skip to content
5 changes: 1 addition & 4 deletions actions/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@ func main() {
sc.Host = cfg.Server.Host
sc.Port = cfg.Server.Port

k8sClient, _, err := app.InitKubernetesClient(ctx, app.K8sConfig{
KubeConfig: cfg.Kubernetes.KubeConfig,
Namespace: cfg.Kubernetes.Namespace,
}, nil)
k8sClient, _, err := app.InitKubernetesClient(ctx, cfg.Kubernetes, nil)
if err != nil {
return fmt.Errorf("failed to initialize Kubernetes client: %w", err)
}
Expand Down
20 changes: 8 additions & 12 deletions actions/config/config.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package config

import (
"github.com/flyteorg/flyte/v2/flytestdlib/app"
"github.com/flyteorg/flyte/v2/flytestdlib/config"
)

Expand All @@ -13,8 +14,11 @@ var defaultConfig = &Config{
Port: 8091,
Host: "0.0.0.0",
},
Kubernetes: KubernetesConfig{
Kubernetes: app.K8sConfig{
Namespace: "flyte",
QPS: 1000,
Burst: 2000,
Timeout: "30s",
Comment thread
pingsutw marked this conversation as resolved.
},
Comment thread
pingsutw marked this conversation as resolved.
Comment on lines +17 to 22
WatchBufferSize: 100,
WatchWorkers: 10,
Expand All @@ -30,8 +34,9 @@ type Config struct {
// HTTP server configuration
Server ServerConfig `json:"server"`

// Kubernetes configuration
Kubernetes KubernetesConfig `json:"kubernetes"`
// Kubernetes configuration (namespace where TaskAction CRs live; the unified
// binary shares the manager's client, this is read by the standalone cmd).
Kubernetes app.K8sConfig `json:"kubernetes"`

// WatchBufferSize is the buffer size for each worker's event channel.
WatchBufferSize int `json:"watchBufferSize" pflag:",Buffer size for watch channels"`
Expand All @@ -53,15 +58,6 @@ type ServerConfig struct {
Host string `json:"host" pflag:",Host to bind the HTTP server"`
}

// KubernetesConfig holds Kubernetes client configuration
type KubernetesConfig struct {
// Namespace where TaskAction CRs are located
Namespace string `json:"namespace" pflag:",Kubernetes namespace for TaskAction CRs"`

// KubeConfig path (optional - if empty, uses in-cluster config)
KubeConfig string `json:"kubeconfig" pflag:",Path to kubeconfig file (optional)"`
}

// GetConfig returns the parsed actions configuration
func GetConfig() *Config {
return configSection.GetConfig().(*Config)
Expand Down
6 changes: 5 additions & 1 deletion actions/config/config_flags.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

64 changes: 60 additions & 4 deletions actions/config/config_flags_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 1 addition & 13 deletions charts/flyte-binary/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,6 @@ commonAnnotations: {}

# flyte-core-components: Configuration for the unified Flyte Manager
flyte-core-components:
manager:
server:
host: "0.0.0.0"
port: 8090
executor:
healthProbePort: 8081
kubernetes:
namespace: "flyte"
kubeconfig: ""
qps: 1000
burst: 2000
timeout: "30s"
runs:
server:
host: "0.0.0.0"
Expand Down Expand Up @@ -59,11 +47,11 @@ flyte-core-components:
secret:
kubernetes:
namespace: "flyte"
clusterName: "flyte-devbox"
kubeconfig: ""
qps: 100
burst: 200
timeout: "30s"
clusterName: "flyte-devbox"
Comment thread
pingsutw marked this conversation as resolved.

# configuration Specify configuration for Flyte
configuration:
Expand Down
14 changes: 1 addition & 13 deletions docker/devbox-bundled/manifests/complete.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7704,18 +7704,6 @@ data:
maxExpiresIn: 1h
maxSize: 100Mi
storagePrefix: uploads
manager:
executor:
healthProbePort: 8081
kubernetes:
burst: 2000
kubeconfig: ""
namespace: flyte
qps: 1000
timeout: 30s
server:
host: 0.0.0.0
port: 8090
runs:
database:
connMaxLifeTime: 1h
Expand Down Expand Up @@ -8612,7 +8600,7 @@ spec:
template:
metadata:
annotations:
checksum/configuration: d2aec94f19fbf15dce1dd1e0530da68a0c2de5043a3a89155daa31eb212fbacb
checksum/configuration: b3eeb7732d0979610dd7e90fc2681bc752f4c2318ff8df52e3d3651aa49bacd1
checksum/configuration-secret: 800f306f43701bd39e3b42e0d756f4627643cf3cee6dbd050a5a57a08052c280
labels:
app.kubernetes.io/component: flyte-binary
Expand Down
20 changes: 15 additions & 5 deletions flytestdlib/app/k8s.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,22 @@ import (
)

// K8sConfig holds Kubernetes connection options used by InitKubernetesClient.
// It is also the shared `kubernetes` config section for the services (manager,
// actions, secret), so it carries json/pflag tags.
type K8sConfig struct {
KubeConfig string // path to kubeconfig (empty → in-cluster → default)
Namespace string // namespace to ensure exists
QPS int // API server QPS limit
Burst int // API server burst limit
Timeout string // API server request timeout (e.g. "30s")
// KubeConfig is the path to a kubeconfig file (empty → in-cluster → default).
KubeConfig string `json:"kubeconfig" pflag:",Path to kubeconfig file (optional)"`
// Namespace to ensure exists / operate in.
Namespace string `json:"namespace" pflag:",Kubernetes namespace"`
// QPS is the API server queries-per-second limit (0 → client default).
QPS int `json:"qps" pflag:",Maximum queries per second to the Kubernetes API server"`
// Burst is the API server burst limit (0 → client default).
Burst int `json:"burst" pflag:",Maximum burst above QPS for Kubernetes API server requests"`
// Timeout is the API server request timeout, e.g. "30s" (empty → client default).
Timeout string `json:"timeout" pflag:",Request timeout for Kubernetes API server calls (e.g. 30s)"`
// ClusterName is the logical name of this cluster, used by the secret service
// for secret status reporting.
ClusterName string `json:"clusterName" pflag:",Logical name of the Kubernetes cluster"`
}

// InitKubernetesClient creates a controller-runtime WithWatch client.
Expand Down
23 changes: 10 additions & 13 deletions manager/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"os"

"github.com/flyteorg/flyte/v2/actions"
actionsconfig "github.com/flyteorg/flyte/v2/actions/config"
flyteapp "github.com/flyteorg/flyte/v2/app"
"github.com/flyteorg/flyte/v2/cache_service"
"github.com/flyteorg/flyte/v2/dataproxy"
Expand All @@ -18,7 +19,6 @@ import (
"github.com/flyteorg/flyte/v2/flytestdlib/promutils"
"github.com/flyteorg/flyte/v2/flytestdlib/promutils/labeled"
"github.com/flyteorg/flyte/v2/flytestdlib/storage"
managerconfig "github.com/flyteorg/flyte/v2/manager/config"
"github.com/flyteorg/flyte/v2/runs"
runsconfig "github.com/flyteorg/flyte/v2/runs/config"
"github.com/flyteorg/flyte/v2/secret"
Expand All @@ -37,12 +37,15 @@ func main() {
}

func setup(ctx context.Context, sc *app.SetupContext) error {
cfg := managerconfig.GetConfig()
sc.Host = cfg.Server.Host
sc.Port = cfg.Server.Port
sc.Namespace = cfg.Kubernetes.Namespace
// Reuse the run service's server config and the actions service's Kubernetes
// config rather than maintaining a duplicate manager-specific section.
serverCfg := runsconfig.GetConfig().Server
k8sCfg := actionsconfig.GetConfig().Kubernetes
sc.Host = serverCfg.Host
sc.Port = serverCfg.Port
sc.Namespace = k8sCfg.Namespace
Comment thread
pingsutw marked this conversation as resolved.
sc.Middleware = corsMiddleware
sc.BaseURL = fmt.Sprintf("http://localhost:%d", cfg.Server.Port)
sc.BaseURL = fmt.Sprintf("http://localhost:%d", serverCfg.Port)

// Initialize database
dbCfg := &runsconfig.GetConfig().Database
Expand All @@ -58,13 +61,7 @@ func setup(ctx context.Context, sc *app.SetupContext) error {
}

// Initialize Kubernetes client
k8sClient, k8sConfig, err := app.InitKubernetesClient(ctx, app.K8sConfig{
KubeConfig: cfg.Kubernetes.KubeConfig,
Namespace: cfg.Kubernetes.Namespace,
QPS: cfg.Kubernetes.QPS,
Burst: cfg.Kubernetes.Burst,
Timeout: cfg.Kubernetes.Timeout,
}, executor.Scheme())
k8sClient, k8sConfig, err := app.InitKubernetesClient(ctx, k8sCfg, executor.Scheme())
if err != nil {
return fmt.Errorf("failed to initialize Kubernetes client: %w", err)
}
Expand Down
19 changes: 7 additions & 12 deletions manager/config.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
# Unified Flyte Manager Configuration

manager:
# Single server port for all Connect services (Runs, State, Queue, DataProxy)
server:
host: "0.0.0.0"
port: 8090

executor:
healthProbePort: 8081

# Kubernetes config for the shared client used by all services.
actions:
kubernetes:
namespace: "flyte"
kubeconfig: "~/.kube/config"
Comment thread
pingsutw marked this conversation as resolved.
Expand Down Expand Up @@ -48,7 +39,7 @@ webhook:
embeddedSecretManagerConfig:
type: K8s
k8sConfig:
# Must match manager.kubernetes.namespace above — the namespace where
# Must match actions.kubernetes.namespace above — the namespace where
# SecretService writes secrets.
namespace: flyte

Expand All @@ -60,6 +51,10 @@ executor:

# Runs service configuration
runs:
# Single server port for all Connect services (Runs, Action, DataProxy)
server:
host: "0.0.0.0"
port: 8090
storagePrefix: "s3://flyte-data"
database:
postgres:
Expand Down
65 changes: 0 additions & 65 deletions manager/config/config.go

This file was deleted.

Loading
Loading