controller

package
v0.0.0-...-d5134a9 Latest Latest
Warning

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

Go to latest
Published: May 8, 2020 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

type Cluster struct {
	Name                  string `yaml:"name,omitempty"`
	Server                string `yaml:"server,omitempty"`
	InsecureSkipTLSVerify bool   `yaml:"insecure-skip-tls-verify,omitempty"`
	Cert                  string `yaml:"cert,omitempty"`
	Key                   string `yaml:"key,omitempty"`
	Ca                    string `yaml:"ca,omitempty"`
	Token                 string `yaml:"token,omitempty"`
	// contains filtered or unexported fields
}

Cluster is a Kubernetes cluster to witch synka will post resources to

func (*Cluster) GetClient

func (c *Cluster) GetClient(gvr *schema.GroupVersionResource) (dynamic.Interface, error)

GetClient creates and returns a dynamic client that can be used to interact with a cluster

type Config

type Config struct {
	Clusters []Cluster
}

Config is synka configuration

type Controller

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

Controller is a k8s controller implementation

func New

func New(client dynamic.Interface, config *Config, gvr *schema.GroupVersionResource) *Controller

New creates a new instance of controller for the given GroupVersionResource See https://godoc.org/k8s.io/apimachinery/pkg/runtime/schema#GroupVersionResource for more information

func (*Controller) Run

func (c *Controller) Run(stopCh <-chan struct{})

Run will set up the event handlers for types we are interested in, as well as syncing informer caches and starting workers. It will block until stopCh channel is closed, at which point it will shutdown the workqueue and wait for workers to finish processing their current work items.

type SyncConfig

type SyncConfig struct {
	Sync         bool
	SkipExisting bool
}

SyncConfig is the configuration of the sync process. It defines how a resource is synchronised.

func NewSyncConfig

func NewSyncConfig() SyncConfig

NewSyncConfig returns a SyncConfig with default values

func NewSyncConfigFrom

func NewSyncConfigFrom(m map[string]string) SyncConfig

NewSyncConfigFrom creates a SyncConfig from a map[string]string

Jump to

Keyboard shortcuts

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