containers

package
v3.0.10+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2019 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartNNodeEtcdTopology

func StartNNodeEtcdTopology(n int) (felixes []*Container, etcd *Container, client client.Interface)

StartNNodeEtcdTopology starts an etcd container and a set of Felix hosts. If n > 1, sets up IPIP, otherwise this is skipped.

  • Configures an IPAM pool for 10.65.0.0/16 (so that Felix programs the all-IPAM blocks IP set) but (for simplicity) we don't actually use IPAM to assign IPs.
  • Configures routes between the hosts, giving each host 10.65.x.0/24, where x is the index in the returned array. When creating workloads, use IPs from the relevant block.
  • Configures the Tunnel IP for each host as 10.65.x.1.

func StartTwoNodeEtcdTopology

func StartTwoNodeEtcdTopology() (felixes []*Container, etcd *Container, client client.Interface)

StartTwoNodeEtcdTopology starts an etcd container and a pair of Felix hosts connected with IPIP.

  • Configures an IPAM pool for 10.65.0.0/16 (so that Felix programs the all-IPAM blocks IP set) but (for simplicity) we don't actually use IPAM to assign IPs.
  • Configures routes between the two "hosts", giving each host 10.65.x.0/24, where x is the index in the returned array. When creating workloads, use IPs from the relevant block.
  • Configures the Tunnel IP as 10.65.x.1

Types

type Container

type Container struct {
	Name     string
	IP       string
	Hostname string
	// contains filtered or unexported fields
}

func Run

func Run(namePrefix string, opts RunOpts, args ...string) (c *Container)

func RunEtcd

func RunEtcd() *Container

func RunFelix

func RunFelix(etcdIP string) *Container

func StartSingleNodeEtcdTopology

func StartSingleNodeEtcdTopology() (felix, etcd *Container, calicoClient client.Interface)

StartSingleNodeEtcdTopology starts an etcd container and a single Felix container; it initialises the datastore and installs a Node resource for the Felix node.

func (*Container) CanConnectTo

func (c *Container) CanConnectTo(ip, port, protocol string) bool

func (*Container) CopyFileIntoContainer

func (c *Container) CopyFileIntoContainer(hostPath, containerPath string) error

func (*Container) DockerInspect

func (c *Container) DockerInspect(format string) string

func (*Container) EnsureBinary

func (c *Container) EnsureBinary(name string)

func (*Container) Exec

func (c *Container) Exec(cmd ...string)

func (*Container) ExecMayFail

func (c *Container) ExecMayFail(cmd ...string) error

func (*Container) ExecOutput

func (c *Container) ExecOutput(args ...string) (string, error)

func (*Container) GetHostname

func (c *Container) GetHostname() string

func (*Container) GetIP

func (c *Container) GetIP() string

func (*Container) GetPIDs

func (c *Container) GetPIDs(processName string) []int

func (*Container) ListedInDockerPS

func (c *Container) ListedInDockerPS() bool

func (*Container) Remove

func (c *Container) Remove()

Remove deletes a container. Should be manually called after a non-auto-removed container is stopped.

func (*Container) SourceName

func (c *Container) SourceName() string

func (*Container) Start

func (c *Container) Start()

Start executes "docker start" on a container. Useful when used after Stop() to restart a container.

func (*Container) Stop

func (c *Container) Stop()

func (*Container) Stopped

func (c *Container) Stopped() bool

func (*Container) WaitNotRunning

func (c *Container) WaitNotRunning(timeout time.Duration)

func (*Container) WaitUntilRunning

func (c *Container) WaitUntilRunning()

type RunOpts

type RunOpts struct {
	AutoRemove bool
}

Jump to

Keyboard shortcuts

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