v1alpha1

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2018 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

+k8s:deepcopy-gen=package +groupName=networking.internal.knative.dev

Index

Constants

View Source
const (
	// DefaultTimeout will be set if timeout not specified.
	DefaultTimeout = 60 * time.Second
	// DefaultRetryCount will be set if Attempts not specified.
	DefaultRetryCount = 3
)
View Source
const (
	// ClusterIngressConditionReady is set when the clusterIngress networking setting is
	// configured and it has a load balancer address.
	ClusterIngressConditionReady = duckv1alpha1.ConditionReady

	// ClusterIngressConditionNetworkConfigured is set when the ClusterIngress's underlying
	// network programming has been configured.  This doesn't include conditions of the
	// backends, so even if this should remain true when network is configured and backends
	// are not ready.
	ClusterIngressConditionNetworkConfigured duckv1alpha1.ConditionType = "NetworkConfigured"

	// ClusterIngressConditionLoadBalancerReady is set when the ClusterIngress has
	// a ready LoadBalancer.
	ClusterIngressConditionLoadBalancerReady duckv1alpha1.ConditionType = "LoadBalancerReady"
)

ConditionType represents a ClusterIngress condition value

Variables

View Source
var (
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
	AddToScheme   = SchemeBuilder.AddToScheme
)
View Source
var SchemeGroupVersion = schema.GroupVersion{Group: networking.GroupName, Version: "v1alpha1"}

SchemeGroupVersion is group version used to register these objects

Functions

func Kind

func Kind(kind string) schema.GroupKind

Kind takes an unqualified kind and returns back a Group qualified GroupKind

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

Types

type ClusterIngress

type ClusterIngress struct {
	metav1.TypeMeta `json:",inline"`
	// Standard object's metadata.
	// More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
	// +optional
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// Spec is the desired state of the ClusterIngress.
	// More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
	// +optional
	Spec IngressSpec `json:"spec,omitempty"`

	// Status is the current state of the ClusterIngress.
	// More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
	// +optional
	Status IngressStatus `json:"status,omitempty"`
}

ClusterIngress is a collection of rules that allow inbound connections to reach the endpoints defined by a backend. An ClusterIngress can be configured to give services externally-reachable urls, load balance traffic offer name based virtual hosting etc.

This is heavily based on K8s Ingress https://godoc.org/k8s.io/api/extensions/v1beta1#Ingress which some highlighted modifications.

func (*ClusterIngress) DeepCopy

func (in *ClusterIngress) DeepCopy() *ClusterIngress

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterIngress.

func (*ClusterIngress) DeepCopyInto

func (in *ClusterIngress) DeepCopyInto(out *ClusterIngress)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ClusterIngress) DeepCopyObject

func (in *ClusterIngress) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*ClusterIngress) GetGroupVersionKind

func (ci *ClusterIngress) GetGroupVersionKind() schema.GroupVersionKind

func (*ClusterIngress) SetDefaults

func (c *ClusterIngress) SetDefaults()

func (*ClusterIngress) Validate

func (ci *ClusterIngress) Validate() *apis.FieldError

type ClusterIngressBackend

type ClusterIngressBackend struct {
	// Specifies the namespace of the referenced service.
	//
	// NOTE: This differs from K8s Ingress to allow routing to different namespaces.
	ServiceNamespace string `json:"serviceNamespace"`

	// Specifies the name of the referenced service.
	ServiceName string `json:"serviceName"`

	// Specifies the port of the referenced service.
	ServicePort intstr.IntOrString `json:"servicePort"`
}

ClusterIngressBackend describes all endpoints for a given service and port.

func (*ClusterIngressBackend) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterIngressBackend.

func (*ClusterIngressBackend) DeepCopyInto

func (in *ClusterIngressBackend) DeepCopyInto(out *ClusterIngressBackend)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (ClusterIngressBackend) Validate

func (b ClusterIngressBackend) Validate() *apis.FieldError

Validate inspects the fields of the type ClusterIngressBackend to determine if they are valid.

type ClusterIngressBackendSplit

type ClusterIngressBackendSplit struct {
	// Specifies the backend receiving the traffic split.
	ClusterIngressBackend `json:",inline"`

	// Specifies the split percentage, a number between 0 and 100.  If
	// only one split is specified, we default to 100.
	//
	// NOTE: This differs from K8s Ingress to allow percentage split.
	Percent int `json:"percent,omitempty"`
}

