controller

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2017 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller struct {
	// a kubernetes client object
	Client kubernetes.Interface
}

func NewController

func NewController(client kubernetes.Interface) *Controller

NewController instantiates a new controller.

func (*Controller) EnsureConfigMap

func (c *Controller) EnsureConfigMap(namespace, configMapName string) error

EnsureConfigMap creates a ConfigMap specified by namespace and name if it doesn't already exist.

func (*Controller) GenerateConfig

func (c *Controller) GenerateConfig(ingresses ...extensions.Ingress) (*armor.Armor, error)

GenerateConfig receives a list of Ingress objects and generates a corresponding Armor config from it. It also sets up some default plugins and enables automatic TLS certificate retrieval from Let's Encrypt.

func (*Controller) GetExternalNodeIPsByNodeNames added in v0.3.0

func (c *Controller) GetExternalNodeIPsByNodeNames(nodeNames []string) ([]string, error)

GetExternalNodeIPsByNodeNames returns the public IPs of the nodes given by the provided list of node names.

func (*Controller) GetIngresses

func (c *Controller) GetIngresses() ([]extensions.Ingress, error)

GetIngresses returns a slice of all Ingress objects that are annotated with this controller's annotation identifier.

func (*Controller) GetNodeIPs

func (c *Controller) GetNodeIPs() ([]string, error)

GetNodeIPs returns the public IPs of all nodes in the cluster.

func (*Controller) GetNodeNamesByPodLabelSelector added in v0.3.0

func (c *Controller) GetNodeNamesByPodLabelSelector(namespace string, selector labels.Selector) ([]string, error)

GetNodeNamesByPodLabelSelector returns the node names where a set of pods defined by a label selector are scheduled.

func (*Controller) UpdateDaemonSet

func (c *Controller) UpdateDaemonSet(daemonSet *extensions.DaemonSet, config *armor.Armor) (*extensions.DaemonSet, error)

UpdateDaemonSet updates the passed in DaemonSet. It updates the annotation in the DaemonSet as well as in the Pod template spec with the hash of the passed in config. This won't update any pods immediately but newly created pods will correspond to the new template spec.

TODO(linki): tests with different namespace don't fail ??

func (*Controller) UpdateDaemonSetByName

func (c *Controller) UpdateDaemonSetByName(namespace string, daemonSetName string, config *armor.Armor) (*extensions.DaemonSet, error)

UpdateDaemonSetByName updates a DaemonSet identified by namespace and name.

func (*Controller) UpdateDeployment

func (c *Controller) UpdateDeployment(deployment *extensions.Deployment, config *armor.Armor) error

UpdateDeployment updates the passed in Deployment. It updates the annotation in the Deployment as well as in the Pod template spec with the hash of the passed in config so that the deployment controller will update the pods.

TODO(linki): tests with different namespace don't fail ??

func (*Controller) UpdateDeploymentByName

func (c *Controller) UpdateDeploymentByName(namespace string, deploymentName string, config *armor.Armor) error

UpdateDeploymentByName updates a Deployment identified by namespace and name.

func (*Controller) UpdateIngressLoadBalancers

func (c *Controller) UpdateIngressLoadBalancers(ingresses []extensions.Ingress, IPs ...string) error

UpdateIngressLoadBalancers takes a slice of Ingress objects and updates the Status.LoadBalancer section with the given IPs.

func (*Controller) WriteConfigToConfigMap

func (c *Controller) WriteConfigToConfigMap(config *armor.Armor, configMap *v1.ConfigMap, key string) error

WriteConfigToConfigMap updates a passed in ConfigMap and stores the JSON representation of the passed in Armor config under the provided key. It also annotates the ConfigMap with the hash of its content.

func (*Controller) WriteConfigToConfigMapByName

func (c *Controller) WriteConfigToConfigMapByName(config *armor.Armor, namespace, configMapName, key string) error

WriteConfigToConfigMapByName updates a ConfigMap identified by namespace and name and stores the JSON representation of the passed in Armor config under the provided key.

func (*Controller) WriteConfigToWriter

func (c *Controller) WriteConfigToWriter(config *armor.Armor, writer io.Writer) error

WriteConfigToWriter writes the YAML representation of an Armor config to a Writer.

Jump to

Keyboard shortcuts

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