kubernetes: github.com/xiewenhui/kubernetes/pkg/registry Index | Files

package registry

import "github.com/xiewenhui/kubernetes/pkg/registry"

Package registry implements the storage and system logic for the core of the api server.

Index

Package Files

caching_minion_registry.go cloud_minion_registry.go controllerstorage.go doc.go endpoints.go etcdregistry.go healthy_minion_registry.go interfaces.go manifest_factory.go memory_registry.go minionregistry.go minionstorage.go mock_registry.go mock_service_registry.go podstorage.go servicestorage.go

Variables

var ErrDoesNotExist = fmt.Errorf("The requested resource does not exist.")

func GetServiceEnvironmentVariables Uses

func GetServiceEnvironmentVariables(registry ServiceRegistry, machine string) ([]api.EnvVar, error)

GetServiceEnvironmentVariables populates a list of environment variables that are use in the container environment to get access to services.

func MakeMinionRegistryStorage Uses

func MakeMinionRegistryStorage(m MinionRegistry) apiserver.RESTStorage

func MakePodRegistryStorage Uses

func MakePodRegistryStorage(registry PodRegistry,
    podInfoGetter client.PodInfoGetter,
    scheduler scheduler.Scheduler,
    minionLister scheduler.MinionLister,
    cloud cloudprovider.Interface,
    podCache client.PodInfoGetter) apiserver.RESTStorage

MakePodRegistryStorage makes a RESTStorage object for a pod registry. Parameters:

registry:      The pod registry
podInfoGetter: Source of fresh container info
scheduler:     The scheduler for assigning pods to machines
minionLister:  Object which can list available minions for the scheduler
cloud:         Interface to a cloud provider (may be null)
podCache:      Source of cached container info

func MakeServiceRegistryStorage Uses

func MakeServiceRegistryStorage(registry ServiceRegistry, cloud cloudprovider.Interface, machines MinionRegistry) apiserver.RESTStorage

MakeServiceRegistryStorage makes a new ServiceRegistryStorage.

func NewControllerRegistryStorage Uses

func NewControllerRegistryStorage(registry ControllerRegistry, podRegistry PodRegistry) apiserver.RESTStorage

type BasicManifestFactory Uses

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

func (*BasicManifestFactory) MakeManifest Uses

func (b *BasicManifestFactory) MakeManifest(machine string, pod api.Pod) (api.ContainerManifest, error)

type CachingMinionRegistry Uses

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

func (*CachingMinionRegistry) Contains Uses

func (c *CachingMinionRegistry) Contains(minion string) (bool, error)

func (*CachingMinionRegistry) Delete Uses

func (c *CachingMinionRegistry) Delete(minion string) error

func (*CachingMinionRegistry) Insert Uses

func (c *CachingMinionRegistry) Insert(minion string) error

func (*CachingMinionRegistry) List Uses

func (c *CachingMinionRegistry) List() ([]string, error)

type Clock Uses

type Clock interface {
    Now() time.Time
}

type CloudMinionRegistry Uses

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

func MakeCloudMinionRegistry Uses

func MakeCloudMinionRegistry(cloud cloudprovider.Interface, matchRE string) (*CloudMinionRegistry, error)

func (*CloudMinionRegistry) Contains Uses

func (c *CloudMinionRegistry) Contains(minion string) (bool, error)

func (*CloudMinionRegistry) Delete Uses

func (c *CloudMinionRegistry) Delete(minion string) error

func (*CloudMinionRegistry) Insert Uses

func (c *CloudMinionRegistry) Insert(minion string) error

func (*CloudMinionRegistry) List Uses

func (c *CloudMinionRegistry) List() ([]string, error)

type ControllerRegistry Uses

type ControllerRegistry interface {
    ListControllers() ([]api.ReplicationController, error)
    WatchControllers() (watch.Interface, error)
    GetController(controllerID string) (*api.ReplicationController, error)
    CreateController(controller api.ReplicationController) error
    UpdateController(controller api.ReplicationController) error
    DeleteController(controllerID string) error
}

ControllerRegistry is an interface for things that know how to store ReplicationControllers.

