rancher

package
v0.0.0-...-a96911d Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenAuthHeaders

func GenAuthHeaders(token string) map[string]string

func NewGlobalHelper

func NewGlobalHelper(opts ...Option) error

Types

type Annotations

type Annotations struct {
	ProvisioningCattleIoDriver string `json:"provisioning.cattle.io/driver,omitempty"`
}

type Auth

type Auth struct {
	Token string `yaml:"token"`
}

type ChartValues

type ChartValues struct {
	Rke2Cilium `json:"rke2-cilium"`
}

type Cilium

type Cilium struct {
	Ipv6 `json:"ipv6"`
}

type CloudCredential

type CloudCredential struct {
	Id                        string `json:"id"`
	Uuid                      string `json:"uuid"`
	Name                      string `json:"name"`
	Type                      string `json:"type"`
	BaseType                  string `json:"baseType"`
	Metadata                  `json:"metadata"`
	Annotations               `json:"annotations"`
	OpenstackCredentialConfig `json:"openstackcredentialConfig"`
	Created                   string `json:"created"`
}

func (*CloudCredential) Bytes

func (c *CloudCredential) Bytes() ([]byte, error)

type Cluster

type Cluster struct {
	Type     string `json:"type"`
	Metadata `json:"metadata"`
	Spec     `json:"spec"`
}

func (*Cluster) Bytes

func (c *Cluster) Bytes() ([]byte, error)

type ClusterResponse

type ClusterResponse struct {
	Id       string `json:"id"`
	Type     string `json:"type"`
	Metadata `json:"metadata"`
}

type Config

type Config struct {
	ProtectKernelDefaults bool `json:"protect-kernel-defaults,omitempty"`
}

type ControlPlaneDrainOptions

type ControlPlaneDrainOptions struct {
	DeleteEmptyDirData           bool `json:"deleteEmptyDirData"`
	DisableEviction              bool `json:"disableEviction"`
	Enabled                      bool `json:"enabled"`
	Force                        bool `json:"force"`
	GracePeriod                  int  `json:"gracePeriod"`
	IgnoreDaemonSets             bool `json:"ignoreDaemonSets"`
	SkipWaitForDeleteTimeoutSecs int  `json:"skipWaitForDeleteTimeoutSeconds"`
	Timeout                      int  `json:"timeout"`
}

type DataDirectories

type DataDirectories struct {
	SystemAgent  string `json:"systemAgent"`
	Provisioning string `json:"provisioning"`
	K8sDistro    string `json:"k8sDistro"`
}

type Etcd

type Etcd struct {
	DisableSnapshots     bool `json:"disableSnapshots"`
	*S3                  `json:"s3"`
	SnapshotRetention    int    `json:"snapshotRetention"`
	SnapshotScheduleCron string `json:"snapshotScheduleCron"`
}

type Helper

type Helper struct {
	Http    *http.Helper
	Options Options
}

func GetGlobalHelper

func GetGlobalHelper() *Helper

func NewHelper

func NewHelper(opts ...Option) (*Helper, error)

func (*Helper) ActivateNodeDriver

func (h *Helper) ActivateNodeDriver(name string) error

func (*Helper) CreateCloudCredential

func (h *Helper) CreateCloudCredential(credential *CloudCredential) (*CloudCredential, error)

func (*Helper) CreateKubernetes

func (h *Helper) CreateKubernetes(cluster *Cluster) (*ClusterResponse, error)

func (*Helper) CreateOpenstackMachine

func (h *Helper) CreateOpenstackMachine(provider *OpenstackMachine) (*OpenstackMachineResponse, error)

func (*Helper) DeleteKubernetes

func (h *Helper) DeleteKubernetes(name string) error

func (*Helper) GetKubernetesConfig

func (h *Helper) GetKubernetesConfig(name string) ([]byte, error)

func (*Helper) WaitKubernetesActive

func (h *Helper) WaitKubernetesActive(name string) (*StatusResponse, error)

func (*Helper) WaitKubernetesDeleted

func (h *Helper) WaitKubernetesDeleted(name string) error

func (*Helper) WaitNodeDriverStatus

func (h *Helper) WaitNodeDriverStatus(name, state string, timeout int) error

type Ipv6

type Ipv6 struct {
	Enabled bool `json:"enabled"`
}

type Labels

type Labels struct{}

type LocalClusterAuthEndpoint

type LocalClusterAuthEndpoint struct {
	Enabled bool   `json:"enabled"`
	CaCerts string `json:"caCerts"`
	Fqdn    string `json:"fqdn"`
}

type MachineConfigRef

type MachineConfigRef struct {
	Kind string `json:"kind"`
	Name string `json:"name"`
}

type MachineGlobalConfig

type MachineGlobalConfig struct {
	Cni               string `json:"cni"`
	DisableKubeProxy  bool   `json:"disable-kube-proxy"`
	EtcdExposeMetrics bool   `json:"etcd-expose-metrics"`
}

type MachinePool

type MachinePool struct {
	Name              string `json:"name"`
	EtcdRole          bool   `json:"etcdRole"`
	ControlPlaneRole  bool   `json:"controlPlaneRole"`
	WorkerRole        bool   `json:"workerRole"`
	HostnamePrefix    string `json:"hostnamePrefix"`
	Labels            `json:"labels"`
	Quantity          int    `json:"quantity"`
	UnhealthyNodeTime string `json:"unhealthyNodeTimeout"`
	MachineConfigRef  `json:"machineConfigRef"`
	DrainBeforeDelete bool `json:"drainBeforeDelete"`
}

