Documentation
¶
Index ¶
- Constants
- func ApplyKustomize(dir string) error
- func BaseStackCommand() commands.Command
- func CheckSSHKeys(privateKeyPath, publicKeyPath string) error
- func ClusterExists(clusterName string, clusters []upcloud.KubernetesCluster) bool
- func CreateHelmLogFile(chartPath string) (*os.File, error)
- func CreateNamespace(kubeClient *kubernetes.Clientset, namespace string) error
- func CreateNetwork(exec commands.Executor, networkName, location string, stackType StackType) (*upcloud.Network, error)
- func DeployCommand() commands.Command
- func DeployHelmRelease(kubeClient *kubernetes.Clientset, releaseName string, chartPath string, ...) error
- func DeployHelmReleaseFromRepo(kubeClient *kubernetes.Clientset, ...) error
- func ExecInPod(restConfig *rest.Config, kubeClient *kubernetes.Clientset, ...) (stdout, stderr []byte, err error)
- func ExtractFolder(fsys embed.FS, targetDir string) error
- func GetKubernetesClient(kubeconfigPath string) (*kubernetes.Clientset, error)
- func GetNetworkFromName(networkName string, networks []upcloud.Network) *upcloud.Network
- func GetNodeExternalIP(kubeClient *kubernetes.Clientset) (string, error)
- func GetObjectStorageRegionFromZone(exec commands.Executor, zone string) (string, error)
- func InitHelmActionConfig(releaseName string, logFile *os.File) (*action.Configuration, error)
- func MergeHelmValueFiles(valuesFiles []string) (map[string]interface{}, error)
- func WaitForAPIServer(kubeClient *kubernetes.Clientset) error
- func WaitForLoadBalancer(kubeClient *kubernetes.Clientset, namespace, serviceName string, ...) (string, error)
- func WaitForManagedObjectStorageState(uuid string, state upcloud.ManagedObjectStorageOperationalState, ...)
- func WriteKubeconfigToFile(exec commands.Executor, clusterID string, configDir string) (string, error)
- type StackType
- type Version
Constants ¶
const ( VersionV0_1_0_0 Version = "v0.1.0.0" SupportEmail string = "support@upcloud.com" )
Variables ¶
This section is empty.
Functions ¶
func ApplyKustomize ¶
ApplyKustomize builds the kustomization at `dir` and applies all resulting resources server-side (using server-side apply).
func BaseStackCommand ¶
func CheckSSHKeys ¶
CheckSSHKeys ensures both private and public SSH key files exist.
func ClusterExists ¶
func ClusterExists(clusterName string, clusters []upcloud.KubernetesCluster) bool
ClusterExists checks if a Kubernetes cluster with the given name exists in the provided list of clusters.
func CreateNamespace ¶
func CreateNamespace(kubeClient *kubernetes.Clientset, namespace string) error
CreateNamespace creates a Kubernetes namespace if it does not already exist.
func CreateNetwork ¶
func CreateNetwork(exec commands.Executor, networkName, location string, stackType StackType) (*upcloud.Network, error)
CreateNetwork creates a network with a random 10.0.X.0/24 subnet It will try 10 times to create a network with a random subnet If it fails to create a network after 10 attempts, it returns an error
func DeployCommand ¶
DeployCommand creates the "stack deploy" command
func DeployHelmRelease ¶
func DeployHelmRelease(kubeClient *kubernetes.Clientset, releaseName string, chartPath string, valuesFiles []string, upgrade bool) error
deployHelmRelease will check if a Helm release named releaseName exists in namespace=releaseName. - If it doesn't exist and upgrade = false, it will install the chart at chartPath using valuesFiles. - If it does exist and upgrade = true, it will perform a Helm upgrade with the same chartPath and values.
func DeployHelmReleaseFromRepo ¶
func DeployHelmReleaseFromRepo( kubeClient *kubernetes.Clientset, releaseName, repoURL, chartName, version string, valsFiles []string, upgrade bool, ) error
DeployHelmReleaseFromRepo deploys a Helm release from a remote repository.
func ExecInPod ¶
func ExecInPod( restConfig *rest.Config, kubeClient *kubernetes.Clientset, namespace, podName string, containerName string, cmd []string, stdin io.Reader, ) (stdout, stderr []byte, err error)
ExecInPod runs a command in the given pod and container and returns stdout/stderr. If containerName is empty, it will auto-detect the container if there is only one in the pod. If there are multiple containers, it returns an error asking to specify the container name.
func ExtractFolder ¶
ExtractFolder extracts the embedded chart files to the specified target directory.
func GetKubernetesClient ¶
func GetKubernetesClient(kubeconfigPath string) (*kubernetes.Clientset, error)
GetKubernetesClient creates a Kubernetes client from the provided kubeconfig path.
func GetNetworkFromName ¶
GetNetworkFromName retrieves the network from the net name, returns nil if it does not exist
func GetNodeExternalIP ¶
func GetNodeExternalIP(kubeClient *kubernetes.Clientset) (string, error)
GetNodeExternalIP returns the first ExternalIP of any node in the cluster.
func GetObjectStorageRegionFromZone ¶
GetObjectStorageRegionFromZone retrieves the object storage region for the selected zone. First occurrence is returned
func InitHelmActionConfig ¶
initHelmActionConfig initializes the Helm action configuration with the provided chart path and release name.
func MergeHelmValueFiles ¶
MergeHelmValueFiles merges multiple Helm values files into a single map. This function is used to combine values from multiple files, allowing for overrides.
func WaitForAPIServer ¶
func WaitForAPIServer(kubeClient *kubernetes.Clientset) error
WaitForAPIServer waits for the Kubernetes API server to be ready.
func WaitForLoadBalancer ¶
func WaitForLoadBalancer(kubeClient *kubernetes.Clientset, namespace, serviceName string, maxRetries int, sleepInterval time.Duration) (string, error)
WaitForLoadBalancer waits for a Kubernetes LoadBalancer service to become available and returns its hostname.
func WaitForManagedObjectStorageState ¶
func WaitForManagedObjectStorageState(uuid string, state upcloud.ManagedObjectStorageOperationalState, exec commands.Executor, msg string)
waitForManagedObjectState waits for database to reach given state and updates progress message with key matching given msg. Finally, progress message is updated back to given msg and either done state or timeout warning.