source

package
v0.0.0-...-68a8344 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2020 License: Apache-2.0 Imports: 54 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ALBDualstackAnnotationKey is the annotation used for determining if an ALB ingress is dualstack
	ALBDualstackAnnotationKey = "alb.ingress.kubernetes.io/ip-address-type"
	// ALBDualstackAnnotationValue is the value of the ALB dualstack annotation that indicates it is dualstack
	ALBDualstackAnnotationValue = "dualstack"
)
View Source
const (
	// The annotation used for determining if traffic will go through Cloudflare
	CloudflareProxiedKey = "external-dns.alpha.kubernetes.io/cloudflare-proxied"

	SetIdentifierKey = "external-dns.alpha.kubernetes.io/set-identifier"
)

Provider-specific annotations

View Source
const (

	// DefaultRoutegroupVersion is the default version for route groups.
	DefaultRoutegroupVersion = "zalando.org/v1"
)
View Source
const IstioMeshGateway = "mesh"

IstioMeshGateway is the built in gateway for all sidecars

Variables

View Source
var ErrSourceNotFound = errors.New("source not found")

ErrSourceNotFound is returned when a requested source doesn't exist.

Functions

func GetRestConfig

func GetRestConfig(kubeConfig, apiServerURL string) (*rest.Config, error)

GetRestConfig returns the rest clients config to get automatically data if you run inside a cluster or by passing flags.

func NewCFClient

func NewCFClient(cfAPIEndpoint string, cfUsername string, cfPassword string) (*cfclient.Client, error)

NewCFClient return a new CF client object.

func NewCRDClientForAPIVersionKind

func NewCRDClientForAPIVersionKind(client kubernetes.Interface, kubeConfig, apiServerURL, apiVersion, kind string) (*rest.RESTClient, *runtime.Scheme, error)

NewCRDClientForAPIVersionKind return rest client for the given apiVersion and kind of the CRD

func NewDynamicKubernetesClient

func NewDynamicKubernetesClient(kubeConfig, apiServerURL string, requestTimeout time.Duration) (dynamic.Interface, error)

NewDynamicKubernetesClient returns a new Dynamic Kubernetes client object. It takes a Config and uses APIServerURL and KubeConfig attributes to connect to the cluster. If KubeConfig isn't provided it defaults to using the recommended default.

func NewIstioClient

func NewIstioClient(kubeConfig string, apiServerURL string) (*istioclient.Clientset, error)

NewIstioClient returns a new Istio client object. It uses the configured KubeConfig attribute to connect to the cluster. If KubeConfig isn't provided it defaults to using the recommended default. NB: Istio controls the creation of the underlying Kubernetes client, so we have no ability to tack on transport wrappers (e.g., Prometheus request wrappers) to the client's config at this level. Furthermore, the Istio client constructor does not expose the ability to override the Kubernetes API server endpoint, so the apiServerURL config attribute has no effect.

func NewKubeClient

func NewKubeClient(kubeConfig, apiServerURL string, requestTimeout time.Duration) (*kubernetes.Clientset, error)

NewKubeClient returns a new Kubernetes client object. It takes a Config and uses APIServerURL and KubeConfig attributes to connect to the cluster. If KubeConfig isn't provided it defaults to using the recommended default.

func NewOpenShiftClient

func NewOpenShiftClient(kubeConfig, apiServerURL string, requestTimeout time.Duration) (*openshift.Clientset, error)

NewOpenShiftClient returns a new Openshift client object. It takes a Config and uses APIServerURL and KubeConfig attributes to connect to the cluster. If KubeConfig isn't provided it defaults to using the recommended default.

Types

type ClientGenerator

type ClientGenerator interface {
	KubeClient() (kubernetes.Interface, error)
	IstioClient() (istioclient.Interface, error)
	CloudFoundryClient(cfAPPEndpoint string, cfUsername string, cfPassword string) (*cfclient.Client, error)
	DynamicKubernetesClient() (dynamic.Interface, error)
	OpenShiftClient() (openshift.Interface, error)
}

ClientGenerator provides clients

type Config

type Config struct {
	Namespace                      string
	AnnotationFilter               string
	FQDNTemplate                   string
	CombineFQDNAndAnnotation       bool
	IgnoreHostnameAnnotation       bool
	Compatibility                  string
	PublishInternal                bool
	PublishHostIP                  bool
	AlwaysPublishNotReadyAddresses bool
	ConnectorServer                string
	CRDSourceAPIVersion            string
	CRDSourceKind                  string
	KubeConfig                     string
	APIServerURL                   string
	ServiceTypeFilter              []string
	CFAPIEndpoint                  string
	CFUsername                     string
	CFPassword                     string
	ContourLoadBalancerService     string
	SkipperRouteGroupVersion       string
	RequestTimeout                 time.Duration
}

Config holds shared configuration options for all Sources.

type SingletonClientGenerator

type SingletonClientGenerator struct {
	KubeConfig     string
	APIServerURL   string
	RequestTimeout time.Duration
	// contains filtered or unexported fields
}

SingletonClientGenerator stores provider clients and guarantees that only one instance of client will be generated

func (*SingletonClientGenerator) CloudFoundryClient

func (p *SingletonClientGenerator) CloudFoundryClient(cfAPIEndpoint string, cfUsername string, cfPassword string) (*cfclient.Client, error)

CloudFoundryClient generates a cf client if it was not created before

func (*SingletonClientGenerator) DynamicKubernetesClient

