rkecli

package
v0.0.0-...-078bebe Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 13, 2025 License: Apache-2.0 Imports: 15 Imported by: 2

Documentation

Index

Constants

View Source
const ConfigurationFileKey = "rke"

Variables

This section is empty.

Functions

func GetFullState

func GetFullState(client *rancher.Client) (state *cluster.FullState, err error)

GetFullState is a function that gets RKE full state from "full-cluster-state" secret. And returns the cluster full state.

func NewClusterFile

func NewClusterFile(state *cluster.FullState, dirName string, config *Config) (clusterFilePath string, err error)

NewClusterFile is a function that generates new cluster.yml file from the full state. Returns the generated file's path.

func NewRKEConfigs

func NewRKEConfigs(client *rancher.Client) (stateFilePath, clusterFilePath string, err error)

NewRKEConfigs creates a new dir. In that dir, it generates state and cluster files from the state configmap. Returns generated state and cluster files' paths.

func NewStateFile

func NewStateFile(state *cluster.FullState, dirName string) (stateFilePath string, err error)

NewStateFile is a function that generates new cluster.rkestate file from the full state. Returns the generated file's path.

func ReadClusterFromStateFile

func ReadClusterFromStateFile(stateFilePath string) (*v3.RancherKubernetesEngineConfig, error)

ReadClusterFromStateFile is a function that reads the RKE config from the given state file path. Returns RKE config.

func Up

func Up(clusterFilePath string, args ...string) error

Up uses RKE CLI up command. Cluster file path arg points to the cluster.yml file, args appended to the command.

func UpdateKubernetesVersion

func UpdateKubernetesVersion(kubernetesVersion, clusterFilePath string) error

UpdateKubernetesVersion is a function that updates kubernetes version value in cluster.yml file.

Types

type Config

type Config struct {
	SSHKey  string `json:"sshKey,omitempty" yaml:"sshKey,omitempty" default:""`
	SSHPath string `json:"sshPath,omitempty" yaml:"sshPath,omitempty" default:""`
}

RKE configuration required to run rkecli and up

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL