k8s

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertToConsulCheck

func ConvertToConsulCheck(probe *corev1.Probe, host string) *consul.Check

ConvertToConsulCheck converts Kubernetes probe definition to Consul check definition.

func Find added in v0.1.30

func Find(slice []string, val string) bool

Find takes a slice and looks for an element in it. If found it will return it's key, otherwise it will return -1 and a bool of false.

Types

type Client

type Client interface {
	// GetPod returns current pod data.
	GetPod(ctx context.Context, namespace, name string) (*corev1.Pod, error)
	// GetFailureDomainTags returns current failure domain for pod
	GetFailureDomainTags(ctx context.Context, pod *corev1.Pod) ([]string, error)
}

Client is an interface for client to Kubernetes API.

type ServiceProvider

type ServiceProvider struct {
	Client  Client
	Timeout time.Duration
}

ServiceProvider is responsible for providing services that should be registered in Consul discovery service.

func (*ServiceProvider) GenerateSecured added in v0.1.30

func (p *ServiceProvider) GenerateSecured(ctx context.Context, services []consul.ServiceInstance) []consul.ServiceInstance

GenerateSecured generates list of postfixed Consul services for deregistration

func (*ServiceProvider) Get

Get returns slice of services that are configured to be registered in Consul discovery service.

Jump to

Keyboard shortcuts

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