ClusterIngressBackend describes all endpoints for a given service and port.

func (*ClusterIngressBackendSplit) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterIngressBackendSplit.

func (*ClusterIngressBackendSplit) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (ClusterIngressBackendSplit) Validate

type ClusterIngressList

type ClusterIngressList struct {
	metav1.TypeMeta `json:",inline"`
	// Standard object's metadata.
	// More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
	// +optional
	metav1.ListMeta `json:"metadata,omitempty"`

	// Items is the list of ClusterIngress.
	Items []ClusterIngress `json:"items"`
}

ClusterIngressList is a collection of ClusterIngress.

func (*ClusterIngressList) DeepCopy

func (in *ClusterIngressList) DeepCopy() *ClusterIngressList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterIngressList.

func (*ClusterIngressList) DeepCopyInto

func (in *ClusterIngressList) DeepCopyInto(out *ClusterIngressList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ClusterIngressList) DeepCopyObject

func (in *ClusterIngressList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ClusterIngressRule

type ClusterIngressRule struct {
	// Host is the fully qualified domain name of a network host, as defined
	// by RFC 3986. Note the following deviations from the "host" part of the
	// URI as defined in the RFC:
	// 1. IPs are not allowed. Currently a rule value can only apply to the
	//	  IP in the Spec of the parent ClusterIngress.
	// 2. The `:` delimiter is not respected because ports are not allowed.
	//	  Currently the port of an ClusterIngress is implicitly :80 for http and
	//	  :443 for https.
	// Both these may change in the future.
	// If the host is unspecified, the ClusterIngress routes all traffic based on the
	// specified ClusterIngressRuleValue.
	// If multiple matching Hosts were provided, the first rule will take precedent.
	// +optional
	Hosts []string `json:"hosts,omitempty"`

	// HTTP represents a rule to apply against incoming requests. If the
	// rule is satisfied, the request is routed to the specified backend.
	HTTP *HTTPClusterIngressRuleValue `json:"http,omitempty"`
}

ClusterIngressRule represents the rules mapping the paths under a specified host to the related backend services. Incoming requests are first evaluated for a host match, then routed to the backend associated with the matching ClusterIngressRuleValue.

func (*ClusterIngressRule) DeepCopy

func (in *ClusterIngressRule) DeepCopy() *ClusterIngressRule

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterIngressRule.

func (*ClusterIngressRule) DeepCopyInto

func (in *ClusterIngressRule) DeepCopyInto(out *ClusterIngressRule)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ClusterIngressRule) SetDefaults

func (r *ClusterIngressRule) SetDefaults()

func (*ClusterIngressRule) Validate

func (r *ClusterIngressRule) Validate() *apis.FieldError

type ClusterIngressTLS

type ClusterIngressTLS struct {
	// Hosts are a list of hosts included in the TLS certificate. The values in
	// this list must match the name/s used in the tlsSecret. Defaults to the
	// wildcard host setting for the loadbalancer controller fulfilling this
	// ClusterIngress, if left unspecified.
	// +optional
	Hosts []string `json:"hosts,omitempty"`

	// SecretName is the name of the secret used to terminate SSL traffic.
	SecretName string `json:"secretName,omitempty"`

	// SecretNamespace is the namespace of the secret used to terminate SSL traffic.
	SecretNamespace string `json:"secretNamespace,omitempty"`

	// ServerCertificate identifies the certificate filename in the secret.
	// Defaults to `tls.cert`.
	// +optional
	ServerCertificate string `json:"serverCertificate,omitempty"`

	// PrivateKey identifies the private key filename in the secret.
	// Defaults to `tls.key`.
	// +optional
	PrivateKey string `json:"privateKey,omitempty"`
}

ClusterIngressTLS describes the transport layer security associated with an ClusterIngress.

func (*ClusterIngressTLS) DeepCopy

func (in *ClusterIngressTLS) DeepCopy() *ClusterIngressTLS

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterIngressTLS.

func (*ClusterIngressTLS) DeepCopyInto

func (in *ClusterIngressTLS) DeepCopyInto(out *ClusterIngressTLS)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ClusterIngressTLS) SetDefaults

func (t *ClusterIngressTLS) SetDefaults()

func (*ClusterIngressTLS) Validate

func (t *ClusterIngressTLS) Validate() *apis.FieldError

