Documentation
¶
Index ¶
- Constants
- func BuildControlCenterValues(host string) (string, error)
- func ClusterReachable() bool
- func DeleteKindCluster(name string) error
- func EnsureDependencies() error
- func EnsureKindCluster(name string) error
- func FetchRuntimeLogs() (tail string, err error)
- func HelmAvailable() bool
- func HelmInstall(ctx context.Context, h orktypes.SetupHelmInstall) error
- func InstallOrUpgradeOrkestra(version string, valueFiles []string, args ...string) error
- func KatalogChanged(dir string) bool
- func KubectlAvailable() bool
- func OrkestraInstalled() bool
- func RuntimeDeployed() bool
- func SyncRuntime() error
- func WaitForResource(ctx context.Context, w orktypes.SetupWait) error
- type RuntimeStatus
Constants ¶
const ( // Orkestra is the Helm release name and the prefix for all Orkestra resources. Orkestra = "orkestra" // OrkestraRuntime is the name of the runtime Deployment. OrkestraRuntime = "orkestra-runtime" // OrkestraNamespace is the Kubernetes namespace Orkestra deploys into. OrkestraNamespace = "orkestra-system" // OrkestraChartRepo is the Helm repository URL for the Orkestra chart. OrkestraChartRepo = "https://orkspace.github.io/orkestra" // OrkestraChartName is the chart name within the repository. OrkestraChartName = "orkestra" // OrkestraControlCenter is the name of the Control Center Deployment. OrkestraControlCenter = "orkestra-cc" // OrkestraControlCenterPort is the default Control Center HTTP port. OrkestraControlCenterPort = "8081" )
const (
// KindClusterName is the default kind cluster name used by ork run --dev.
KindClusterName = "orkestra-playground"
)
Variables ¶
This section is empty.
Functions ¶
func BuildControlCenterValues ¶
BuildControlCenterValues generates a temporary Helm values file that enables the Control Center ingress for the given hostname. The caller is responsible for removing the file when done.
func ClusterReachable ¶
func ClusterReachable() bool
ClusterReachable reports whether kubectl can reach the cluster configured in the current kubeconfig. Times out after 5 seconds.
func DeleteKindCluster ¶
DeleteKindCluster deletes a kind cluster by name. Safe to call when the cluster does not exist.
func EnsureDependencies ¶
func EnsureDependencies() error
EnsureDependencies installs kubectl and helm if they are missing.
func EnsureKindCluster ¶
EnsureKindCluster creates a kind cluster named `name` if it does not already exist, then switches kubectl to its context. Downloads the kind binary from GitHub releases if not found in PATH or ~/.orkestra/bin.
func FetchRuntimeLogs ¶
FetchRuntimeLogs saves the last 100 log lines from the Orkestra runtime to /tmp/orkestra/runtime.log. If the Control Center Deployment exists but has no ready replicas, its logs are saved to /tmp/orkestra/controlcenter.log. Returns the last 10 lines of the runtime log for inline display.
func HelmAvailable ¶
func HelmAvailable() bool
HelmAvailable reports whether helm is present in PATH.
func HelmInstall ¶
func HelmInstall(ctx context.Context, h orktypes.SetupHelmInstall) error
HelmInstall installs or upgrades a Helm chart as declared in SetupHelmInstall. Uses helm upgrade --install so the call is idempotent.
func InstallOrUpgradeOrkestra ¶
InstallOrUpgradeOrkestra installs or upgrades the Orkestra Helm chart idempotently. It always runs `helm upgrade --install` so the call is safe whether Orkestra is already present or not.
The repo is added and updated before every call to ensure the index is current. Version may be empty to use the latest chart. Additional Helm flags (e.g. --set, --atomic) are passed through args.
func KatalogChanged ¶
KatalogChanged returns true when .orkestra/katalog.yaml has uncommitted changes or was touched by the most recent commit.
func KubectlAvailable ¶
func KubectlAvailable() bool
KubectlAvailable reports whether kubectl is present in PATH.
func OrkestraInstalled ¶
func OrkestraInstalled() bool
OrkestraInstalled reports whether the Orkestra runtime Deployment exists in OrkestraNamespace.
func RuntimeDeployed ¶
func RuntimeDeployed() bool
RuntimeDeployed reports whether the runtime Deployment exists, with a short timeout so it is safe to call during startup.
func SyncRuntime ¶
func SyncRuntime() error
SyncRuntime restarts the Orkestra runtime Deployment so it picks up a new Katalog ConfigMap. Waits for the rollout to complete (3 minute timeout).
Types ¶
type RuntimeStatus ¶
RuntimeStatus is the result of CheckRuntimeHealth.
func CheckRuntimeHealth ¶
func CheckRuntimeHealth() RuntimeStatus
CheckRuntimeHealth waits up to healthCheckTimeout for the Orkestra runtime Deployment to have at least one ready replica. It polls every 2 seconds. Returns immediately if pods are in CrashLoopBackOff.