gce

package
v1.29.0 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type VM

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

VM represents a VM instance running on Google Cloud. It uses the metadata server to fetch all required information.

func NewVM

func NewVM(logger klog.Logger) (vm *VM, err error)

NewVM fetches all data needed from the metadata server to create VM

func (*VM) Credentials

func (vm *VM) Credentials() (daemonutils.ClusterCredentials, error)

Credentials contain the credentials used for the daemon to access the cluster

func (*VM) Hostname

func (vm *VM) Hostname() (string, bool)

Hostname is the hostname or DNS address of the workload

func (*VM) IP

func (vm *VM) IP() (string, bool)

IP is the IP used to access this workload from the cluster

func (*VM) KubeConfig

func (vm *VM) KubeConfig() (config *rest.Config, err error)

KubeConfig yields the config used to create Kubernetes clientset. It tries the following ways in order: - Use ~/.kube/config file. - Use Kubernetes service account (KSA) specified by metadata. - Use gcloud IAM service account (GSA) associated with this instance.

func (*VM) Labels

func (vm *VM) Labels() map[string]string

Labels are one or more labels associated with the workload

func (*VM) Name

func (vm *VM) Name() (string, bool)

Name is the name of the workload

func (*VM) Region

func (vm *VM) Region() (string, bool)

Region associated with the endpoint.

func (*VM) Zone

func (vm *VM) Zone() (string, bool)

Zone associated with the endpoint.

Jump to

Keyboard shortcuts

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