v1alpha1

package
v0.0.0-...-113f59a Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2024 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Overview

+kubebuilder:object:generate=true +groupName=tailscale.com

Index

Constants

This section is empty.

Variables

View Source
var (
	SchemeBuilder runtime.SchemeBuilder

	AddToScheme = localSchemeBuilder.AddToScheme

	GlobalScheme *runtime.Scheme
)
View Source
var ConnectorKind = "Connector"
View Source
var ProxyClassKind = "ProxyClass"
View Source
var SchemeGroupVersion = schema.GroupVersion{Group: apis.GroupName, Version: "v1alpha1"}

SchemeGroupVersion is group version used to register these objects

Functions

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

Types

type Connector

type Connector struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// ConnectorSpec describes the desired Tailscale component.
	Spec ConnectorSpec `json:"spec"`

	// ConnectorStatus describes the status of the Connector. This is set
	// and managed by the Tailscale operator.
	// +optional
	Status ConnectorStatus `json:"status"`
}

func (*Connector) DeepCopy

func (in *Connector) DeepCopy() *Connector

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

func (*Connector) DeepCopyInto

func (in *Connector) DeepCopyInto(out *Connector)

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

func (*Connector) DeepCopyObject

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

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

type ConnectorCondition

type ConnectorCondition struct {
	// Type of the condition, known values are (`SubnetRouterReady`).
	Type ConnectorConditionType `json:"type"`

	// Status of the condition, one of ('True', 'False', 'Unknown').
	Status metav1.ConditionStatus `json:"status"`

	// LastTransitionTime is the timestamp corresponding to the last status
	// change of this condition.
	// +optional
	LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"`

	// Reason is a brief machine readable explanation for the condition's last
	// transition.
	// +optional
	Reason string `json:"reason,omitempty"`

	// Message is a human readable description of the details of the last
	// transition, complementing reason.
	// +optional
	Message string `json:"message,omitempty"`

	// If set, this represents the .metadata.generation that the condition was
	// set based upon.
	// For instance, if .metadata.generation is currently 12, but the
	// .status.condition[x].observedGeneration is 9, the condition is out of date
	// with respect to the current state of the Connector.
	// +optional
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`
}

ConnectorCondition contains condition information for a Connector.

func (*ConnectorCondition) DeepCopy

func (in *ConnectorCondition) DeepCopy() *ConnectorCondition

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

func (*ConnectorCondition) DeepCopyInto

func (in *ConnectorCondition) DeepCopyInto(out *ConnectorCondition)

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

type ConnectorConditionType

type ConnectorConditionType string

ConnectorConditionType represents a Connector condition type.

const (
	ConnectorReady  ConnectorConditionType = `ConnectorReady`
	ProxyClassready ConnectorConditionType = `ProxyClassReady`
)

type ConnectorList

type ConnectorList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata"`

	Items []Connector `json:"items"`
}

func (*ConnectorList) DeepCopy

func (in *ConnectorList) DeepCopy() *ConnectorList

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

func (*ConnectorList) DeepCopyInto

func (in *ConnectorList) DeepCopyInto(out *ConnectorList)

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

func (*ConnectorList) DeepCopyObject

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

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

type ConnectorSpec

type ConnectorSpec struct {
	// Tags that the Tailscale node will be tagged with.
	// Defaults to [tag:k8s].
	// To autoapprove the subnet routes or exit node defined by a Connector,
	// you can configure Tailscale ACLs to give these tags the necessary
	// permissions.
	// See https://tailscale.com/kb/1018/acls/#auto-approvers-for-routes-and-exit-nodes.
	// If you specify custom tags here, you must also make the operator an owner of these tags.
	// See  https://tailscale.com/kb/1236/kubernetes-operator/#setting-up-the-kubernetes-operator.
	// Tags cannot be changed once a Connector node has been created.
	// Tag values must be in form ^tag:[a-zA-Z][a-zA-Z0-9-]*$.
	// +optional
	Tags Tags `json:"tags,omitempty"`
	// Hostname is the tailnet hostname that should be assigned to the
	// Connector node. If unset, hostname defaults to <connector
	// name>-connector. Hostname can contain lower case letters, numbers and
	// dashes, it must not start or end with a dash and must be between 2
	// and 63 characters long.
	// +optional
	Hostname Hostname `json:"hostname,omitempty"`
	// ProxyClass is the name of the ProxyClass custom resource that
	// contains configuration options that should be applied to the
	// resources created for this Connector. If unset, the operator will
	// create resources with the default configuration.
	// +optional
	ProxyClass string `json:"proxyClass,omitempty"`
	// SubnetRouter defines subnet routes that the Connector node should
	// expose to tailnet. If unset, none are exposed.
	// https://tailscale.com/kb/1019/subnets/
	// +optional
	SubnetRouter *SubnetRouter `json:"subnetRouter"`
	// ExitNode defines whether the Connector node should act as a
	// Tailscale exit node. Defaults to false.
	// https://tailscale.com/kb/1103/exit-nodes
	// +optional
	ExitNode bool `json:"exitNode"`
}