type ControllerRegistryStorage Uses

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

ControllerRegistryStorage is an implementation of RESTStorage for the api server.

func (*ControllerRegistryStorage) Create Uses

func (storage *ControllerRegistryStorage) Create(obj interface{}) (<-chan interface{}, error)

Create registers a given new ReplicationController instance to storage.registry.

func (*ControllerRegistryStorage) Delete Uses

func (storage *ControllerRegistryStorage) Delete(id string) (<-chan interface{}, error)

Delete asynchronously deletes the ReplicationController specified by its id.

func (*ControllerRegistryStorage) Extract Uses

func (storage *ControllerRegistryStorage) Extract(body []byte) (interface{}, error)

Extract deserializes user provided data into an api.ReplicationController.

func (*ControllerRegistryStorage) Get Uses

func (storage *ControllerRegistryStorage) Get(id string) (interface{}, error)

Get obtains the ReplicationController specified by its id.

func (*ControllerRegistryStorage) List Uses

func (storage *ControllerRegistryStorage) List(selector labels.Selector) (interface{}, error)

List obtains a list of ReplicationControllers that match selector.

func (*ControllerRegistryStorage) Update Uses

func (storage *ControllerRegistryStorage) Update(obj interface{}) (<-chan interface{}, error)

Update replaces a given ReplicationController instance with an existing instance in storage.registry.

func (*ControllerRegistryStorage) WatchAll Uses

func (storage *ControllerRegistryStorage) WatchAll() (watch.Interface, error)

WatchAll returns ReplicationController events via a watch.Interface, implementing apiserver.ResourceWatcher.

func (*ControllerRegistryStorage) WatchSingle Uses

func (storage *ControllerRegistryStorage) WatchSingle(id string) (watch.Interface, error)

WatchSingle returns events for a single ReplicationController via a watch.Interface, implementing apiserver.ResourceWatcher.

type EndpointController Uses

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

func MakeEndpointController Uses

func MakeEndpointController(serviceRegistry ServiceRegistry, client *client.Client) *EndpointController

func (*EndpointController) SyncServiceEndpoints Uses

func (e *EndpointController) SyncServiceEndpoints() error

type EtcdRegistry Uses

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

EtcdRegistry implements PodRegistry, ControllerRegistry and ServiceRegistry with backed by etcd.

func MakeEtcdRegistry Uses

func MakeEtcdRegistry(client tools.EtcdClient, machines MinionRegistry) *EtcdRegistry

MakeEtcdRegistry creates an etcd registry. 'client' is the connection to etcd 'machines' is the list of machines 'scheduler' is the scheduling algorithm to use.

func (*EtcdRegistry) CreateController Uses

func (registry *EtcdRegistry) CreateController(controller api.ReplicationController) error

CreateController creates a new ReplicationController.

func (*EtcdRegistry) CreatePod Uses

func (registry *EtcdRegistry) CreatePod(machineIn string, pod api.Pod) error

CreatePod creates a pod based on a specification, schedule it onto a specific machine.

func (*EtcdRegistry) CreateService Uses

func (registry *EtcdRegistry) CreateService(svc api.Service) error

CreateService creates a new Service.

func (*EtcdRegistry) DeleteController Uses

func (registry *EtcdRegistry) DeleteController(controllerID string) error

DeleteController deletes a ReplicationController specified by its ID.

func (*EtcdRegistry) DeletePod Uses

func (registry *EtcdRegistry) DeletePod(podID string) error

DeletePod deletes an existing pod specified by its ID.

func (*EtcdRegistry) DeleteService Uses

func (registry *EtcdRegistry) DeleteService(name string) error

DeleteService deletes a Service specified by its name.

func (*EtcdRegistry) GetController Uses

func (registry *EtcdRegistry) GetController(controllerID string) (*api.ReplicationController, error)

GetController gets a specific ReplicationController specified by its ID.

func (*EtcdRegistry) GetPod Uses

func (registry *EtcdRegistry) GetPod(podID string) (*api.Pod, error)

GetPod gets a specific pod specified by its ID.

