istio: istio.io/istio/pilot/pkg/serviceregistry/consul Index | Files

package consul

import "istio.io/istio/pilot/pkg/serviceregistry/consul"

Index

Package Files

controller.go conversion.go monitor.go

type Controller Uses

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

Controller communicates with Consul and monitors for changes

func NewController Uses

func NewController(addr string) (*Controller, error)

NewController creates a new Consul controller

func (*Controller) AppendInstanceHandler Uses

func (c *Controller) AppendInstanceHandler(f func(*model.ServiceInstance, model.Event)) error

AppendInstanceHandler implements a service catalog operation

func (*Controller) AppendServiceHandler Uses

func (c *Controller) AppendServiceHandler(f func(*model.Service, model.Event)) error

AppendServiceHandler implements a service catalog operation

func (*Controller) GetIstioServiceAccounts Uses

func (c *Controller) GetIstioServiceAccounts(svc *model.Service, ports []int) []string

GetIstioServiceAccounts implements model.ServiceAccounts operation TODO

func (*Controller) GetProxyServiceInstances Uses

func (c *Controller) GetProxyServiceInstances(node *model.Proxy) ([]*model.ServiceInstance, error)

GetProxyServiceInstances lists service instances co-located with a given proxy

func (*Controller) GetProxyWorkloadLabels Uses

func (c *Controller) GetProxyWorkloadLabels(proxy *model.Proxy) (labels.Collection, error)

func (*Controller) GetService Uses

func (c *Controller) GetService(hostname host.Name) (*model.Service, error)

GetService retrieves a service by host name if it exists

func (*Controller) InstanceChanged Uses

func (c *Controller) InstanceChanged(instance *api.CatalogService, event model.Event) error

func (*Controller) InstancesByPort Uses

func (c *Controller) InstancesByPort(svc *model.Service, port int,
    labels labels.Collection) ([]*model.ServiceInstance, error)

InstancesByPort retrieves instances for a service that match any of the supplied labels. All instances match an empty tag list.

func (*Controller) ManagementPorts Uses

func (c *Controller) ManagementPorts(addr string) model.PortList

ManagementPorts retrieves set of health check ports by instance IP. This does not apply to Consul service registry, as Consul does not manage the service instances. In future, when we integrate Nomad, we might revisit this function.

func (*Controller) Run Uses

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

Run all controllers until a signal is received

func (*Controller) ServiceChanged Uses

func (c *Controller) ServiceChanged(instances []*api.CatalogService, event model.Event) error

func (*Controller) Services Uses

func (c *Controller) Services() ([]*model.Service, error)

Services list declarations of all services in the system

func (*Controller) WorkloadHealthCheckInfo Uses

func (c *Controller) WorkloadHealthCheckInfo(addr string) model.ProbeList

WorkloadHealthCheckInfo retrieves set of health check info by instance IP. This does not apply to Consul service registry, as Consul does not manage the service instances. In future, when we integrate Nomad, we might revisit this function.

type InstanceHandler Uses

type InstanceHandler func(instance *api.CatalogService, event model.Event) error

InstanceHandler processes service instance change events

type Monitor Uses

type Monitor interface {
    Start(<-chan struct{})
    AppendServiceHandler(ServiceHandler)
    AppendInstanceHandler(InstanceHandler)
}

Monitor handles service and instance changes

func NewConsulMonitor Uses

func NewConsulMonitor(client *api.Client) Monitor

NewConsulMonitor watches for changes in Consul services and CatalogServices

type ServiceHandler Uses

type ServiceHandler func(instances []*api.CatalogService, event model.Event) error

ServiceHandler processes service change events

Package consul imports 12 packages (graph) and is imported by 2 packages. Updated 2019-10-17. Refresh now. Tools for package owners.