k8s

package
v0.0.4-0...-d7aeda2 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Wrapper around standard k8s API client with encapsulated configs in order have info for building domain specific high level operations (like sync forwarders) on top of common low level operations provided by standard k8s API client

func NewClient

func NewClient(ctx context.Context, gravityK8sCfg *Config, lograngeK8sCfg *Config,
	lograngeFwdTmpl *forwarder.WorkerConfig) (*Client, error)

Creates new domain specific K8s client for the given configs

func (*Client) SyncForwarders

func (cli *Client) SyncForwarders(ctx context.Context)

Syncs forwarders configuration from Gravity configMap to Logrange configMap. The operation is needed since in Gravity cluster, forwarders configuration is stored in its own place and has its own format (and we can't break backward compatibility for now), at the same time Logrange has different place to store this info and slightly different format...

type Config

type Config struct {
	// k8s namespace
	Namespace string
	// k8s forwarders configMap in the given namespace
	ForwarderConfigMapName string
}

Represents Gravity or Logrange k8s config

func (*Config) Check

func (cfg *Config) Check() error

Checks whether current config is valid and safe to use

func (*Config) Merge

func (cfg *Config) Merge(other *Config)

Merges current config with the given one

func (*Config) String

func (cfg *Config) String() string

Jump to

Keyboard shortcuts

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