func (*EtcdRegistry) GetService Uses

func (registry *EtcdRegistry) GetService(name string) (*api.Service, error)

GetService obtains a Service specified by its name.

func (*EtcdRegistry) ListControllers Uses

func (registry *EtcdRegistry) ListControllers() ([]api.ReplicationController, error)

ListControllers obtains a list of ReplicationControllers.

func (*EtcdRegistry) ListPods Uses

func (registry *EtcdRegistry) ListPods(selector labels.Selector) ([]api.Pod, error)

ListPods obtains a list of pods that match selector.

func (*EtcdRegistry) ListServices Uses

func (registry *EtcdRegistry) ListServices() (api.ServiceList, error)

ListServices obtains a list of Services.

func (*EtcdRegistry) UpdateController Uses

func (registry *EtcdRegistry) UpdateController(controller api.ReplicationController) error

UpdateController replaces an existing ReplicationController.

func (*EtcdRegistry) UpdateEndpoints Uses

func (registry *EtcdRegistry) UpdateEndpoints(e api.Endpoints) error

UpdateEndpoints update Endpoints of a Service.

func (*EtcdRegistry) UpdatePod Uses

func (registry *EtcdRegistry) UpdatePod(pod api.Pod) error

func (*EtcdRegistry) UpdateService Uses

func (registry *EtcdRegistry) UpdateService(svc api.Service) error

UpdateService replaces an existing Service.

func (*EtcdRegistry) WatchControllers Uses

func (registry *EtcdRegistry) WatchControllers() (watch.Interface, error)

WatchControllers begins watching for new, changed, or deleted controllers. TODO: Add id/selector parameters?

type HealthyMinionRegistry Uses

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

func (*HealthyMinionRegistry) Contains Uses

func (h *HealthyMinionRegistry) Contains(minion string) (bool, error)

func (*HealthyMinionRegistry) Delete Uses

func (h *HealthyMinionRegistry) Delete(minion string) error

func (*HealthyMinionRegistry) Insert Uses

func (h *HealthyMinionRegistry) Insert(minion string) error

func (*HealthyMinionRegistry) List Uses

func (h *HealthyMinionRegistry) List() (currentMinions []string, err error)

type ManifestFactory Uses

type ManifestFactory interface {
    // Make a container object for a given pod, given the machine that the pod is running on.
    MakeManifest(machine string, pod api.Pod) (api.ContainerManifest, error)
}

type MemoryRegistry Uses

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

An implementation of PodRegistry and ControllerRegistry that is backed by memory Mainly used for testing.

func MakeMemoryRegistry Uses

func MakeMemoryRegistry() *MemoryRegistry

func (*MemoryRegistry) CreateController Uses

func (registry *MemoryRegistry) CreateController(controller api.ReplicationController) error

func (*MemoryRegistry) CreatePod Uses

func (registry *MemoryRegistry) CreatePod(machine string, pod api.Pod) error

func (*MemoryRegistry) CreateService Uses

func (registry *MemoryRegistry) CreateService(svc api.Service) error

func (*MemoryRegistry) DeleteController Uses

func (registry *MemoryRegistry) DeleteController(controllerID string) error

func (*MemoryRegistry) DeletePod Uses

func (registry *MemoryRegistry) DeletePod(podID string) error

func (*MemoryRegistry) DeleteService Uses

func (registry *MemoryRegistry) DeleteService(name string) error

func (*MemoryRegistry) GetController Uses

func (registry *MemoryRegistry) GetController(controllerID string) (*api.ReplicationController, error)

func (*MemoryRegistry) GetPod Uses

func (registry *MemoryRegistry) GetPod(podID string) (*api.Pod, error)

func (*MemoryRegistry) GetService Uses

func (registry *MemoryRegistry) GetService(name string) (*api.Service, error)

func (*MemoryRegistry) ListControllers Uses

func (registry *MemoryRegistry) ListControllers() ([]api.ReplicationController, error)

func (*MemoryRegistry) ListPods Uses

func (registry *MemoryRegistry) ListPods(selector labels.Selector) ([]api.Pod, error)