type MachineSelectorConfig

type MachineSelectorConfig struct {
	Config `json:"config"`
}

type Metadata

type Metadata struct {
	Name            string `json:"name"`
	Annotations     `json:"annotations"`
	Finalizers      []string `json:"finalizers,omitempty"`
	GenerateName    string   `json:"generateName,omitempty"`
	Labels          `json:"labels"`
	ManagedFields   []any    `json:"managedFields,omitempty"`
	Namespace       string   `json:"namespace"`
	OwnerReferences []string `json:"ownerReferences,omitempty"`
}

type MirrorTo

type MirrorTo struct {
	Endpoint []string          `json:"endpoint"`
	Rewrite  map[string]string `json:"rewrite"`
}

type NodeDriver

type NodeDriver struct {
	Name  string `json:"name"`
	State string `json:"state"`
}

type NodeDriversResp

type NodeDriversResp struct {
	NodeDrivers []NodeDriver `json:"data"`
}

type OpenstackCredentialConfig

type OpenstackCredentialConfig struct {
	Password string `json:"password"`
}

type OpenstackMachine

type OpenstackMachine struct {
	ActiveTimeout  string `json:"activeTimeout"`
	AuthUrl        string `json:"authUrl"`
	EndpointType   string `json:"endpointType"`
	FlavorName     string `json:"flavorName"`
	FloatingipPool string `json:"floatingipPool"`
	ImageName      string `json:"imageName"`
	Insecure       bool   `json:"insecure"`
	IpVersion      string `json:"ipVersion"`
	Metadata       `json:"metadata"`
	NetId          string `json:"netId"`
	SecGroups      string `json:"secGroups"`
	SshPort        string `json:"sshPort"`
	SshUser        string `json:"sshUser"`
	TenantId       string `json:"tenantId"`
	UserId         string `json:"userId"`
	Type           string `json:"type"`
}

func (*OpenstackMachine) Bytes

func (p *OpenstackMachine) Bytes() ([]byte, error)

type OpenstackMachineResponse

type OpenstackMachineResponse struct {
	Id       string `json:"id"`
	Type     string `json:"type"`
	Metadata `json:"metadata"`
}

type Option

type Option func(*Options)

func AuthToken

func AuthToken(token string) Option

func Url

func Url(url string) Option

type Options

type Options struct {
	Url  string `yaml:"url"`
	Auth `yaml:"auth"`
}
var (
	Opts *Options
)

type Registries

type Registries struct {
	Configs map[string]string   `json:"configs"`
	Mirrors map[string]MirrorTo `json:"mirrors"`
}

type Rke2Cilium

type Rke2Cilium struct {
	Cilium `json:"cilium,omitempty"`
}

type RkeConfig

type RkeConfig struct {
	ChartValues           `json:"chartValues"`
	UpgradeStrategy       `json:"upgradeStrategy"`
	DataDirectories       `json:"dataDirectories"`
	MachineGlobalConfig   `json:"machineGlobalConfig"`
	MachineSelectorConfig []MachineSelectorConfig `json:"machineSelectorConfig"`
	Etcd                  `json:"etcd"`
	Registries            `json:"registries"`
	MachinePools          []MachinePool `json:"machinePools"`
}

type S3

type S3 struct{}

type Spec

type Spec struct {
	RkeConfig                                            `json:"rkeConfig"`
	MachineSelectorConfig                                []MachineSelectorConfig `json:"machineSelectorConfig"`
	KubernetesVersion                                    string                  `json:"kubernetesVersion"`
	DefaultPodSecurityPolicyTemplateName                 string                  `json:"defaultPodSecurityPolicyTemplateName"`
	DefaultPodSecurityAdmissionConfigurationTemplateName string                  `json:"defaultPodSecurityAdmissionConfigurationTemplateName"`
	CloudCredentialSecretName                            string                  `json:"cloudCredentialSecretName"`
	LocalClusterAuthEndpoint                             `json:"localClusterAuthEndpoint"`
}

type Status

type Status struct {
	ClusterName   string `json:"clusterName"`
	AgentDeployed bool   `json:"agentDeployed"`
	Ready         bool   `json:"ready"`
}

type StatusResponse

type StatusResponse struct {
	Kind   string `json:"kind"`
	Status `json:"status"`
}

type UpgradeStrategy

type UpgradeStrategy struct {
	ControlPlaneConcurrency  string `json:"controlPlaneConcurrency"`
	ControlPlaneDrainOptions `json:"controlPlaneDrainOptions"`
	WorkerConcurrency        string `json:"workerConcurrency"`
	WorkerDrainOptions       `json:"workerDrainOptions"`
}

type WorkerDrainOptions

type WorkerDrainOptions struct {
	DeleteEmptyDirData           bool `json:"deleteEmptyDirData"`
	DisableEviction              bool `json:"disableEviction"`
	Enabled                      bool `json:"enabled"`
	Force                        bool `json:"force"`
	GracePeriod                  int  `json:"gracePeriod"`
	IgnoreDaemonSets             bool `json:"ignoreDaemonSets"`
	SkipWaitForDeleteTimeoutSecs int  `json:"skipWaitForDeleteTimeoutSeconds"`
	Timeout                      int  `json:"timeout"`
}

Jump to

Keyboard shortcuts

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