ConnectorSpec describes a Tailscale node to be deployed in the cluster. +kubebuilder:validation:XValidation:rule="has(self.subnetRouter) || self.exitNode == true",message="A Connector needs to be either an exit node or a subnet router, or both."

func (*ConnectorSpec) DeepCopy

func (in *ConnectorSpec) DeepCopy() *ConnectorSpec

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

func (*ConnectorSpec) DeepCopyInto

func (in *ConnectorSpec) DeepCopyInto(out *ConnectorSpec)

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

type ConnectorStatus

type ConnectorStatus struct {
	// List of status conditions to indicate the status of the Connector.
	// Known condition types are `ConnectorReady`.
	// +listType=map
	// +listMapKey=type
	// +optional
	Conditions []ConnectorCondition `json:"conditions"`
	// SubnetRoutes are the routes currently exposed to tailnet via this
	// Connector instance.
	// +optional
	SubnetRoutes string `json:"subnetRoutes"`
	// IsExitNode is set to true if the Connector acts as an exit node.
	// +optional
	IsExitNode bool `json:"isExitNode"`
}

ConnectorStatus defines the observed state of the Connector.

func (*ConnectorStatus) DeepCopy

func (in *ConnectorStatus) DeepCopy() *ConnectorStatus

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

func (*ConnectorStatus) DeepCopyInto

func (in *ConnectorStatus) DeepCopyInto(out *ConnectorStatus)

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

type Container

type Container struct {
	// Container security context.
	// Security context specified here will override the security context by the operator.
	// By default the operator:
	// - sets 'privileged: true' for the init container
	// - set NET_ADMIN capability for tailscale container for proxies that
	// are created for Services or Connector.
	// https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#security-context
	// +optional
	SecurityContext *corev1.SecurityContext `json:"securityContext,omitempty"`
	// Container resource requirements.
	// By default Tailscale Kubernetes operator does not apply any resource
	// requirements. The amount of resources required wil depend on the
	// amount of resources the operator needs to parse, usage patterns and
	// cluster size.
	// https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#resources
	// +optional
	Resources corev1.ResourceRequirements `json:"resources,omitempty"`
}

func (*Container) DeepCopy

func (in *Container) DeepCopy() *Container

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

func (*Container) DeepCopyInto

func (in *Container) DeepCopyInto(out *Container)

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

type Hostname

type Hostname string

+kubebuilder:validation:Type=string +kubebuilder:validation:Pattern=`^[a-z0-9][a-z0-9-]{0,61}[a-z0-9]$`

type Pod

type Pod struct {
	// Labels that will be added to the proxy Pod.
	// Any labels specified here will be merged with the default labels
	// applied to the Pod by the Tailscale Kubernetes operator.
	// Label keys and values must be valid Kubernetes label keys and values.
	// https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#syntax-and-character-set
	// +optional
	Labels map[string]string `json:"labels,omitempty"`
	// Annotations that will be added to the proxy Pod.
	// Any annotations specified here will be merged with the default
	// annotations applied to the Pod by the Tailscale Kubernetes operator.
	// Annotations must be valid Kubernetes annotations.
	// https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/#syntax-and-character-set
	// +optional
	Annotations map[string]string `json:"annotations,omitempty"`
	// Configuration for the proxy container running tailscale.
	// +optional
	TailscaleContainer *Container `json:"tailscaleContainer,omitempty"`
	// Configuration for the proxy init container that enables forwarding.
	// +optional
	TailscaleInitContainer *Container `json:"tailscaleInitContainer,omitempty"`
	// Proxy Pod's security context.
	// By default Tailscale Kubernetes operator does not apply any Pod
	// security context.
	// https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#security-context-2
	// +optional
	SecurityContext *corev1.PodSecurityContext `json:"securityContext,omitempty"`
	// Proxy Pod's image pull Secrets.
	// https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#PodSpec
	// +optional
	ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"`
	// Proxy Pod's node name.
	// https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#scheduling
	// +optional
	NodeName string `json:"nodeName,omitempty"`
	// Proxy Pod's node selector.
	// By default Tailscale Kubernetes operator does not apply any node
	// selector.
	// https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#scheduling
	// +optional
	NodeSelector map[string]string `json:"nodeSelector,omitempty"`
	// Proxy Pod's tolerations.
	// By default Tailscale Kubernetes operator does not apply any
	// tolerations.
	// https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#scheduling
	// +optional
	Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
}

func (*Pod) DeepCopy

func (in *Pod) DeepCopy() *Pod

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

func (*Pod) DeepCopyInto

func (in *Pod) DeepCopyInto(out *Pod)

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

type ProxyClass

