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 FetchControlCenterLogsIfNeeded() error
- func FetchGatewayLogs() (tail string, err error)
- func FetchRuntimeLogs() (tail string, err error)
- func GatewayInstalled() bool
- func HelmAvailable() bool
- func HelmInstall(ctx context.Context, h orktypes.SetupHelmInstall) error
- func HelmUninstall(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 ResourceExists(resourceType, resourceName, namespace string) bool
- func RuntimeInstalled() bool
- func SyncDeployment(deploymentName, namespace string, timeout time.Duration) error
- func SyncGateway() error
- func SyncRuntime() error
- func WaitForResource(ctx context.Context, w orktypes.SetupWait) error
- type DeploymentHealthChecker
- func (d DeploymentHealthChecker) CheckHealth(timeout time.Duration, checkFailure func(ctx context.Context) string) DeploymentStatus
- func (d DeploymentHealthChecker) Exists() bool
- func (d DeploymentHealthChecker) FetchLogs(maxLines int, logDir, logPath string) (tail string, err error)
- func (d DeploymentHealthChecker) HasReadyReplicas(ctx context.Context) bool
- type DeploymentStatus
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" // OrkestraGateway is the name of the gateway Deployment. OrkestraGateway = "orkestra-gateway" // 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 FetchControlCenterLogsIfNeeded ¶ added in v0.6.5
func FetchControlCenterLogsIfNeeded() error
FetchControlCenterLogsIfNeeded fetches control center logs only if the deployment exists but has no ready replicas
func FetchGatewayLogs ¶ added in v0.6.5
FetchGatewayLogs saves gateway logs and returns the last 10 lines
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 GatewayInstalled ¶ added in v0.6.5
func GatewayInstalled() bool
GatewayInstalled reports whether the Orkestra gateway Deployment exists.
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 HelmUninstall ¶ added in v0.7.7
func HelmUninstall(ctx context.Context, h orktypes.SetupHelmInstall) error
HelmUninstall removes a Helm release installed by HelmInstall.
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 ResourceExists ¶ added in v0.6.5
In future if needed: ServiceExists := ResourceExists("service", "my-service", "default") ConfigMapExists := ResourceExists("configmap", "my-config", "kube-system")
func RuntimeInstalled ¶ added in v0.6.5
func RuntimeInstalled() bool
RuntimeInstalled reports whether the Orkestra runtime Deployment exists.
func SyncDeployment ¶ added in v0.6.5
SyncDeployment restarts a Kubernetes Deployment and waits for the rollout to complete. Returns an error if the restart or rollout status check fails. Timeout is configurable (e.g., 3*time.Minute).
func SyncGateway ¶ added in v0.6.5
func SyncGateway() error
SyncGateway restarts the Orkestra gateway Deployment and waits for rollout.
func SyncRuntime ¶
func SyncRuntime() error
SyncRuntime restarts the Orkestra runtime Deployment and waits for rollout.
Types ¶
type DeploymentHealthChecker ¶ added in v0.6.5
DeploymentHealthChecker handles health checks for any deployment
func (DeploymentHealthChecker) CheckHealth ¶ added in v0.6.5
func (d DeploymentHealthChecker) CheckHealth(timeout time.Duration, checkFailure func(ctx context.Context) string) DeploymentStatus
CheckHealth waits up to timeout for a deployment to have at least one ready replica. Polls every 2 seconds. Returns immediately if a custom failure condition is detected.
func (DeploymentHealthChecker) Exists ¶ added in v0.6.5
func (d DeploymentHealthChecker) Exists() bool
Exists checks if the deployment exists
func (DeploymentHealthChecker) FetchLogs ¶ added in v0.6.5
func (d DeploymentHealthChecker) FetchLogs(maxLines int, logDir, logPath string) (tail string, err error)
FetchLogs saves the last maxLines from the deployment to a file and returns the last 10 lines
func (DeploymentHealthChecker) HasReadyReplicas ¶ added in v0.6.5
func (d DeploymentHealthChecker) HasReadyReplicas(ctx context.Context) bool
HasReadyReplicas checks if the deployment has at least one ready replica
type DeploymentStatus ¶ added in v0.6.5
DeploymentStatus represents the status of a Kubernetes deployment
func CheckGatewayHealth ¶ added in v0.6.5
func CheckGatewayHealth() DeploymentStatus
CheckGatewayHealth waits up to healthCheckTimeout for the Orkestra gateway to be ready
func CheckRuntimeHealth ¶
func CheckRuntimeHealth() DeploymentStatus
CheckRuntimeHealth waits up to healthCheckTimeout for the Orkestra runtime to be ready