type HTTPClusterIngressPath

type HTTPClusterIngressPath struct {
	// Path is an extended POSIX regex as defined by IEEE Std 1003.1,
	// (i.e this follows the egrep/unix syntax, not the perl syntax)
	// matched against the path of an incoming request. Currently it can
	// contain characters disallowed from the conventional "path"
	// part of a URL as defined by RFC 3986. Paths must begin with
	// a '/'. If unspecified, the path defaults to a catch all sending
	// traffic to the backend.
	// +optional
	Path string `json:"path,omitempty"`

	// Splits defines the referenced service endpoints to which the traffic
	// will be forwarded to.
	Splits []ClusterIngressBackendSplit `json:"splits"`

	// AppendHeaders allow specifying additional HTTP headers to add
	// before forwarding a request to the destination service.
	//
	// NOTE: This differs from K8s Ingress which doesn't allow header appending.
	// +optional
	AppendHeaders map[string]string `json:"appendHeaders,omitempty"`

	// Timeout for HTTP requests.
	//
	// NOTE: This differs from K8s Ingress which doesn't allow setting timeouts.
	// +optional
	Timeout *metav1.Duration `json:"timeout,omitempty"`

	// Retry policy for HTTP requests.
	//
	// NOTE: This differs from K8s Ingress which doesn't allow retry settings.
	// +optional
	Retries *HTTPRetry `json:"retries,omitempty"`
}

HTTPClusterIngressPath associates a path regex with a backend. Incoming urls matching the path are forwarded to the backend.

func (*HTTPClusterIngressPath) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPClusterIngressPath.

func (*HTTPClusterIngressPath) DeepCopyInto

func (in *HTTPClusterIngressPath) DeepCopyInto(out *HTTPClusterIngressPath)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*HTTPClusterIngressPath) SetDefaults

func (p *HTTPClusterIngressPath) SetDefaults()

func (HTTPClusterIngressPath) Validate

func (h HTTPClusterIngressPath) Validate() *apis.FieldError

type HTTPClusterIngressRuleValue

type HTTPClusterIngressRuleValue struct {
	// A collection of paths that map requests to backends.
	//
	// If they are multiple matching paths, the first match takes precendent.
	Paths []HTTPClusterIngressPath `json:"paths"`
}

HTTPClusterIngressRuleValue is a list of http selectors pointing to backends. In the example: http://<host>/<path>?<searchpart> -> backend where where parts of the url correspond to RFC 3986, this resource will be used to match against everything after the last '/' and before the first '?' or '#'.

func (*HTTPClusterIngressRuleValue) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPClusterIngressRuleValue.

func (*HTTPClusterIngressRuleValue) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*HTTPClusterIngressRuleValue) SetDefaults

func (r *HTTPClusterIngressRuleValue) SetDefaults()

func (*HTTPClusterIngressRuleValue) Validate

type HTTPRetry

type HTTPRetry struct {
	// Number of retries for a given request.
	Attempts int `json:"attempts"`

	// Timeout per retry attempt for a given request. format: 1h/1m/1s/1ms. MUST BE >=1ms.
	PerTryTimeout *metav1.Duration `json:"perTryTimeout"`
}

HTTPRetry describes the retry policy to use when a HTTP request fails.

func (*HTTPRetry) DeepCopy

func (in *HTTPRetry) DeepCopy() *HTTPRetry

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPRetry.

func (*HTTPRetry) DeepCopyInto

func (in *HTTPRetry) DeepCopyInto(out *HTTPRetry)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*HTTPRetry) Validate

func (r *HTTPRetry) Validate() *apis.FieldError

type IngressSpec

type IngressSpec struct {
	// TODO: Generation does not work correctly with CRD. They are scrubbed
	// by the APIserver (https://github.com/kubernetes/kubernetes/issues/58778)
	// So, we add Generation here. Once that gets fixed, remove this and use
	// ObjectMeta.Generation instead.
	// +optional
	Generation int64 `json:"generation,omitempty"`

	// TLS configuration. Currently the ClusterIngress only supports a single TLS
	// port, 443. If multiple members of this list specify different hosts, they
	// will be multiplexed on the same port according to the hostname specified
	// through the SNI TLS extension, if the ingress controller fulfilling the
	// ingress supports SNI.
	// +optional
	TLS []ClusterIngressTLS `json:"tls,omitempty"`

	// A list of host rules used to configure the ClusterIngress.
	// +optional
	Rules []ClusterIngressRule `json:"rules,omitempty"`
}