func (*MemoryRegistry) ListServices Uses

func (registry *MemoryRegistry) ListServices() (api.ServiceList, error)

func (*MemoryRegistry) UpdateController Uses

func (registry *MemoryRegistry) UpdateController(controller api.ReplicationController) error

func (*MemoryRegistry) UpdateEndpoints Uses

func (registry *MemoryRegistry) UpdateEndpoints(e api.Endpoints) error

func (*MemoryRegistry) UpdatePod Uses

func (registry *MemoryRegistry) UpdatePod(pod api.Pod) error

func (*MemoryRegistry) UpdateService Uses

func (registry *MemoryRegistry) UpdateService(svc api.Service) error

func (*MemoryRegistry) WatchControllers Uses

func (registry *MemoryRegistry) WatchControllers() (watch.Interface, error)

type MinionRegistry Uses

type MinionRegistry interface {
    List() (currentMinions []string, err error)
    Insert(minion string) error
    Delete(minion string) error
    Contains(minion string) (bool, error)
}

Keep track of a set of minions. Safe for concurrent reading/writing.

func MakeMinionRegistry Uses

func MakeMinionRegistry(minions []string) MinionRegistry

Initialize a minion registry with a list of minions.

func NewCachingMinionRegistry Uses

func NewCachingMinionRegistry(delegate MinionRegistry, ttl time.Duration) (MinionRegistry, error)

func NewHealthyMinionRegistry Uses

func NewHealthyMinionRegistry(delegate MinionRegistry, client *http.Client) MinionRegistry

type MinionRegistryStorage Uses

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

MinionRegistryStorage implements the RESTStorage interface, backed by a MinionRegistry.

func (*MinionRegistryStorage) Create Uses

func (storage *MinionRegistryStorage) Create(obj interface{}) (<-chan interface{}, error)

func (*MinionRegistryStorage) Delete Uses

func (storage *MinionRegistryStorage) Delete(id string) (<-chan interface{}, error)

func (*MinionRegistryStorage) Extract Uses

func (storage *MinionRegistryStorage) Extract(body []byte) (interface{}, error)

func (*MinionRegistryStorage) Get Uses

func (storage *MinionRegistryStorage) Get(id string) (interface{}, error)

func (*MinionRegistryStorage) List Uses

func (storage *MinionRegistryStorage) List(selector labels.Selector) (interface{}, error)

func (*MinionRegistryStorage) Update Uses

func (storage *MinionRegistryStorage) Update(minion interface{}) (<-chan interface{}, error)

type MockMinionRegistry Uses

type MockMinionRegistry struct {
    sync.Mutex
    // contains filtered or unexported fields
}

func MakeMockMinionRegistry Uses

func MakeMockMinionRegistry(minions []string) *MockMinionRegistry

func (*MockMinionRegistry) Contains Uses

func (registry *MockMinionRegistry) Contains(minion string) (bool, error)

func (*MockMinionRegistry) Delete Uses

func (registry *MockMinionRegistry) Delete(minion string) error

func (*MockMinionRegistry) Insert Uses

func (registry *MockMinionRegistry) Insert(minion string) error

func (*MockMinionRegistry) List Uses

func (registry *MockMinionRegistry) List() ([]string, error)

type MockPodRegistry Uses

type MockPodRegistry struct {
    sync.Mutex
    // contains filtered or unexported fields
}

func MakeMockPodRegistry Uses

func MakeMockPodRegistry(pods []api.Pod) *MockPodRegistry

func (*MockPodRegistry) CreatePod Uses

func (registry *MockPodRegistry) CreatePod(machine string, pod api.Pod) error

func (*MockPodRegistry) DeletePod Uses

func (registry *MockPodRegistry) DeletePod(podId string) error

func (*MockPodRegistry) GetPod Uses

func (registry *MockPodRegistry) GetPod(podId string) (*api.Pod, error)

func (*MockPodRegistry) ListPods Uses

func (registry *MockPodRegistry) ListPods(selector labels.Selector) ([]api.Pod, error)