func (p *SingletonClientGenerator) DynamicKubernetesClient() (dynamic.Interface, error)

DynamicKubernetesClient generates a contour client if it was not created before

func (*SingletonClientGenerator) IstioClient

IstioClient generates an istio go client if it was not created before

func (*SingletonClientGenerator) KubeClient

KubeClient generates a kube client if it was not created before

func (*SingletonClientGenerator) OpenShiftClient

func (p *SingletonClientGenerator) OpenShiftClient() (openshift.Interface, error)

OpenShiftClient generates an openshift client if it was not created before

type Source

type Source interface {
	Endpoints(ctx context.Context) ([]*endpoint.Endpoint, error)
	// AddEventHandler adds an event handler that should be triggered if something in source changes
	AddEventHandler(context.Context, func())
}

Source defines the interface Endpoint sources should implement.

func BuildWithConfig

func BuildWithConfig(source string, p ClientGenerator, cfg *Config) (Source, error)

BuildWithConfig allows to generate a Source implementation from the shared config

func ByNames

func ByNames(p ClientGenerator, names []string, cfg *Config) ([]Source, error)

ByNames returns multiple Sources given multiple names.

func NewCRDSource

func NewCRDSource(crdClient rest.Interface, namespace, kind string, annotationFilter string, scheme *runtime.Scheme) (Source, error)

NewCRDSource creates a new crdSource with the given config.

func NewCloudFoundrySource

func NewCloudFoundrySource(cfClient *cfclient.Client) (Source, error)

NewCloudFoundrySource creates a new cloudfoundrySource with the given config

func NewConnectorSource

func NewConnectorSource(remoteServer string) (Source, error)

NewConnectorSource creates a new connectorSource with the given config.

func NewContourIngressRouteSource

func NewContourIngressRouteSource(
	dynamicKubeClient dynamic.Interface,
	kubeClient kubernetes.Interface,
	contourLoadBalancerService string,
	namespace string,
	annotationFilter string,
	fqdnTemplate string,
	combineFqdnAnnotation bool,
	ignoreHostnameAnnotation bool,
) (Source, error)

NewContourIngressRouteSource creates a new contourIngressRouteSource with the given config.

func NewDedupSource

func NewDedupSource(source Source) Source

NewDedupSource creates a new dedupSource wrapping the provided Source.

func NewEmptySource

func NewEmptySource() Source

NewEmptySource creates a new emptySource.

func NewFakeSource

func NewFakeSource(fqdnTemplate string) (Source, error)

NewFakeSource creates a new fakeSource with the given config.

func NewIngressSource

func NewIngressSource(kubeClient kubernetes.Interface, namespace, annotationFilter string, fqdnTemplate string, combineFqdnAnnotation bool, ignoreHostnameAnnotation bool) (Source, error)

NewIngressSource creates a new ingressSource with the given config.

func NewIstioGatewaySource

func NewIstioGatewaySource(
	kubeClient kubernetes.Interface,
	istioClient istioclient.Interface,
	namespace string,
	annotationFilter string,
	fqdnTemplate string,
	combineFQDNAnnotation bool,
	ignoreHostnameAnnotation bool,
) (Source, error)

NewIstioGatewaySource creates a new gatewaySource with the given config.

func NewIstioVirtualServiceSource

func NewIstioVirtualServiceSource(
	kubeClient kubernetes.Interface,
	istioClient istioclient.Interface,
	namespace string,
	annotationFilter string,
	fqdnTemplate string,
	combineFQDNAnnotation bool,
	ignoreHostnameAnnotation bool,
) (Source, error)

NewIstioVirtualServiceSource creates a new virtualServiceSource with the given config.

func NewMultiSource

func NewMultiSource(children []Source) Source

NewMultiSource creates a new multiSource.

func NewNodeSource

func NewNodeSource(kubeClient kubernetes.Interface, annotationFilter, fqdnTemplate string) (Source, error)

NewNodeSource creates a new nodeSource with the given config.

func NewOcpRouteSource

func NewOcpRouteSource(
	ocpClient versioned.Interface,
	namespace string,
	annotationFilter string,
	fqdnTemplate string,
	combineFQDNAnnotation bool,
	ignoreHostnameAnnotation bool,
) (Source, error)

NewOcpRouteSource creates a new ocpRouteSource with the given config.

func NewRouteGroupSource

func NewRouteGroupSource(timeout time.Duration, token, tokenPath, apiServerURL, namespace, annotationFilter, fqdnTemplate, routegroupVersion string, combineFqdnAnnotation, ignoreHostnameAnnotation bool) (Source, error)

NewRouteGroupSource creates a new routeGroupSource with the given config.

func NewServiceSource

func NewServiceSource(kubeClient kubernetes.Interface, namespace, annotationFilter string, fqdnTemplate string, combineFqdnAnnotation bool, compatibility string, publishInternal bool, publishHostIP bool, alwaysPublishNotReadyAddresses bool, serviceTypeFilter []string, ignoreHostnameAnnotation bool) (Source, error)

NewServiceSource creates a new serviceSource with the given config.

type UnstructuredConverter

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

UnstructuredConverter handles conversions between unstructured.Unstructured and Contour types

func NewUnstructuredConverter

func NewUnstructuredConverter() (*UnstructuredConverter, error)

NewUnstructuredConverter returns a new UnstructuredConverter initialized

Jump to

Keyboard shortcuts

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