IngressSpec describes the ClusterIngress the user wishes to exist.

In general this follow the same shape as K8s Ingress. Some notable differences: - Backends now can have namespace: - Traffic can be split across multiple backends. - Timeout & Retry can be configured. - Headers can be appended.

func (*IngressSpec) DeepCopy

func (in *IngressSpec) DeepCopy() *IngressSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IngressSpec.

func (*IngressSpec) DeepCopyInto

func (in *IngressSpec) DeepCopyInto(out *IngressSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*IngressSpec) SetDefaults

func (c *IngressSpec) SetDefaults()

func (*IngressSpec) Validate

func (spec *IngressSpec) Validate() *apis.FieldError

type IngressStatus

type IngressStatus struct {
	// +optional
	Conditions duckv1alpha1.Conditions `json:"conditions,omitempty"`
	// LoadBalancer contains the current status of the load-balancer.
	// +optional
	LoadBalancer *LoadBalancerStatus `json:"loadBalancer,omitempty"`
}

IngressStatus describe the current state of the ClusterIngress.

func (*IngressStatus) DeepCopy

func (in *IngressStatus) DeepCopy() *IngressStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IngressStatus.

func (*IngressStatus) DeepCopyInto

func (in *IngressStatus) DeepCopyInto(out *IngressStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*IngressStatus) GetCondition

func (*IngressStatus) GetConditions

func (cis *IngressStatus) GetConditions() duckv1alpha1.Conditions

GetConditions returns the Conditions array. This enables generic handling of conditions by implementing the duckv1alpha1.Conditions interface.

func (*IngressStatus) InitializeConditions

func (cis *IngressStatus) InitializeConditions()

func (*IngressStatus) IsReady

func (cis *IngressStatus) IsReady() bool

IsReady looks at the conditions and if the Status has a condition ClusterIngressConditionReady returns true if ConditionStatus is True

func (*IngressStatus) MarkLoadBalancerReady

func (cis *IngressStatus) MarkLoadBalancerReady(lbs []LoadBalancerIngressStatus)

MarkLoadBalancerReady marks the Ingress with ClusterIngressConditionLoadBalancerReady, and also populate the address of the load balancer.

func (*IngressStatus) MarkNetworkConfigured

func (cis *IngressStatus) MarkNetworkConfigured()

func (*IngressStatus) SetConditions

func (cis *IngressStatus) SetConditions(conditions duckv1alpha1.Conditions)

SetConditions sets the Conditions array. This enables generic handling of conditions by implementing the duckv1alpha1.Conditions interface.

type LoadBalancerIngressStatus

type LoadBalancerIngressStatus struct {
	// IP is set for load-balancer ingress points that are IP based
	// (typically GCE or OpenStack load-balancers)
	// +optional
	IP string `json:"ip,omitempty"`

	// Domain is set for load-balancer ingress points that are DNS based
	// (typically AWS load-balancers)
	// +optional
	Domain string `json:"domain,omitempty"`

	// DomainInternal is set if there is a cluster-local DNS name to access the Ingress.
	//
	// NOTE: This differs from K8s Ingress, since we also desire to have a cluster-local
	//       DNS name to allow routing in case of not having a mesh.
	//
	// +optional
	DomainInternal string `json:"domainInternal,omitempty"`
}

LoadBalancerIngress represents the status of a load-balancer ingress point: traffic intended for the service should be sent to an ingress point.

func (*LoadBalancerIngressStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoadBalancerIngressStatus.

func (*LoadBalancerIngressStatus) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type LoadBalancerStatus

type LoadBalancerStatus struct {
	// Ingress is a list containing ingress points for the load-balancer.
	// Traffic intended for the service should be sent to these ingress points.
	// +optional
	Ingress []LoadBalancerIngressStatus `json:"ingress,omitempty"`
}

LoadBalancerStatus represents the status of a load-balancer.

func (*LoadBalancerStatus) DeepCopy

func (in *LoadBalancerStatus) DeepCopy() *LoadBalancerStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoadBalancerStatus.

func (*LoadBalancerStatus) DeepCopyInto

func (in *LoadBalancerStatus) DeepCopyInto(out *LoadBalancerStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

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