azure

package
v2.7.1 Latest Latest
Warning

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

Go to latest
Published: May 2, 2023 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Overview

Implements interaction with the Azure API.

Instance metadata is retrieved from the Azure IMDS API.

Retrieving metadata of other instances is done by using the Azure API, and requires Azure credentials.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cloud added in v2.3.0

type Cloud struct {
	// contains filtered or unexported fields
}

Cloud provides Azure metadata and API access.

func New added in v2.3.0

func New(ctx context.Context) (*Cloud, error)

New initializes Cloud with the needed API clients. Default credentials are used for authentication.

func (*Cloud) GetCCMConfig added in v2.3.0

func (c *Cloud) GetCCMConfig(ctx context.Context, providerID string, cloudServiceAccountURI string) ([]byte, error)

GetCCMConfig returns the configuration needed for the Kubernetes Cloud Controller Manager on Azure.

func (*Cloud) GetLoadBalancerEndpoint added in v2.3.0

func (c *Cloud) GetLoadBalancerEndpoint(ctx context.Context) (string, error)

GetLoadBalancerEndpoint retrieves the first load balancer IP from cloud provider metadata.

The returned string is an IP address without a port, but the method name needs to satisfy the metadata interface.

func (*Cloud) InitSecretHash added in v2.3.0

func (c *Cloud) InitSecretHash(ctx context.Context) ([]byte, error)

InitSecretHash retrieves the InitSecretHash of the current instance.

func (*Cloud) List added in v2.3.0

func (c *Cloud) List(ctx context.Context) ([]metadata.InstanceMetadata, error)

List retrieves all instances belonging to the current constellation.

func (*Cloud) Self added in v2.3.0

Self retrieves the current instance.

func (*Cloud) UID added in v2.3.0

func (c *Cloud) UID(ctx context.Context) (string, error)

UID retrieves the UID of the constellation.

type IMDSClient added in v2.7.0

type IMDSClient struct {
	// contains filtered or unexported fields
}

IMDSClient is a client for the Azure Instance Metadata Service.

func NewIMDSClient added in v2.7.0

func NewIMDSClient() *IMDSClient

NewIMDSClient creates a new IMDSClient.

func (*IMDSClient) Tags added in v2.7.0

func (c *IMDSClient) Tags(ctx context.Context) (map[string]string, error)

Tags returns the tags of the instance the function is called from.

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

Logger implements CloudLogger interface for Azure to Disclose early boot logs into Azure's App Insights service.

func NewLogger

func NewLogger(ctx context.Context) (*Logger, error)

NewLogger creates a new client to store information in Azure Application Insights https://github.com/Microsoft/ApplicationInsights-go

func (*Logger) Close

func (l *Logger) Close() error

Close blocks until all information are written to cloud API.

func (*Logger) Disclose

func (l *Logger) Disclose(msg string)

Disclose stores log information in Azure Application Insights! Do **NOT** log sensitive information!

Jump to

Keyboard shortcuts

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