func (*MockPodRegistry) UpdatePod Uses

func (registry *MockPodRegistry) UpdatePod(pod api.Pod) error

type MockServiceRegistry Uses

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

func (*MockServiceRegistry) CreateService Uses

func (m *MockServiceRegistry) CreateService(svc api.Service) error

func (*MockServiceRegistry) DeleteService Uses

func (m *MockServiceRegistry) DeleteService(name string) error

func (*MockServiceRegistry) GetService Uses

func (m *MockServiceRegistry) GetService(name string) (*api.Service, error)

func (*MockServiceRegistry) ListServices Uses

func (m *MockServiceRegistry) ListServices() (api.ServiceList, error)

func (*MockServiceRegistry) UpdateEndpoints Uses

func (m *MockServiceRegistry) UpdateEndpoints(e api.Endpoints) error

func (*MockServiceRegistry) UpdateService Uses

func (m *MockServiceRegistry) UpdateService(svc api.Service) error

type PodRegistry Uses

type PodRegistry interface {
    // ListPods obtains a list of pods that match selector.
    ListPods(selector labels.Selector) ([]api.Pod, error)
    // Get a specific pod
    GetPod(podID string) (*api.Pod, error)
    // Create a pod based on a specification, schedule it onto a specific machine.
    CreatePod(machine string, pod api.Pod) error
    // Update an existing pod
    UpdatePod(pod api.Pod) error
    // Delete an existing pod
    DeletePod(podID string) error
}

PodRegistry is an interface implemented by things that know how to store Pod objects.

type PodRegistryStorage Uses

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

PodRegistryStorage implements the RESTStorage interface in terms of a PodRegistry

func (*PodRegistryStorage) Create Uses

func (storage *PodRegistryStorage) Create(obj interface{}) (<-chan interface{}, error)

func (*PodRegistryStorage) Delete Uses

func (storage *PodRegistryStorage) Delete(id string) (<-chan interface{}, error)

func (*PodRegistryStorage) Extract Uses

func (storage *PodRegistryStorage) Extract(body []byte) (interface{}, error)

func (*PodRegistryStorage) Get Uses

func (storage *PodRegistryStorage) Get(id string) (interface{}, error)

func (*PodRegistryStorage) List Uses

func (storage *PodRegistryStorage) List(selector labels.Selector) (interface{}, error)

func (*PodRegistryStorage) Update Uses

func (storage *PodRegistryStorage) Update(obj interface{}) (<-chan interface{}, error)

type ServiceRegistry Uses

type ServiceRegistry interface {
    ListServices() (api.ServiceList, error)
    CreateService(svc api.Service) error
    GetService(name string) (*api.Service, error)
    DeleteService(name string) error
    UpdateService(svc api.Service) error
    UpdateEndpoints(e api.Endpoints) error
}

ServiceRegistry is an interface for things that know how to store services.

type ServiceRegistryStorage Uses

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

ServiceRegistryStorage adapts a service registry into apiserver's RESTStorage model.

func (*ServiceRegistryStorage) Create Uses

func (sr *ServiceRegistryStorage) Create(obj interface{}) (<-chan interface{}, error)

func (*ServiceRegistryStorage) Delete Uses

func (sr *ServiceRegistryStorage) Delete(id string) (<-chan interface{}, error)

func (*ServiceRegistryStorage) Extract Uses

func (sr *ServiceRegistryStorage) Extract(body []byte) (interface{}, error)

func (*ServiceRegistryStorage) Get Uses

func (sr *ServiceRegistryStorage) Get(id string) (interface{}, error)

func (*ServiceRegistryStorage) List Uses

func (sr *ServiceRegistryStorage) List(selector labels.Selector) (interface{}, error)

func (*ServiceRegistryStorage) Update Uses

func (sr *ServiceRegistryStorage) Update(obj interface{}) (<-chan interface{}, error)

type SystemClock Uses

type SystemClock struct{}

func (SystemClock) Now Uses

func (SystemClock) Now() time.Time

Package registry imports 22 packages (graph). Updated 2017-12-01. Refresh now. Tools for package owners.