Documentation
¶
Index ¶
- Constants
- func DiscoverNode(d *schema.ResourceData, meta interface{}, nodeConfig *config.NodeConfig) (err error)
- func DoGet(url, username, password, token, cacert string, insecure bool) ([]byte, error)
- func GetMapString(m interface{}, key string) string
- func IsForbidden(err error) bool
- func IsNotFound(err error) bool
- func NewListOpts(filters map[string]interface{}) *types.ListOpts
- func NormalizeURL(input string) string
- func RootURL(url string) string
- type Rancher2Client
- func (client *Rancher2Client) ClusterWaitForState(clusterID string, states string, timeout int) (err error)
- func (client *Rancher2Client) ClusterWaitForTransitioning(clusterID string, timeout int) (err error)
- func (client *Rancher2Client) DeleteNode(nodeID string) (err error)
- func (client *Rancher2Client) GetClusterByID(clusterID string) (cluster *managementClient.Cluster, err error)
- func (client *Rancher2Client) GetClusterList(opts *types.ListOpts) (clusters *managementClient.ClusterCollection, err error)
- func (client *Rancher2Client) GetNodeByAddr(clusterID string, nodeIPAddr string) (cluster *managementClient.Cluster, node *managementClient.Node, nodeID string, ...)
- func (client *Rancher2Client) GetNodeByID(nodeID string) (node *managementClient.Node, err error)
- func (client *Rancher2Client) GetNodeList(opts *types.ListOpts) (nodes *managementClient.NodeCollection, err error)
- func (client *Rancher2Client) GetNodeMachine(node *managementClient.Node) (machine *unstructured.Unstructured, err error)
- func (client *Rancher2Client) GetNodeRole(nodeID string) (controlplane bool, etcd bool, worker bool, err error)
- func (client *Rancher2Client) NodeCordon(nodeID string) (err error)
- func (client *Rancher2Client) NodeCordonDrain(nodeID string, nodeDrainInput *managementClient.NodeDrainInput) (err error)
- func (client *Rancher2Client) NodeGetLabels(nodeID string) (nodeLabels map[string]string, err error)
- func (client *Rancher2Client) NodeGetState(nodeID string) (state string, err error)
- func (client *Rancher2Client) NodeGetTaints(nodeID string) (taints []managementClient.Taint, err error)
- func (client *Rancher2Client) NodeSetAnnotationsLabelsTaints(nodeID string, annotations map[string]string, labels map[string]string, ...) (err error)
- func (client *Rancher2Client) NodeUncordon(nodeID string) (err error)
- func (client *Rancher2Client) NodeUpdateLabels(nodeID string, oldLabels map[string]interface{}, ...) (err error)
- func (client *Rancher2Client) NodeUpdateTaints(nodeID string, oldTaints []interface{}, newTaints []interface{}) (err error)
- func (client *Rancher2Client) NodeWaitForState(nodeID string, states string, timeout int) (err error)
- type Rancher2Config
- type Rancher2Node
- func (node *Rancher2Node) IsNodeControlPlane() bool
- func (node *Rancher2Node) IsNodeEtcd() bool
- func (node *Rancher2Node) IsNodeWorker() bool
- func (node *Rancher2Node) IsProviderRKE1() bool
- func (node *Rancher2Node) IsProviderRKE2() bool
- func (node *Rancher2Node) RancherAPIClusterWaitForState(state string, timeout int) (err error)
- func (node *Rancher2Node) RancherAPIClusterWaitForTransitioning(timeout int) (err error)
- func (node *Rancher2Node) RancherAPINodeCordon() (err error)
- func (node *Rancher2Node) RancherAPINodeCordonDrain() (err error)
- func (node *Rancher2Node) RancherAPINodeDelete() (err error)
- func (node *Rancher2Node) RancherAPINodeForceDelete() (err error)
- func (node *Rancher2Node) RancherAPINodeGetID(d *schema.ResourceData, meta interface{}) (err error)
- func (node *Rancher2Node) RancherAPINodeGetLabels() (labels map[string]string, err error)
- func (node *Rancher2Node) RancherAPINodeGetState() (state string, err error)
- func (node *Rancher2Node) RancherAPINodeGetTaints() (taints []v1.Taint, err error)
- func (node *Rancher2Node) RancherAPINodeSetAnnotationsLabelsTaints() (err error)
- func (node *Rancher2Node) RancherAPINodeUncordon() (err error)
- func (node *Rancher2Node) RancherAPINodeUpdateLabels(oldLabels map[string]interface{}, newLabels map[string]interface{}) (err error)
- func (node *Rancher2Node) RancherAPINodeUpdateTaints(oldTaints []interface{}, newTaints []interface{}) (err error)
- func (node *Rancher2Node) RancherAPINodeWaitForGracePeriod(timeout int) (err error)
- func (node *Rancher2Node) RancherAPINodeWaitForState(state string, timeout int) (err error)
- func (node *Rancher2Node) RancherAPINodeWaitUntilDeleted(timeout int) (err error)
- type RancherNode
- type RkApiClient
- func (client *RkApiClient) ClusterWaitForState(clusterName string, state string, timeout int) (err error)
- func (client *RkApiClient) ClusterWaitForTransitioning(clusterName string, timeout int) (err error)
- func (client *RkApiClient) DeleteMachine(machineName string) (err error)
- func (client *RkApiClient) GetClusterList(opt metav1.ListOptions) (clusterList *unstructured.UnstructuredList, err error)
- func (client *RkApiClient) GetClusterState(clusterName string) (state string, err error)
- func (client *RkApiClient) GetMachineByName(machineName string) (machine *unstructured.Unstructured, err error)
- func (client *RkApiClient) GetMachineByNodeIp(clusterName string, nodeIp string) (machine *unstructured.Unstructured, err error)
- func (client *RkApiClient) GetMachineCondition(machine *unstructured.Unstructured) string
- func (client *RkApiClient) GetMachineList(opt metav1.ListOptions) (machineList *unstructured.UnstructuredList, err error)
- func (client *RkApiClient) GetMachineState(machineName string) (state string, err error)
- func (client *RkApiClient) IsMachineNotFound(err error) bool
- func (client *RkApiClient) IsNotFoundError(err error) bool
- func (client *RkApiClient) IsRancherReady() (err error)
- func (client *RkApiClient) IsTransientError(err error) bool
- func (client *RkApiClient) MachineWaitForState(machineName string, state string, timeout int) (err error)
- func (client *RkApiClient) NodeCordon(nodeName string) (err error)
- func (client *RkApiClient) NodeCordonDrain(nodeName string, nodeDrainInput *config.NodeDrainInput) (err error)
- func (client *RkApiClient) NodeDelete(nodeName string) (err error)
- func (client *RkApiClient) NodeGetLabels(nodeName string) (nodeLabels map[string]string, err error)
- func (client *RkApiClient) NodeGetTaints(nodeName string) (nodeTaints []v1.Taint, err error)
- func (client *RkApiClient) NodeSetAnnotationsLabelsTaints(nodeName string, annotations map[string]string, labels map[string]string, ...) (err error)
- func (client *RkApiClient) NodeUncordon(nodeName string) (err error)
- func (client *RkApiClient) NodeUpdateLabels(nodeName string, oldLabels map[string]interface{}, ...) (err error)
- func (client *RkApiClient) NodeUpdateTaints(nodeName string, oldTaints []interface{}, newTaints []interface{}) (err error)
- type RkApiNode
- func (node *RkApiNode) IsNodeControlPlane() bool
- func (node *RkApiNode) IsNodeEtcd() bool
- func (node *RkApiNode) IsNodeWorker() bool
- func (node *RkApiNode) IsProviderRKE1() bool
- func (node *RkApiNode) IsProviderRKE2() bool
- func (node *RkApiNode) RancherAPIClusterWaitForState(state string, timeout int) (err error)
- func (node *RkApiNode) RancherAPIClusterWaitForTransitioning(timeout int) (err error)
- func (node *RkApiNode) RancherAPINodeCordon() (err error)
- func (node *RkApiNode) RancherAPINodeCordonDrain() (err error)
- func (node *RkApiNode) RancherAPINodeDelete() (err error)
- func (node *RkApiNode) RancherAPINodeForceDelete() (err error)
- func (node *RkApiNode) RancherAPINodeGetID(d *schema.ResourceData, meta interface{}) (err error)
- func (node *RkApiNode) RancherAPINodeGetLabels() (labels map[string]string, err error)
- func (node *RkApiNode) RancherAPINodeGetState() (state string, err error)
- func (node *RkApiNode) RancherAPINodeGetTaints() (taints []v1.Taint, err error)
- func (node *RkApiNode) RancherAPINodeSetAnnotationsLabelsTaints() (err error)
- func (node *RkApiNode) RancherAPINodeUncordon() (err error)
- func (node *RkApiNode) RancherAPINodeUpdateLabels(oldLabels map[string]interface{}, newLabels map[string]interface{}) (err error)
- func (node *RkApiNode) RancherAPINodeUpdateTaints(oldTaints []interface{}, newTaints []interface{}) (err error)
- func (node *RkApiNode) RancherAPINodeWaitForGracePeriod(timeout int) (err error)
- func (node *RkApiNode) RancherAPINodeWaitForState(state string, timeout int) (err error)
- func (node *RkApiNode) RancherAPINodeWaitUntilDeleted(timeout int) (err error)
- type Rke2Client
- func (client *Rke2Client) GetNodeByName(nodeName string) (node *v1.Node, err error)
- func (client *Rke2Client) GetNodeName(nodeIpAddr string) (nodeName string, err error)
- func (client *Rke2Client) GetNodeRole(nodeName string) (controlplane bool, etcd bool, worker bool, err error)
- func (client *Rke2Client) IsNodeReady(nodeName string) (ready bool, err error)
- func (client *Rke2Client) IsNotFoundError(err error) bool
- func (client *Rke2Client) IsTransientError(err error) bool
- func (client *Rke2Client) NodeCordon(nodeName string) (err error)
- func (client *Rke2Client) NodeCordonDrain(nodeName string, nodeDrainInput *config.NodeDrainInput) (err error)
- func (client *Rke2Client) NodeDelete(nodeName string) (err error)
- func (client *Rke2Client) NodeGetLabels(nodeName string) (nodeLabels map[string]string, err error)
- func (client *Rke2Client) NodeGetTaints(nodeName string) (nodeTaints []v1.Taint, err error)
- func (client *Rke2Client) NodeSetAnnotationsLabelsTaints(nodeName string, annotations map[string]string, labels map[string]string, ...) (err error)
- func (client *Rke2Client) NodeUncordon(nodeName string) (err error)
- func (client *Rke2Client) NodeUpdateLabels(nodeName string, oldLabels map[string]interface{}, ...) (err error)
- func (client *Rke2Client) NodeUpdateTaints(nodeName string, oldTaints []interface{}, newTaints []interface{}) (err error)
- type Rke2Node
- func (node *Rke2Node) IsNodeControlPlane() bool
- func (node *Rke2Node) IsNodeEtcd() bool
- func (node *Rke2Node) IsNodeWorker() bool
- func (node *Rke2Node) IsProviderRKE1() bool
- func (node *Rke2Node) IsProviderRKE2() bool
- func (node *Rke2Node) RancherAPIClusterWaitForState(state string, timeout int) (err error)
- func (node *Rke2Node) RancherAPIClusterWaitForTransitioning(timeout int) (err error)
- func (node *Rke2Node) RancherAPINodeCordon() (err error)
- func (node *Rke2Node) RancherAPINodeCordonDrain() (err error)
- func (node *Rke2Node) RancherAPINodeDelete() (err error)
- func (node *Rke2Node) RancherAPINodeForceDelete() (err error)
- func (node *Rke2Node) RancherAPINodeGetID(d *schema.ResourceData, meta interface{}) (err error)
- func (node *Rke2Node) RancherAPINodeGetLabels() (labels map[string]string, err error)
- func (node *Rke2Node) RancherAPINodeGetState() (state string, err error)
- func (node *Rke2Node) RancherAPINodeGetTaints() (taints []v1.Taint, err error)
- func (node *Rke2Node) RancherAPINodeSetAnnotationsLabelsTaints() (err error)
- func (node *Rke2Node) RancherAPINodeUncordon() (err error)
- func (node *Rke2Node) RancherAPINodeUpdateLabels(oldLabels map[string]interface{}, newLabels map[string]interface{}) (err error)
- func (node *Rke2Node) RancherAPINodeUpdateTaints(oldTaints []interface{}, newTaints []interface{}) (err error)
- func (node *Rke2Node) RancherAPINodeWaitForGracePeriod(timeout int) (err error)
- func (node *Rke2Node) RancherAPINodeWaitForState(state string, timeout int) (err error)
- func (node *Rke2Node) RancherAPINodeWaitUntilDeleted(timeout int) (err error)
- type RkeClient
- func (client *RkeClient) GetNode(nodeIpAddr string) (nodeName string, err error)
- func (client *RkeClient) GetNodeRole(nodeName string) (controlplane bool, etcd bool, worker bool, err error)
- func (client *RkeClient) IsTransientError(err error) bool
- func (client *RkeClient) NodeCordon(nodeName string) (err error)
- func (client *RkeClient) NodeCordonDrain(nodeName string, nodeDrainInput *config.NodeDrainInput) (err error)
- func (client *RkeClient) NodeGetLabels(nodeName string) (nodeLabels map[string]string, err error)
- func (client *RkeClient) NodeGetTaints(nodeName string) (nodeTaints []v1.Taint, err error)
- func (client *RkeClient) NodeSetAnnotationsLabelsTaints(nodeName string, annotations map[string]string, labels map[string]string, ...) (err error)
- func (client *RkeClient) NodeUncordon(nodeName string) (err error)
- func (client *RkeClient) NodeUpdateLabels(nodeName string, oldLabels map[string]interface{}, ...) (err error)
- func (client *RkeClient) NodeUpdateTaints(nodeName string, oldTaints []interface{}, newTaints []interface{}) (err error)
- type RkeNode
- func (node *RkeNode) IsNodeControlPlane() bool
- func (node *RkeNode) IsNodeEtcd() bool
- func (node *RkeNode) IsNodeWorker() bool
- func (node *RkeNode) IsProviderRKE1() bool
- func (node *RkeNode) IsProviderRKE2() bool
- func (node *RkeNode) RancherAPIClusterWaitForState(state string, timeout int) (err error)
- func (node *RkeNode) RancherAPIClusterWaitForTransitioning(timeout int) (err error)
- func (node *RkeNode) RancherAPINodeCordon() (err error)
- func (node *RkeNode) RancherAPINodeCordonDrain() (err error)
- func (node *RkeNode) RancherAPINodeDelete() (err error)
- func (node *RkeNode) RancherAPINodeForceDelete() (err error)
- func (node *RkeNode) RancherAPINodeGetID(d *schema.ResourceData, meta interface{}) (err error)
- func (node *RkeNode) RancherAPINodeGetLabels() (labels map[string]string, err error)
- func (node *RkeNode) RancherAPINodeGetState() (state string, err error)
- func (node *RkeNode) RancherAPINodeGetTaints() (taints []v1.Taint, err error)
- func (node *RkeNode) RancherAPINodeSetAnnotationsLabelsTaints() (err error)
- func (node *RkeNode) RancherAPINodeUncordon() (err error)
- func (node *RkeNode) RancherAPINodeUpdateLabels(oldLabels map[string]interface{}, newLabels map[string]interface{}) (err error)
- func (node *RkeNode) RancherAPINodeUpdateTaints(oldTaints []interface{}, newTaints []interface{}) (err error)
- func (node *RkeNode) RancherAPINodeWaitForGracePeriod(timeout int) (err error)
- func (node *RkeNode) RancherAPINodeWaitForState(state string, timeout int) (err error)
- func (node *RkeNode) RancherAPINodeWaitUntilDeleted(timeout int) (err error)
Constants ¶
const ( CAPI_Group = "cluster.x-k8s.io" CAPI_Version = "v1beta1" CAPI_ClusterResource = "clusters" CAPI_MachineResource = "machines" )
const ( Wait4ClusterStateTimeout = 1800 Wait4ClusterTransitioningTimeout = 60 Wait4NodeStateTimeout = 600 Wait4NodeDeleteTimeout = 600 ConnResetTriesMax = 12 ConnResetSleepTimeout = 60 )
Default timeouts
const ( HostNameLabel = "kubernetes.io/hostname" NodeRoleLabelWorker = "node-role.kubernetes.io/worker" NodeRoleLabelControlplane = "node-role.kubernetes.io/controlplane" NodeRoleLabelEtcd = "node-role.kubernetes.io/etcd" )
const ( Rke2HostNameLabel = "kubernetes.io/hostname" Rke2NodeRoleLabelWorker = "node-role.kubernetes.io/worker" Rke2NodeRoleLabelControlplane = "node-role.kubernetes.io/control-plane" Rke2NodeRoleLabelEtcd = "node-role.kubernetes.io/etcd" )
Variables ¶
This section is empty.
Functions ¶
func DiscoverNode ¶ added in v1.8.0
func DiscoverNode(d *schema.ResourceData, meta interface{}, nodeConfig *config.NodeConfig) (err error)
func GetMapString ¶ added in v1.9.5
Get string map value safely
func NewListOpts ¶
NewListOpts creates ListOpts
Types ¶
type Rancher2Client ¶ added in v1.8.0
type Rancher2Client struct { Management *managementClient.Client MachineClient dynamic.NamespaceableResourceInterface Retries int }
Rancher2Client is rancher2 client
func (*Rancher2Client) ClusterWaitForState ¶ added in v1.8.0
func (client *Rancher2Client) ClusterWaitForState(clusterID string, states string, timeout int) (err error)
ClusterWaitForState waits until cluster is in specified state
func (*Rancher2Client) ClusterWaitForTransitioning ¶ added in v1.8.0
func (client *Rancher2Client) ClusterWaitForTransitioning(clusterID string, timeout int) (err error)
ClusterWaitForTransitioning waits until cluster enters transitioning state
func (*Rancher2Client) DeleteNode ¶ added in v1.8.0
func (client *Rancher2Client) DeleteNode(nodeID string) (err error)
DeleteNode deletes Rancher node and node machine
func (*Rancher2Client) GetClusterByID ¶ added in v1.8.0
func (client *Rancher2Client) GetClusterByID(clusterID string) (cluster *managementClient.Cluster, err error)
Resilient to transient errors version of Cluster.ByID
func (*Rancher2Client) GetClusterList ¶ added in v1.8.0
func (client *Rancher2Client) GetClusterList(opts *types.ListOpts) (clusters *managementClient.ClusterCollection, err error)
Resilient to transient errors version of Cluster.List
func (*Rancher2Client) GetNodeByAddr ¶ added in v1.8.0
func (client *Rancher2Client) GetNodeByAddr(clusterID string, nodeIPAddr string) (cluster *managementClient.Cluster, node *managementClient.Node, nodeID string, err error)
GetNode gets Rancher node by cluster ID and node IP address
func (*Rancher2Client) GetNodeByID ¶ added in v1.8.0
func (client *Rancher2Client) GetNodeByID(nodeID string) (node *managementClient.Node, err error)
Resilient to transient errors version of Node.ByID
func (*Rancher2Client) GetNodeList ¶ added in v1.8.0
func (client *Rancher2Client) GetNodeList(opts *types.ListOpts) (nodes *managementClient.NodeCollection, err error)
Resilient to transient errors version of Node.List
func (*Rancher2Client) GetNodeMachine ¶ added in v1.9.5
func (client *Rancher2Client) GetNodeMachine(node *managementClient.Node) (machine *unstructured.Unstructured, err error)
GetNodeMachine gets Rancher node machine resource
func (*Rancher2Client) GetNodeRole ¶ added in v1.8.0
func (client *Rancher2Client) GetNodeRole(nodeID string) (controlplane bool, etcd bool, worker bool, err error)
GetNodeRole gets Rancher node role
func (*Rancher2Client) NodeCordon ¶ added in v1.8.0
func (client *Rancher2Client) NodeCordon(nodeID string) (err error)
NodeCordon cordon Rancher node
func (*Rancher2Client) NodeCordonDrain ¶ added in v1.8.0
func (client *Rancher2Client) NodeCordonDrain(nodeID string, nodeDrainInput *managementClient.NodeDrainInput) (err error)
NodeCordonDrain cordon/drain Rancher node
func (*Rancher2Client) NodeGetLabels ¶ added in v1.8.0
func (client *Rancher2Client) NodeGetLabels(nodeID string) (nodeLabels map[string]string, err error)
NodeGetLabels get Rancher node labels
func (*Rancher2Client) NodeGetState ¶ added in v1.8.0
func (client *Rancher2Client) NodeGetState(nodeID string) (state string, err error)
NodeGetState gets Rancher node state
func (*Rancher2Client) NodeGetTaints ¶ added in v1.8.0
func (client *Rancher2Client) NodeGetTaints(nodeID string) (taints []managementClient.Taint, err error)
NodeGetTaints get Rancher node taints
func (*Rancher2Client) NodeSetAnnotationsLabelsTaints ¶ added in v1.8.0
func (client *Rancher2Client) NodeSetAnnotationsLabelsTaints(nodeID string, annotations map[string]string, labels map[string]string, taints []managementClient.Taint) (err error)
NodeSetAnnotationsLabelsTaints sets Rancher node annotations, labels, and taints
func (*Rancher2Client) NodeUncordon ¶ added in v1.8.0
func (client *Rancher2Client) NodeUncordon(nodeID string) (err error)
NodeUncordon uncordon Rancher node
func (*Rancher2Client) NodeUpdateLabels ¶ added in v1.8.0
func (client *Rancher2Client) NodeUpdateLabels(nodeID string, oldLabels map[string]interface{}, newLabels map[string]interface{}) (err error)
NodeUpdateLabels updates Rancher node labels
func (*Rancher2Client) NodeUpdateTaints ¶ added in v1.8.0
func (client *Rancher2Client) NodeUpdateTaints(nodeID string, oldTaints []interface{}, newTaints []interface{}) (err error)
NodeUpdateTaints updates Rancher node taints
func (*Rancher2Client) NodeWaitForState ¶ added in v1.8.0
func (client *Rancher2Client) NodeWaitForState(nodeID string, states string, timeout int) (err error)
NodeWaitForState waits until Rancher node in specified state
type Rancher2Config ¶ added in v1.8.0
type Rancher2Config struct { config.RancherConfig Client Rancher2Client }
Rancher2Config is rancher2 client configuration
func (*Rancher2Config) InitializeClient ¶ added in v1.8.0
func (c *Rancher2Config) InitializeClient() (err error)
InitializeClient initializes Rancher Management Client
type Rancher2Node ¶ added in v1.8.0
type Rancher2Node struct { RancherClient *Rancher2Client NodeConfig *config.NodeConfig NodeDrainInput *rancherManagementClient.NodeDrainInput ClusterID string ClusterProvider string NodeID string NodeControlPlane bool NodeEtcd bool NodeWorker bool }
RancherNode is rancher2 node definition
func Rancher2APIInitialize ¶ added in v1.8.0
func Rancher2APIInitialize(d *schema.ResourceData, meta interface{}, nodeConfig *config.NodeConfig, waitForNode bool) (node *Rancher2Node, err error)
func (*Rancher2Node) IsNodeControlPlane ¶ added in v1.8.0
func (node *Rancher2Node) IsNodeControlPlane() bool
func (*Rancher2Node) IsNodeEtcd ¶ added in v1.8.0
func (node *Rancher2Node) IsNodeEtcd() bool
func (*Rancher2Node) IsNodeWorker ¶ added in v1.8.0
func (node *Rancher2Node) IsNodeWorker() bool
func (*Rancher2Node) IsProviderRKE1 ¶ added in v1.8.4
func (node *Rancher2Node) IsProviderRKE1() bool
func (*Rancher2Node) IsProviderRKE2 ¶ added in v1.8.4
func (node *Rancher2Node) IsProviderRKE2() bool
func (*Rancher2Node) RancherAPIClusterWaitForState ¶ added in v1.8.0
func (node *Rancher2Node) RancherAPIClusterWaitForState(state string, timeout int) (err error)
func (*Rancher2Node) RancherAPIClusterWaitForTransitioning ¶ added in v1.8.0
func (node *Rancher2Node) RancherAPIClusterWaitForTransitioning(timeout int) (err error)
func (*Rancher2Node) RancherAPINodeCordon ¶ added in v1.8.0
func (node *Rancher2Node) RancherAPINodeCordon() (err error)
func (*Rancher2Node) RancherAPINodeCordonDrain ¶ added in v1.8.0
func (node *Rancher2Node) RancherAPINodeCordonDrain() (err error)
func (*Rancher2Node) RancherAPINodeDelete ¶ added in v1.8.0
func (node *Rancher2Node) RancherAPINodeDelete() (err error)
func (*Rancher2Node) RancherAPINodeForceDelete ¶ added in v1.10.2
func (node *Rancher2Node) RancherAPINodeForceDelete() (err error)
func (*Rancher2Node) RancherAPINodeGetID ¶ added in v1.8.0
func (node *Rancher2Node) RancherAPINodeGetID(d *schema.ResourceData, meta interface{}) (err error)
func (*Rancher2Node) RancherAPINodeGetLabels ¶ added in v1.8.0
func (node *Rancher2Node) RancherAPINodeGetLabels() (labels map[string]string, err error)
func (*Rancher2Node) RancherAPINodeGetState ¶ added in v1.10.3
func (node *Rancher2Node) RancherAPINodeGetState() (state string, err error)
func (*Rancher2Node) RancherAPINodeGetTaints ¶ added in v1.8.0
func (node *Rancher2Node) RancherAPINodeGetTaints() (taints []v1.Taint, err error)
func (*Rancher2Node) RancherAPINodeSetAnnotationsLabelsTaints ¶ added in v1.8.0
func (node *Rancher2Node) RancherAPINodeSetAnnotationsLabelsTaints() (err error)
func (*Rancher2Node) RancherAPINodeUncordon ¶ added in v1.8.0
func (node *Rancher2Node) RancherAPINodeUncordon() (err error)
func (*Rancher2Node) RancherAPINodeUpdateLabels ¶ added in v1.8.0
func (node *Rancher2Node) RancherAPINodeUpdateLabels(oldLabels map[string]interface{}, newLabels map[string]interface{}) (err error)
func (*Rancher2Node) RancherAPINodeUpdateTaints ¶ added in v1.8.0
func (node *Rancher2Node) RancherAPINodeUpdateTaints(oldTaints []interface{}, newTaints []interface{}) (err error)
func (*Rancher2Node) RancherAPINodeWaitForGracePeriod ¶ added in v1.8.0
func (node *Rancher2Node) RancherAPINodeWaitForGracePeriod(timeout int) (err error)
func (*Rancher2Node) RancherAPINodeWaitForState ¶ added in v1.8.0
func (node *Rancher2Node) RancherAPINodeWaitForState(state string, timeout int) (err error)
func (*Rancher2Node) RancherAPINodeWaitUntilDeleted ¶ added in v1.10.0
func (node *Rancher2Node) RancherAPINodeWaitUntilDeleted(timeout int) (err error)
type RancherNode ¶ added in v1.8.0
type RancherNode interface { RancherAPINodeGetID(d *schema.ResourceData, meta interface{}) error RancherAPIClusterWaitForState(state string, timeout int) error RancherAPIClusterWaitForTransitioning(timeout int) error RancherAPINodeWaitForState(state string, timeout int) error RancherAPINodeWaitUntilDeleted(timeout int) error RancherAPINodeWaitForGracePeriod(timeout int) error RancherAPINodeGetState() (string, error) RancherAPINodeCordon() error RancherAPINodeCordonDrain() error RancherAPINodeUncordon() error RancherAPINodeDelete() error RancherAPINodeForceDelete() error RancherAPINodeSetAnnotationsLabelsTaints() error RancherAPINodeGetLabels() (map[string]string, error) RancherAPINodeUpdateLabels(oldLabels map[string]interface{}, newLabels map[string]interface{}) error RancherAPINodeGetTaints() ([]v1.Taint, error) RancherAPINodeUpdateTaints(oldTaints []interface{}, newTaints []interface{}) error IsNodeControlPlane() bool IsNodeWorker() bool IsNodeEtcd() bool IsProviderRKE1() bool IsProviderRKE2() bool }
func RancherAPIInitialize ¶ added in v1.8.0
func RancherAPIInitialize(d *schema.ResourceData, meta interface{}, nodeConfig *config.NodeConfig, waitForNode bool) (node RancherNode, err error)
type RkApiClient ¶ added in v1.10.0
type RkApiClient struct { RancherConfig *config.RancherConfig LocalClusterClient dynamic.Interface DownstreamClusterClient *kubernetes.Clientset }
RkApiClient is RK-API client
func (*RkApiClient) ClusterWaitForState ¶ added in v1.10.0
func (client *RkApiClient) ClusterWaitForState(clusterName string, state string, timeout int) (err error)
ClusterWaitForState waits until cluster is in specified state
func (*RkApiClient) ClusterWaitForTransitioning ¶ added in v1.10.0
func (client *RkApiClient) ClusterWaitForTransitioning(clusterName string, timeout int) (err error)
ClusterWaitForTransitioning waits until cluster enters transitioning state
func (*RkApiClient) DeleteMachine ¶ added in v1.10.0
func (client *RkApiClient) DeleteMachine(machineName string) (err error)
DeleteMachine deletes node machine
func (*RkApiClient) GetClusterList ¶ added in v1.10.0
func (client *RkApiClient) GetClusterList(opt metav1.ListOptions) (clusterList *unstructured.UnstructuredList, err error)
Resilient to transient errors GetClusterList
func (*RkApiClient) GetClusterState ¶ added in v1.10.0
func (client *RkApiClient) GetClusterState(clusterName string) (state string, err error)
GetClusterState resturns cluster state: "active", "inTransition", or "notReady"
func (*RkApiClient) GetMachineByName ¶ added in v1.10.0
func (client *RkApiClient) GetMachineByName(machineName string) (machine *unstructured.Unstructured, err error)
GetMachineByName get machine by machine name
func (*RkApiClient) GetMachineByNodeIp ¶ added in v1.10.0
func (client *RkApiClient) GetMachineByNodeIp(clusterName string, nodeIp string) (machine *unstructured.Unstructured, err error)
GetMachineByNodeIp search machine by cluster name and node IP
func (*RkApiClient) GetMachineCondition ¶ added in v1.10.0
func (client *RkApiClient) GetMachineCondition(machine *unstructured.Unstructured) string
GetMachineCondition get machine condition details
func (*RkApiClient) GetMachineList ¶ added in v1.10.0
func (client *RkApiClient) GetMachineList(opt metav1.ListOptions) (machineList *unstructured.UnstructuredList, err error)
Resilient to transient errors GetMachineList
func (*RkApiClient) GetMachineState ¶ added in v1.10.0
func (client *RkApiClient) GetMachineState(machineName string) (state string, err error)
GetMachineState returns machine state: "active", "inTransition", or "notReady"
func (*RkApiClient) IsMachineNotFound ¶ added in v1.10.0
func (client *RkApiClient) IsMachineNotFound(err error) bool
IsMachineNotFound returns true if error signifies "no machine found"
func (*RkApiClient) IsNotFoundError ¶ added in v1.10.2
func (client *RkApiClient) IsNotFoundError(err error) bool
IsNotFoundError returns true in case of "not found" error
func (*RkApiClient) IsRancherReady ¶ added in v1.10.0
func (client *RkApiClient) IsRancherReady() (err error)
Retry Rancher server URL probes number of "Retries" attempts or until ready
func (*RkApiClient) IsTransientError ¶ added in v1.10.0
func (client *RkApiClient) IsTransientError(err error) bool
IsTransientError returns true in case of transient error
func (*RkApiClient) MachineWaitForState ¶ added in v1.10.0
func (client *RkApiClient) MachineWaitForState(machineName string, state string, timeout int) (err error)
MachineWaitForState waits until Rancher machine in specified state
func (*RkApiClient) NodeCordon ¶ added in v1.10.0
func (client *RkApiClient) NodeCordon(nodeName string) (err error)
NodeCordon cordon Kubernetes node
func (*RkApiClient) NodeCordonDrain ¶ added in v1.10.0
func (client *RkApiClient) NodeCordonDrain(nodeName string, nodeDrainInput *config.NodeDrainInput) (err error)
NodeCordonDrain cordon and drain Kubernetes node
func (*RkApiClient) NodeDelete ¶ added in v1.10.2
func (client *RkApiClient) NodeDelete(nodeName string) (err error)
NodeDelete deletes node
func (*RkApiClient) NodeGetLabels ¶ added in v1.10.0
func (client *RkApiClient) NodeGetLabels(nodeName string) (nodeLabels map[string]string, err error)
NodeGetLabels get node labels
func (*RkApiClient) NodeGetTaints ¶ added in v1.10.0
func (client *RkApiClient) NodeGetTaints(nodeName string) (nodeTaints []v1.Taint, err error)
NodeGetTaints get node taints
func (*RkApiClient) NodeSetAnnotationsLabelsTaints ¶ added in v1.10.0
func (client *RkApiClient) NodeSetAnnotationsLabelsTaints(nodeName string, annotations map[string]string, labels map[string]string, taints []v1.Taint) (err error)
NodeSetAnnotationsLabelsTaints sets Rancher node annotations, labels, and taints
func (*RkApiClient) NodeUncordon ¶ added in v1.10.0
func (client *RkApiClient) NodeUncordon(nodeName string) (err error)
NodeUncordon uncordon Kubernetes node
func (*RkApiClient) NodeUpdateLabels ¶ added in v1.10.0
func (client *RkApiClient) NodeUpdateLabels(nodeName string, oldLabels map[string]interface{}, newLabels map[string]interface{}) (err error)
NodeUpdateLabels updates node labels
func (*RkApiClient) NodeUpdateTaints ¶ added in v1.10.0
func (client *RkApiClient) NodeUpdateTaints(nodeName string, oldTaints []interface{}, newTaints []interface{}) (err error)
NodeUpdateTaints updates node taints
type RkApiNode ¶ added in v1.10.0
type RkApiNode struct { RancherClient *RkApiClient NodeConfig *config.NodeConfig NodeDrainInput *config.NodeDrainInput ClusterName string ClusterID string NodeName string NodeID string NodeControlPlane bool NodeEtcd bool NodeWorker bool }
RkApiNode is Rancher Kubernetes API node definition
func RkApiInitialize ¶ added in v1.10.0
func RkApiInitialize(d *schema.ResourceData, meta interface{}, nodeConfig *config.NodeConfig, waitForNode bool) (node *RkApiNode, err error)
func (*RkApiNode) IsNodeControlPlane ¶ added in v1.10.0
func (*RkApiNode) IsNodeEtcd ¶ added in v1.10.0
func (*RkApiNode) IsNodeWorker ¶ added in v1.10.0
func (*RkApiNode) IsProviderRKE1 ¶ added in v1.10.0
func (*RkApiNode) IsProviderRKE2 ¶ added in v1.10.0
func (*RkApiNode) RancherAPIClusterWaitForState ¶ added in v1.10.0
func (*RkApiNode) RancherAPIClusterWaitForTransitioning ¶ added in v1.10.0
func (*RkApiNode) RancherAPINodeCordon ¶ added in v1.10.0
func (*RkApiNode) RancherAPINodeCordonDrain ¶ added in v1.10.0
func (*RkApiNode) RancherAPINodeDelete ¶ added in v1.10.0
func (*RkApiNode) RancherAPINodeForceDelete ¶ added in v1.10.2
func (*RkApiNode) RancherAPINodeGetID ¶ added in v1.10.0
func (node *RkApiNode) RancherAPINodeGetID(d *schema.ResourceData, meta interface{}) (err error)
func (*RkApiNode) RancherAPINodeGetLabels ¶ added in v1.10.0
func (*RkApiNode) RancherAPINodeGetState ¶ added in v1.10.3
func (*RkApiNode) RancherAPINodeGetTaints ¶ added in v1.10.0
func (*RkApiNode) RancherAPINodeSetAnnotationsLabelsTaints ¶ added in v1.10.0
func (*RkApiNode) RancherAPINodeUncordon ¶ added in v1.10.0
func (*RkApiNode) RancherAPINodeUpdateLabels ¶ added in v1.10.0
func (*RkApiNode) RancherAPINodeUpdateTaints ¶ added in v1.10.0
func (*RkApiNode) RancherAPINodeWaitForGracePeriod ¶ added in v1.10.0
func (*RkApiNode) RancherAPINodeWaitForState ¶ added in v1.10.0
func (*RkApiNode) RancherAPINodeWaitUntilDeleted ¶ added in v1.10.0
type Rke2Client ¶ added in v1.11.0
type Rke2Client struct { RancherConfig *config.RancherConfig Management *kubernetes.Clientset }
Rke2Client is RKE2 client
func (*Rke2Client) GetNodeByName ¶ added in v1.11.1
func (client *Rke2Client) GetNodeByName(nodeName string) (node *v1.Node, err error)
GetNodeByName gets RKE2 node by node name
func (*Rke2Client) GetNodeName ¶ added in v1.11.1
func (client *Rke2Client) GetNodeName(nodeIpAddr string) (nodeName string, err error)
GetNode gets RKE2 node name by node IP address
func (*Rke2Client) GetNodeRole ¶ added in v1.11.0
func (client *Rke2Client) GetNodeRole(nodeName string) (controlplane bool, etcd bool, worker bool, err error)
GetNodeRole gets RKE2 node role
func (*Rke2Client) IsNodeReady ¶ added in v1.11.0
func (client *Rke2Client) IsNodeReady(nodeName string) (ready bool, err error)
IsNodeReady returns true if node ready
func (*Rke2Client) IsNotFoundError ¶ added in v1.11.0
func (client *Rke2Client) IsNotFoundError(err error) bool
IsNotFoundError returns true in case of "not found" error
func (*Rke2Client) IsTransientError ¶ added in v1.11.0
func (client *Rke2Client) IsTransientError(err error) bool
IsTransientError returns true in case of transient error
func (*Rke2Client) NodeCordon ¶ added in v1.11.0
func (client *Rke2Client) NodeCordon(nodeName string) (err error)
NodeCordon cordon RKE2 node
func (*Rke2Client) NodeCordonDrain ¶ added in v1.11.0
func (client *Rke2Client) NodeCordonDrain(nodeName string, nodeDrainInput *config.NodeDrainInput) (err error)
NodeCordonDrain cordon and drain RKE2 node
func (*Rke2Client) NodeDelete ¶ added in v1.11.0
func (client *Rke2Client) NodeDelete(nodeName string) (err error)
NodeDelete deletes RKE2 node
func (*Rke2Client) NodeGetLabels ¶ added in v1.11.0
func (client *Rke2Client) NodeGetLabels(nodeName string) (nodeLabels map[string]string, err error)
NodeGetLabels get RKE2 node labels
func (*Rke2Client) NodeGetTaints ¶ added in v1.11.0
func (client *Rke2Client) NodeGetTaints(nodeName string) (nodeTaints []v1.Taint, err error)
NodeGetTaints get RKE2 node taints
func (*Rke2Client) NodeSetAnnotationsLabelsTaints ¶ added in v1.11.0
func (client *Rke2Client) NodeSetAnnotationsLabelsTaints(nodeName string, annotations map[string]string, labels map[string]string, taints []v1.Taint) (err error)
NodeSetAnnotationsLabelsTaints sets Rancher node annotations, labels, and taints
func (*Rke2Client) NodeUncordon ¶ added in v1.11.0
func (client *Rke2Client) NodeUncordon(nodeName string) (err error)
NodeUncordon uncordon RKE2 node
func (*Rke2Client) NodeUpdateLabels ¶ added in v1.11.0
func (client *Rke2Client) NodeUpdateLabels(nodeName string, oldLabels map[string]interface{}, newLabels map[string]interface{}) (err error)
NodeUpdateLabels updates RKE2 node labels
func (*Rke2Client) NodeUpdateTaints ¶ added in v1.11.0
func (client *Rke2Client) NodeUpdateTaints(nodeName string, oldTaints []interface{}, newTaints []interface{}) (err error)
NodeUpdateTaints updates RKE2 node taints
type Rke2Node ¶ added in v1.11.0
type Rke2Node struct { RancherClient *Rke2Client NodeConfig *config.NodeConfig NodeDrainInput *config.NodeDrainInput ClusterID string NodeID string NodeControlPlane bool NodeEtcd bool NodeWorker bool }
Rke2Node is Rancher RKE2 node definition
func Rke2APIInitialize ¶ added in v1.11.0
func Rke2APIInitialize(d *schema.ResourceData, meta interface{}, nodeConfig *config.NodeConfig, waitForNode bool) (node *Rke2Node, err error)
func (*Rke2Node) IsNodeControlPlane ¶ added in v1.11.0
func (*Rke2Node) IsNodeEtcd ¶ added in v1.11.0
func (*Rke2Node) IsNodeWorker ¶ added in v1.11.0
func (*Rke2Node) IsProviderRKE1 ¶ added in v1.11.0
func (*Rke2Node) IsProviderRKE2 ¶ added in v1.11.0
func (*Rke2Node) RancherAPIClusterWaitForState ¶ added in v1.11.0
func (*Rke2Node) RancherAPIClusterWaitForTransitioning ¶ added in v1.11.0
func (*Rke2Node) RancherAPINodeCordon ¶ added in v1.11.0
func (*Rke2Node) RancherAPINodeCordonDrain ¶ added in v1.11.0
func (*Rke2Node) RancherAPINodeDelete ¶ added in v1.11.0
func (*Rke2Node) RancherAPINodeForceDelete ¶ added in v1.11.0
func (*Rke2Node) RancherAPINodeGetID ¶ added in v1.11.0
func (node *Rke2Node) RancherAPINodeGetID(d *schema.ResourceData, meta interface{}) (err error)
func (*Rke2Node) RancherAPINodeGetLabels ¶ added in v1.11.0
func (*Rke2Node) RancherAPINodeGetState ¶ added in v1.11.0
func (*Rke2Node) RancherAPINodeGetTaints ¶ added in v1.11.0
func (*Rke2Node) RancherAPINodeSetAnnotationsLabelsTaints ¶ added in v1.11.0
func (*Rke2Node) RancherAPINodeUncordon ¶ added in v1.11.0
func (*Rke2Node) RancherAPINodeUpdateLabels ¶ added in v1.11.0
func (*Rke2Node) RancherAPINodeUpdateTaints ¶ added in v1.11.0
func (*Rke2Node) RancherAPINodeWaitForGracePeriod ¶ added in v1.11.0
func (*Rke2Node) RancherAPINodeWaitForState ¶ added in v1.11.0
func (*Rke2Node) RancherAPINodeWaitUntilDeleted ¶ added in v1.11.0
type RkeClient ¶ added in v1.8.0
type RkeClient struct { RancherConfig *config.RancherConfig Management *kubernetes.Clientset }
RkeClient is RKE client
func (*RkeClient) GetNodeRole ¶ added in v1.8.0
func (client *RkeClient) GetNodeRole(nodeName string) (controlplane bool, etcd bool, worker bool, err error)
GetNodeRole gets RKE node role
func (*RkeClient) IsTransientError ¶ added in v1.10.1
IsTransientError returns true in case of transient error
func (*RkeClient) NodeCordon ¶ added in v1.8.0
NodeCordon cordon RKE node
func (*RkeClient) NodeCordonDrain ¶ added in v1.8.0
func (client *RkeClient) NodeCordonDrain(nodeName string, nodeDrainInput *config.NodeDrainInput) (err error)
NodeCordonDrain cordon and drain RKE node
func (*RkeClient) NodeGetLabels ¶ added in v1.8.0
NodeGetLabels get RKE node labels
func (*RkeClient) NodeGetTaints ¶ added in v1.8.0
NodeGetTaints get RKE node taints
func (*RkeClient) NodeSetAnnotationsLabelsTaints ¶ added in v1.8.0
func (client *RkeClient) NodeSetAnnotationsLabelsTaints(nodeName string, annotations map[string]string, labels map[string]string, taints []v1.Taint) (err error)
NodeSetAnnotationsLabelsTaints sets Rancher node annotations, labels, and taints
func (*RkeClient) NodeUncordon ¶ added in v1.8.0
NodeUncordon uncordon RKE node
func (*RkeClient) NodeUpdateLabels ¶ added in v1.8.0
func (client *RkeClient) NodeUpdateLabels(nodeName string, oldLabels map[string]interface{}, newLabels map[string]interface{}) (err error)
NodeUpdateLabels updates RKE node labels
func (*RkeClient) NodeUpdateTaints ¶ added in v1.8.0
func (client *RkeClient) NodeUpdateTaints(nodeName string, oldTaints []interface{}, newTaints []interface{}) (err error)
NodeUpdateTaints updates RKE node taints
type RkeNode ¶ added in v1.8.0
type RkeNode struct { RancherClient *RkeClient NodeConfig *config.NodeConfig NodeDrainInput *config.NodeDrainInput ClusterID string NodeID string NodeControlPlane bool NodeEtcd bool NodeWorker bool }
RkeNode is Rancher RKE node definition
func RkeAPIInitialize ¶ added in v1.8.0
func RkeAPIInitialize(d *schema.ResourceData, meta interface{}, nodeConfig *config.NodeConfig, waitForNode bool) (node *RkeNode, err error)
func (*RkeNode) IsNodeControlPlane ¶ added in v1.8.0
func (*RkeNode) IsNodeEtcd ¶ added in v1.8.0
func (*RkeNode) IsNodeWorker ¶ added in v1.8.0
func (*RkeNode) IsProviderRKE1 ¶ added in v1.8.4
func (*RkeNode) IsProviderRKE2 ¶ added in v1.8.4
func (*RkeNode) RancherAPIClusterWaitForState ¶ added in v1.8.0
func (*RkeNode) RancherAPIClusterWaitForTransitioning ¶ added in v1.8.0
func (*RkeNode) RancherAPINodeCordon ¶ added in v1.8.0
func (*RkeNode) RancherAPINodeCordonDrain ¶ added in v1.8.0
func (*RkeNode) RancherAPINodeDelete ¶ added in v1.8.0
func (*RkeNode) RancherAPINodeForceDelete ¶ added in v1.10.2
func (*RkeNode) RancherAPINodeGetID ¶ added in v1.8.0
func (node *RkeNode) RancherAPINodeGetID(d *schema.ResourceData, meta interface{}) (err error)