-
Notifications
You must be signed in to change notification settings - Fork 881
Expand file tree
/
Copy pathsandbox_config.go
More file actions
61 lines (45 loc) · 3.06 KB
/
Copy pathsandbox_config.go
File metadata and controls
61 lines (45 loc) · 3.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
package sandbox
import (
"github.com/flyteorg/flyte/flytectl/pkg/docker"
)
// Config holds configuration flags for sandbox command.
type Config struct {
DeprecatedSource string `json:"source" pflag:",deprecated, path of your source code, please build images with local daemon"`
// Flytectl sandbox only supports Flyte version available in Github release https://github.com/flyteorg/flyte/tags.
// Flytectl sandbox will only work for v0.10.0+.
// Default value dind represents the latest release.
Version string `json:"version" pflag:",Version of flyte. Only supports flyte releases greater than v0.10.0"`
// Optionally it is possible to specify a specific fqn for the docker image with the tag. This should be
// Flyte compliant sandbox image. Usually useful, if you want to push the image to your own registry and relaunch
// from there.
Image string `json:"image" pflag:",Optional. Provide a fully qualified path to a Flyte compliant docker image."`
// Default value false represents that Flytectl will not use the latest pre-release if it exists.
Prerelease bool `json:"pre" pflag:",Optional. Pre release Version of flyte will be used for sandbox."`
// Agent Service
DisableAgent bool `json:"disable-agent" pflag:",Optional. Disable the agent service."`
// Connector Service
DisableConnector bool `json:"disable-connector" pflag:",Optional. Disable the connector service."`
// Optionally it is possible to pass in environment variables to sandbox container.
Env []string `json:"env" pflag:",Optional. Provide Env variable in key=value format which can be passed to sandbox container."`
// Optionally it is possible to use local sandbox image
// Flytectl will not pull the image from the registry if the local flag passes. It is usually useful while testing your local images without pushing them to a registry.
ImagePullPolicy docker.ImagePullPolicy `json:"imagePullPolicy" pflag:",Optional. Defines the image pull behavior [Always/IfNotPresent/Never]"`
ImagePullOptions docker.ImagePullOptions `json:"imagePullOptions" pflag:",Optional. Defines image pull options (e.g. auth)"`
// It's used for development. Users are able to start flyte locally via single binary and save the data to the minio or postgres in the sandbox.
Dev bool `json:"dev" pflag:",Optional. Only start minio and postgres in the sandbox."`
DryRun bool `json:"dryRun" pflag:",Optional. Only print the docker commands to bring up flyte sandbox/demo container.This will still call github api's to get the latest flyte release to use'"`
Force bool `json:"force" pflag:",Optional. Forcefully delete existing sandbox cluster if it exists."`
Port string `json:"port" pflag:",Optional. Specify the port for Kubernetes in the sandbox."`
// Allow user to specify the port for the sandbox
Ports []string `json:"ports" pflag:",Optional. Custom port mappings for sandbox."`
}
//go:generate pflags Config --default-var DefaultConfig --bind-default-var
var (
DefaultConfig = &Config{
Port: "6443",
Ports: []string{}, // Default port mappings
}
)
func (c Config) GetK8sEndpoint() string {
return "https://127.0.0.1:30086"
}