Documentation ¶
Index ¶
- Constants
- Variables
- func ClusterConfig(ctx context.Context, kbClient kbclient.Client) (*embeddedclusterv1beta1.ConfigSpec, error)
- func ControllerRoleName(ctx context.Context, kbClient kbclient.Client) (string, error)
- func ConvertToRFC1123(value string, args ...int) string
- func DeleteNode(ctx context.Context, client kubernetes.Interface, restconfig *rest.Config, ...) error
- func DrainNode(ctx context.Context, client kubernetes.Interface, node *corev1.Node) error
- func GenerateAddNodeCommand(ctx context.Context, kbClient kbclient.Client, token string, isAirgap bool) (string, error)
- func GenerateAddNodeToken(ctx context.Context, client kbclient.Client, nodeRole string) (string, error)
- func GenerateK0sJoinCommand(ctx context.Context, kbClient kbclient.Client, roles []string) (string, error)
- func GetCurrentInstallation(ctx context.Context, kbClient kbclient.Client) (*embeddedclusterv1beta1.Installation, error)
- func GetNode(ctx context.Context, client kubernetes.Interface, nodeName string) (*types.Node, error)
- func GetNodes(ctx context.Context, client kubernetes.Interface) (*types.EmbeddedClusterNodes, error)
- func GetRoles(ctx context.Context, kbClient kbclient.Client) ([]string, error)
- func GetSeaweedFSS3ServiceIP(ctx context.Context, kbClient kbclient.Client) (string, error)
- func InstallationFailed(ctx context.Context, ins *embeddedclusterv1beta1.Installation) bool
- func InstallationSucceeded(ctx context.Context, ins *embeddedclusterv1beta1.Installation) bool
- func IsHA(clientset kubernetes.Interface) (bool, error)
- func IsValidRFC1123(value string) bool
- func ListInstallations(ctx context.Context, kbClient kbclient.Client) ([]embeddedclusterv1beta1.Installation, error)
- func RequiresClusterUpgrade(ctx context.Context, kbClient kbclient.Client, kotsKinds *kotsutil.KotsKinds) (bool, error)
- func RequiresUpgrade(ctx context.Context, kbClient kbclient.Client, ...) (bool, error)
- func SortRoles(controllerRole string, inputRoles []string) []string
- func StartClusterUpgrade(ctx context.Context, kotsKinds *kotsutil.KotsKinds, ...) error
- func SyncExec(coreClient corev1client.CoreV1Interface, clientConfig *rest.Config, ...) (int, string, string, error)
Constants ¶
const ( SeaweedfsNamespace = "seaweedfs" SeaweedfsS3SVCName = "ec-seaweedfs-s3" )
const DEFAULT_CONTROLLER_ROLE_NAME = "controller"
Variables ¶
var ErrNoInstallations = fmt.Errorf("no installations found")
ErrNoInstallations is returned when no installation object is found in the cluster.
Functions ¶
func ClusterConfig ¶ added in v1.104.2
func ClusterConfig(ctx context.Context, kbClient kbclient.Client) (*embeddedclusterv1beta1.ConfigSpec, error)
ClusterConfig will extract the current cluster configuration from the latest installation object found in the cluster.
func ControllerRoleName ¶ added in v1.104.2
ControllerRoleName determines the name for the 'controller' role this might be part of the config, or it might be the default
func ConvertToRFC1123 ¶ added in v1.108.1
func DeleteNode ¶
func GenerateAddNodeCommand ¶
func GenerateAddNodeCommand(ctx context.Context, kbClient kbclient.Client, token string, isAirgap bool) (string, error)
GenerateAddNodeCommand returns the command a user should run to add a node with the provided token the command will be of the form 'embeddedcluster node join ip:port UUID'
func GenerateAddNodeToken ¶
func GenerateAddNodeToken(ctx context.Context, client kbclient.Client, nodeRole string) (string, error)
GenerateAddNodeToken will generate the embedded cluster node add command for a node with the specified roles join commands will last for 24 hours, and will be cached for 1 hour after first generation
func GenerateK0sJoinCommand ¶
func GenerateK0sJoinCommand(ctx context.Context, kbClient kbclient.Client, roles []string) (string, error)
GenerateK0sJoinCommand returns the k0s node join command, without the token but with all other required flags (including node labels generated from the roles etc)
func GetCurrentInstallation ¶ added in v1.104.5
func GetCurrentInstallation(ctx context.Context, kbClient kbclient.Client) (*embeddedclusterv1beta1.Installation, error)
GetCurrentInstallation returns the most recent installation object from the cluster.
func GetNode ¶
func GetNode(ctx context.Context, client kubernetes.Interface, nodeName string) (*types.Node, error)
GetNode will get a node with stats and podlist
func GetNodes ¶
func GetNodes(ctx context.Context, client kubernetes.Interface) (*types.EmbeddedClusterNodes, error)
GetNodes will get a list of nodes with stats
func GetSeaweedFSS3ServiceIP ¶ added in v1.109.12
func InstallationFailed ¶ added in v1.112.0
func InstallationFailed(ctx context.Context, ins *embeddedclusterv1beta1.Installation) bool
func InstallationSucceeded ¶ added in v1.112.0
func InstallationSucceeded(ctx context.Context, ins *embeddedclusterv1beta1.Installation) bool
func IsValidRFC1123 ¶ added in v1.108.1
IsValidRFC1123 tests for a string that conforms to the definition of a subdomain in DNS (RFC 1123).
func ListInstallations ¶ added in v1.108.0
func ListInstallations(ctx context.Context, kbClient kbclient.Client) ([]embeddedclusterv1beta1.Installation, error)
func RequiresClusterUpgrade ¶ added in v1.112.0
func RequiresClusterUpgrade(ctx context.Context, kbClient kbclient.Client, kotsKinds *kotsutil.KotsKinds) (bool, error)
RequiresClusterUpgrade returns true if the embedded cluster is in a state that requires an upgrade. This is determined by checking that: - The app has an embedded cluster configuration. - The app embedded cluster configuration differs from the current embedded cluster configuration. - The current cluster config (as part of the Installation object) already exists in the cluster.
func RequiresUpgrade ¶ added in v1.104.5
func RequiresUpgrade(ctx context.Context, kbClient kbclient.Client, newcfg embeddedclusterv1beta1.ConfigSpec) (bool, error)
RequiresUpgrade returns true if the provided configuration differs from the latest active configuration.
func StartClusterUpgrade ¶ added in v1.112.0
func StartClusterUpgrade(ctx context.Context, kotsKinds *kotsutil.KotsKinds, registrySettings registrytypes.RegistrySettings) error
Types ¶
This section is empty.