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) RancherAPINodeGetID(d *schema.ResourceData, meta interface{}) (err error)
- func (node *Rancher2Node) RancherAPINodeGetLabels() (labels map[string]string, err error)
- func (node *Rancher2Node) RancherAPINodeGetTaints() (taints []rancherManagementClient.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)
- type RancherNode
- 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) NodeCordon(nodeName string) (err error)
- func (client *RkeClient) NodeCordonDrain(nodeName string, nodeDrainInput *rancherManagementClient.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) RancherAPINodeGetID(d *schema.ResourceData, meta interface{}) (err error)
- func (node *RkeNode) RancherAPINodeGetLabels() (labels map[string]string, err error)
- func (node *RkeNode) RancherAPINodeGetTaints() (taints []rancherManagementClient.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)
Constants ¶
const ( Wait4ClusterStateTimeout = 1800 Wait4NodeStateTimeout = 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" )
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) 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) RancherAPINodeGetTaints ¶ added in v1.8.0
func (node *Rancher2Node) RancherAPINodeGetTaints() (taints []rancherManagementClient.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)
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 RancherAPINodeWaitForGracePeriod(timeout int) error RancherAPINodeCordon() error RancherAPINodeCordonDrain() error RancherAPINodeUncordon() error RancherAPINodeDelete() error RancherAPINodeSetAnnotationsLabelsTaints() error RancherAPINodeGetLabels() (map[string]string, error) RancherAPINodeUpdateLabels(oldLabels map[string]interface{}, newLabels map[string]interface{}) error RancherAPINodeGetTaints() ([]rancherManagementClient.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 RkeClient ¶ added in v1.8.0
type RkeClient struct {
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) 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 *rancherManagementClient.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 *rancherManagementClient.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) RancherAPINodeGetID ¶ added in v1.8.0
func (node *RkeNode) RancherAPINodeGetID(d *schema.ResourceData, meta interface{}) (err error)
func (*RkeNode) RancherAPINodeGetLabels ¶ added in v1.8.0
func (*RkeNode) RancherAPINodeGetTaints ¶ added in v1.8.0
func (node *RkeNode) RancherAPINodeGetTaints() (taints []rancherManagementClient.Taint, err error)