apiserver

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package apiserver contains utility functions to configure the connection parameters to the Kubernetes API server to advertise to peering clusters.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAddressFromMasterNode

func GetAddressFromMasterNode(ctx context.Context,
	clientset kubernetes.Interface) (address string, err error)

GetAddressFromMasterNode returns the API Server address using the IP of the master node of this cluster. The port is always defaulted to 6443.

func GetURL

func GetURL(addressOverride string, clientset kubernetes.Interface) (string, error)

GetURL retrieves the API server URL either from the configuration or selecting the IP address of a master node (with port 6443).

func InitFlags

func InitFlags(flagset *flag.FlagSet)

InitFlags initializes the flags to configure the API server parameters.

Types

type Config

type Config struct {
	// The address of the Kubernetes API Server, advertised to the peering clusters.
	Address string

	// Whether the Kubernetes API Server is exposed through a trusted certification authority,
	// which does not need to be explicitly advertised.
	TrustedCA bool

	// The certification authority trusted by the API server.
	CA string
}

Config defines the configuration parameters to contact the Kubernetes API server.

func GetConfig

func GetConfig() Config

GetConfig returns the API server configuration populated based on the command line parameters.

func (*Config) Complete added in v0.3.1

func (c *Config) Complete(restcfg *rest.Config, client kubernetes.Interface) (err error)

Complete completes the retrieval of the configuration, defaulting the fields if not set.

Jump to

Keyboard shortcuts

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