package etcd

import "k8s.io/kubernetes/pkg/registry/service/ipallocator/etcd"

Index

Types

type Etcd

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

Etcd exposes a service.Allocator that is backed by etcd. TODO: allow multiple allocations to be tried at once TODO: subdivide the keyspace to reduce conflicts TODO: investigate issuing a CAS without reading first

func NewEtcd

func NewEtcd(alloc ipallocator.Snapshottable, helper tools.EtcdHelper) *Etcd

NewEtcd returns a service PortalIP ipallocator that is backed by Etcd and can manage persisting the snapshot state of allocation after each allocation is made.

func (*Etcd) Allocate

func (e *Etcd) Allocate(ip net.IP) error

Allocate attempts to allocate the IP locally and then in etcd.

func (*Etcd) AllocateNext

func (e *Etcd) AllocateNext() (net.IP, error)

AllocateNext attempts to allocate the next IP locally and then in etcd.

func (*Etcd) CreateOrUpdate

func (e *Etcd) CreateOrUpdate(snapshot *api.RangeAllocation) error

CreateOrUpdate attempts to update the current etcd state with the provided allocation.

func (*Etcd) Get

func (e *Etcd) Get() (*api.RangeAllocation, error)

Get returns an api.RangeAllocation that represents the current state in etcd. If the key does not exist, the object will have an empty ResourceVersion.

func (*Etcd) Refresh

func (e *Etcd) Refresh() error

Refresh reloads the ipallocator from etcd.

func (*Etcd) Release

func (e *Etcd) Release(ip net.IP) error

Release attempts to release the provided IP locally and then in etcd.

Source Files

etcd.go

Version
v0.17.1
Published
May 21, 2015
Platform
js/wasm
Imports
10 packages
Last checked
23 seconds ago

Tools for package owners.