proxy

package
v0.0.0-...-b0bff92 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2021 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProxierTypeKey = "kubernetes-port-forward"
)
View Source
const (
	// ProxyConfigMapKey the key to use in the configmap made for the proxy to
	// describe the config key
	ProxyConfigMapKey = "config"
)

Variables

This section is empty.

Functions

func CreateControllerProxy

func CreateControllerProxy(
	config ControllerProxyConfig,
	labels labels.Set,
	configI core.ConfigMapInterface,
	roleI rbac.RoleInterface,
	roleBindingI rbac.RoleBindingInterface,
	saI core.ServiceAccountInterface,
) error

CreateControllerProxy establishes the Kubernetes resources needed for proxying to a Juju controller. The end result of this function is a service account with a set of permissions that the Juju client can use for proxying to a controller.

func HasControllerProxy

func HasControllerProxy(
	name string,
	configI core.ConfigMapInterface,
) (bool, error)

Types

type ControllerProxyConfig

type ControllerProxyConfig struct {
	// Name to apply to kubernetes resources created for the controller
	// proxy. This name is also used later on for discovery of the proxy config.
	Name string `json:"name"`

	// Namespace to create the proxy kubernetes resources in. This is ultimately
	// used for discovery of the proxy settings.
	Namespace string `json:"namespace"`

	// RemotePort the remote port of the service to use when proxying
	RemotePort string `json:"remote-port"`

	// TargetService the service to target for proxying
	TargetService string `json:"target-service"`
}

ControllerProxyConfig is used to configure the kubernetes resources made for the controller proxy objects.

type Proxier

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

func GetControllerProxy

func GetControllerProxy(
	name,
	apiHost string,
	configI core.ConfigMapInterface,
	saI core.ServiceAccountInterface,
	secretI core.SecretInterface,
) (*Proxier, error)

func NewProxier

func NewProxier(config ProxierConfig) *Proxier

func NewProxierFromRawConfig

func NewProxierFromRawConfig(rawConf interface{}) (*Proxier, error)

func (*Proxier) Host

func (p *Proxier) Host() string

func (*Proxier) MarshalYAML

func (p *Proxier) MarshalYAML() (interface{}, error)

func (*Proxier) Port

func (p *Proxier) Port() string

func (*Proxier) SetAPIHost

func (p *Proxier) SetAPIHost(host string)

SetAPIHost updates the proxy info to use a different host address.

func (*Proxier) Start

func (p *Proxier) Start() (err error)

func (*Proxier) Stop

func (p *Proxier) Stop()

func (*Proxier) Type

func (p *Proxier) Type() string

type ProxierConfig

type ProxierConfig struct {
	APIHost             string `yaml:"api-host"`
	CAData              string `yaml:"ca-cert"`
	Namespace           string `yaml:"namespace"`
	RemotePort          string `yaml:"remote-port"`
	Service             string `yaml:"service"`
	ServiceAccountToken string `yaml:"service-account-token"`
}

func NewProxierConfig

func NewProxierConfig() *ProxierConfig

Jump to

Keyboard shortcuts

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