type ProxyClass struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec ProxyClassSpec `json:"spec"`

	// +optional
	Status ProxyClassStatus `json:"status"`
}

func (*ProxyClass) DeepCopy

func (in *ProxyClass) DeepCopy() *ProxyClass

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

func (*ProxyClass) DeepCopyInto

func (in *ProxyClass) DeepCopyInto(out *ProxyClass)

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

func (*ProxyClass) DeepCopyObject

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

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

type ProxyClassList

type ProxyClassList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata"`

	Items []ProxyClass `json:"items"`
}

+kubebuilder:object:root=true

func (*ProxyClassList) DeepCopy

func (in *ProxyClassList) DeepCopy() *ProxyClassList

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

func (*ProxyClassList) DeepCopyInto

func (in *ProxyClassList) DeepCopyInto(out *ProxyClassList)

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

func (*ProxyClassList) DeepCopyObject

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

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

type ProxyClassSpec

type ProxyClassSpec struct {
	// Proxy's StatefulSet spec.
	StatefulSet *StatefulSet `json:"statefulSet"`
}

func (*ProxyClassSpec) DeepCopy

func (in *ProxyClassSpec) DeepCopy() *ProxyClassSpec

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

func (*ProxyClassSpec) DeepCopyInto

func (in *ProxyClassSpec) DeepCopyInto(out *ProxyClassSpec)

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

type ProxyClassStatus

type ProxyClassStatus struct {
	// List of status conditions to indicate the status of the ProxyClass.
	// Known condition types are `ProxyClassReady`.
	// +listType=map
	// +listMapKey=type
	// +optional
	Conditions []ConnectorCondition `json:"conditions,omitempty"`
}

func (*ProxyClassStatus) DeepCopy

func (in *ProxyClassStatus) DeepCopy() *ProxyClassStatus

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

func (*ProxyClassStatus) DeepCopyInto

func (in *ProxyClassStatus) DeepCopyInto(out *ProxyClassStatus)

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

type Route

type Route string

+kubebuilder:validation:Type=string +kubebuilder:validation:Format=cidr

type Routes

type Routes []Route

+kubebuilder:validation:MinItems=1

func (Routes) DeepCopy

func (in Routes) DeepCopy() Routes

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

func (Routes) DeepCopyInto

func (in Routes) DeepCopyInto(out *Routes)

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

func (Routes) Stringify

func (routes Routes) Stringify() string

type StatefulSet

type StatefulSet struct {
	// Labels that will be added to the StatefulSet created for the proxy.
	// Any labels specified here will be merged with the default labels
	// applied to the StatefulSet by the Tailscale Kubernetes operator as
	// well as any other labels that might have been applied by other
	// actors.
	// Label keys and values must be valid Kubernetes label keys and values.
	// https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#syntax-and-character-set
	// +optional
	Labels map[string]string `json:"labels,omitempty"`
	// Annotations that will be added to the StatefulSet created for the proxy.
	// Any Annotations specified here will be merged with the default annotations
	// applied to the StatefulSet by the Tailscale Kubernetes operator as
	// well as any other annotations that might have been applied by other
	// actors.
	// Annotations must be valid Kubernetes annotations.
	// https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/#syntax-and-character-set
	// +optional
	Annotations map[string]string `json:"annotations,omitempty"`
	// Configuration for the proxy Pod.
	// +optional
	Pod *Pod `json:"pod,omitempty"`
}

func (*StatefulSet) DeepCopy

func (in *StatefulSet) DeepCopy() *StatefulSet

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

func (*StatefulSet) DeepCopyInto

func (in *StatefulSet) DeepCopyInto(out *StatefulSet)

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

type SubnetRouter

type SubnetRouter struct {
	// AdvertiseRoutes refer to CIDRs that the subnet router should make
	// available. Route values must be strings that represent a valid IPv4
	// or IPv6 CIDR range. Values can be Tailscale 4via6 subnet routes.
	// https://tailscale.com/kb/1201/4via6-subnets/
	AdvertiseRoutes Routes `json:"advertiseRoutes"`
}

SubnetRouter defines subnet routes that should be exposed to tailnet via a Connector node.

func (*SubnetRouter) DeepCopy

func (in *SubnetRouter) DeepCopy() *SubnetRouter

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

func (*SubnetRouter) DeepCopyInto

func (in *SubnetRouter) DeepCopyInto(out *SubnetRouter)

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

type Tag

type Tag string

+kubebuilder:validation:Type=string +kubebuilder:validation:Pattern=`^tag:[a-zA-Z][a-zA-Z0-9-]*$`

type Tags

type Tags []Tag

func (Tags) DeepCopy

func (in Tags) DeepCopy() Tags

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

func (Tags) DeepCopyInto

func (in Tags) DeepCopyInto(out *Tags)

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

func (Tags) Stringify

func (tags Tags) Stringify() []string

Jump to

Keyboard shortcuts

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