Documentation
¶
Index ¶
- type IMDSNodeProvider
- func (np *IMDSNodeProvider) GetZone(ctx context.Context) (cloudprovider.Zone, error)
- func (np *IMDSNodeProvider) InstanceID(ctx context.Context, name types.NodeName) (string, error)
- func (np *IMDSNodeProvider) InstanceType(ctx context.Context, name types.NodeName) (string, error)
- func (np *IMDSNodeProvider) NodeAddresses(ctx context.Context, name types.NodeName) ([]v1.NodeAddress, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IMDSNodeProvider ¶
type IMDSNodeProvider struct {
// contains filtered or unexported fields
}
IMDSNodeProvider implements nodemanager.NodeProvider.
func NewIMDSNodeProvider ¶
func NewIMDSNodeProvider() *IMDSNodeProvider
NewIMDSNodeProvider creates a new IMDSNodeProvider.
func (*IMDSNodeProvider) GetZone ¶
func (np *IMDSNodeProvider) GetZone(ctx context.Context) (cloudprovider.Zone, error)
GetZone returns the Zone containing the current failure zone and locality region that the program is running in In most cases, this method is called from the kubelet querying a local metadata service to acquire its zone. If the node is not running with availability zones, then it will fall back to fault domain.
func (*IMDSNodeProvider) InstanceID ¶
InstanceID returns the cloud provider ID of the specified instance. Note that if the instance does not exist or is no longer running, we must return ("", cloudprovider.InstanceNotFound)
func (*IMDSNodeProvider) InstanceType ¶
InstanceType returns the type of the specified instance. Note that if the instance does not exist or is no longer running, we must return ("", cloudprovider.InstanceNotFound) (Implementer Note): This is used by kubelet. Kubelet will label the node. Real log from kubelet:
Adding node label from cloud provider: beta.kubernetes.io/instance-type=[value]
func (*IMDSNodeProvider) NodeAddresses ¶
func (np *IMDSNodeProvider) NodeAddresses(ctx context.Context, name types.NodeName) ([]v1.NodeAddress, error)
NodeAddresses returns the addresses of the specified instance.