Documentation
¶
Overview ¶
Package kube contains types and utilities for the Tailscale Kubernetes Operator.
Index ¶
- Constants
- func CapVerFromFileName(name string) (tailcfg.CapabilityVersion, error)
- func DNSCfgIsReady(cfg *tsapi.DNSConfig) bool
- func GetServiceCondition(svc *corev1.Service, conditionType tsapi.ConditionType) *metav1.Condition
- func KubeAPIServerProxyConfigured(pg *tsapi.ProxyGroup) bool
- func KubeAPIServerProxyValid(pg *tsapi.ProxyGroup) (valid bool, set bool)
- func ProxyClassIsReady(pc *tsapi.ProxyClass) bool
- func ProxyGroupAvailable(pg *tsapi.ProxyGroup) bool
- func ProxyGroupIsReady(pg *tsapi.ProxyGroup) bool
- func RemoveConnectorCondition(conn *tsapi.Connector, conditionType tsapi.ConditionType)
- func RemoveServiceCondition(svc *corev1.Service, conditionType tsapi.ConditionType)
- func ResolveViaDomain(name string) (netip.Addr, bool)
- func SetConnectorCondition(cn *tsapi.Connector, conditionType tsapi.ConditionType, ...)
- func SetDNSConfigCondition(dnsCfg *tsapi.DNSConfig, conditionType tsapi.ConditionType, ...)
- func SetPeerRelayCondition(pr *tsapi.PeerRelay, conditionType tsapi.ConditionType, ...)
- func SetProxyClassCondition(pc *tsapi.ProxyClass, conditionType tsapi.ConditionType, ...)
- func SetProxyGroupCondition(pg *tsapi.ProxyGroup, conditionType tsapi.ConditionType, ...)
- func SetRecorderCondition(tsr *tsapi.Recorder, conditionType tsapi.ConditionType, ...)
- func SetServiceCondition(svc *corev1.Service, conditionType tsapi.ConditionType, ...)
- func SetTailnetCondition(tn *tsapi.Tailnet, conditionType tsapi.ConditionType, ...)
- func SvcIsReady(svc *corev1.Service) bool
- func TailnetIsReady(tn *tsapi.Tailnet) bool
- func TailscaledConfigFileName(cap tailcfg.CapabilityVersion) string
- func TruncateWithHash(val string) string
- type Records
Constants ¶
const ( Alpha1Version = "v1alpha1" DNSRecordsCMName = "dnsrecords" DNSRecordsCMKey = "records.json" )
Variables ¶
This section is empty.
Functions ¶
func CapVerFromFileName ¶ added in v1.66.2
func CapVerFromFileName(name string) (tailcfg.CapabilityVersion, error)
CapVerFromFileName parses the capability version from a tailscaled config file name previously generated by TailscaledConfigFileNameForCap.
func DNSCfgIsReady ¶ added in v1.66.0
func GetServiceCondition ¶ added in v1.76.0
GetServiceCondition returns Service condition with the specified type, if it exists on the Service.
func KubeAPIServerProxyConfigured ¶ added in v1.86.0
func KubeAPIServerProxyConfigured(pg *tsapi.ProxyGroup) bool
func KubeAPIServerProxyValid ¶ added in v1.86.0
func KubeAPIServerProxyValid(pg *tsapi.ProxyGroup) (valid bool, set bool)
func ProxyClassIsReady ¶ added in v1.60.0
func ProxyClassIsReady(pc *tsapi.ProxyClass) bool
func ProxyGroupAvailable ¶ added in v1.86.0
func ProxyGroupAvailable(pg *tsapi.ProxyGroup) bool
func ProxyGroupIsReady ¶ added in v1.76.0
func ProxyGroupIsReady(pg *tsapi.ProxyGroup) bool
func RemoveConnectorCondition ¶
func RemoveConnectorCondition(conn *tsapi.Connector, conditionType tsapi.ConditionType)
RemoveConnectorCondition will remove condition of the given type if it exists.
func RemoveServiceCondition ¶ added in v1.70.0
func RemoveServiceCondition(svc *corev1.Service, conditionType tsapi.ConditionType)
RemoveServiceCondition will remove condition of the given type if it exists.
func ResolveViaDomain ¶ added in v1.102.0
ResolveViaDomain parses an FQDN (with or without trailing dot) as a 4via6 domain in the format "<ipv4-with-hyphens>-via-<siteID>[.domain]" and returns the synthesized IPv6 via address. This borrows heavily from net/dns/resolver.(*Resolver).resolveViaDomain. TODO(beckypauley): consider a refactor of the above to remove duplication.
func SetConnectorCondition ¶
func SetConnectorCondition(cn *tsapi.Connector, conditionType tsapi.ConditionType, status metav1.ConditionStatus, reason, message string, gen int64, clock tstime.Clock, logger *zap.SugaredLogger)
SetConnectorCondition ensures that Connector status has a condition with the given attributes. LastTransitionTime gets set every time condition's status changes.
func SetDNSConfigCondition ¶ added in v1.66.0
func SetDNSConfigCondition(dnsCfg *tsapi.DNSConfig, conditionType tsapi.ConditionType, status metav1.ConditionStatus, reason, message string, gen int64, clock tstime.Clock, logger *zap.SugaredLogger)
SetDNSConfigCondition ensures that DNSConfig status has a condition with the given attributes. LastTransitionTime gets set every time condition's status changes
func SetPeerRelayCondition ¶ added in v1.102.0
func SetPeerRelayCondition(pr *tsapi.PeerRelay, conditionType tsapi.ConditionType, status metav1.ConditionStatus, reason, message string, clock tstime.Clock, logger *zap.SugaredLogger)
SetPeerRelayCondition ensures that PeerRelay status has a condition with the given attributes. LastTransitionTime gets set every time condition's status changes.
func SetProxyClassCondition ¶ added in v1.60.0
func SetProxyClassCondition(pc *tsapi.ProxyClass, conditionType tsapi.ConditionType, status metav1.ConditionStatus, reason, message string, gen int64, clock tstime.Clock, logger *zap.SugaredLogger)
SetProxyClassCondition ensures that ProxyClass status has a condition with the given attributes. LastTransitionTime gets set every time condition's status changes.
func SetProxyGroupCondition ¶ added in v1.76.0
func SetProxyGroupCondition(pg *tsapi.ProxyGroup, conditionType tsapi.ConditionType, status metav1.ConditionStatus, reason, message string, gen int64, clock tstime.Clock, logger *zap.SugaredLogger)
SetProxyGroupCondition ensures that ProxyGroup status has a condition with the given attributes. LastTransitionTime gets set every time condition's status changes.
func SetRecorderCondition ¶ added in v1.74.0
func SetRecorderCondition(tsr *tsapi.Recorder, conditionType tsapi.ConditionType, status metav1.ConditionStatus, reason, message string, gen int64, clock tstime.Clock, logger *zap.SugaredLogger)
SetRecorderCondition ensures that Recorder status has a condition with the given attributes. LastTransitionTime gets set every time condition's status changes.
func SetServiceCondition ¶ added in v1.70.0
func SetServiceCondition(svc *corev1.Service, conditionType tsapi.ConditionType, status metav1.ConditionStatus, reason, message string, clock tstime.Clock, logger *zap.SugaredLogger)
SetServiceCondition ensures that Service status has a condition with the given attributes. LastTransitionTime gets set every time condition's status changes.
func SetTailnetCondition ¶ added in v1.96.0
func SetTailnetCondition(tn *tsapi.Tailnet, conditionType tsapi.ConditionType, status metav1.ConditionStatus, reason, message string, clock tstime.Clock, logger *zap.SugaredLogger)
SetTailnetCondition ensures that Tailnet status has a condition with the given attributes. LastTransitionTime gets set every time condition's status changes.
func SvcIsReady ¶ added in v1.80.0
func TailnetIsReady ¶ added in v1.96.0
func TailscaledConfigFileName ¶ added in v1.76.0
func TailscaledConfigFileName(cap tailcfg.CapabilityVersion) string
TailscaledConfigFileName returns a tailscaled config file name in format expected by containerboot for the given CapVer.
func TruncateWithHash ¶ added in v1.106.0
TruncateWithHash truncates val to fit within 63 bytes, the maximum length of both a Kubernetes label value and a DNS label. If val exceeds the limit, it is truncated and a short hash suffix is appended to preserve uniqueness.
Types ¶
type Records ¶ added in v1.66.0
type Records struct {
// Version is the version of this Records configuration. Version is
// written by the operator, i.e when it first populates the Records.
// k8s-nameserver must verify that it knows how to parse a given
// version.
Version string `json:"version"`
// IP4 contains a mapping of DNS names to IPv4 address(es).
IP4 map[string][]string `json:"ip4"`
// IP6 contains a mapping of DNS names to IPv6 address(es).
// This field is optional and will be omitted from JSON if empty.
// It enables dual-stack DNS support in Kubernetes clusters.
// +optional
IP6 map[string][]string `json:"ip6,omitempty"`
}
Directories
¶
| Path | Synopsis |
|---|---|
|
Package apiproxy contains the Kubernetes API Proxy implementation used by k8s-operator and k8s-proxy.
|
Package apiproxy contains the Kubernetes API Proxy implementation used by k8s-operator and k8s-proxy. |
|
Package apis contains a constant to name the Tailscale Kubernetes Operator's schema group.
|
Package apis contains a constant to name the Tailscale Kubernetes Operator's schema group. |
|
v1alpha1
Package v1alpha1 documents the k8s-operator API.
|
Package v1alpha1 documents the k8s-operator API. |
|
Package reconciler provides utilities for working with Kubernetes resources within controller reconciliation loops.
|
Package reconciler provides utilities for working with Kubernetes resources within controller reconciliation loops. |
|
dnsrecords
Package dnsrecords provides reconciliation logic for keeping the dnsrecords ConfigMap up to date with DNS records for tailscale ingress and egress proxies.
|
Package dnsrecords provides reconciliation logic for keeping the dnsrecords ConfigMap up to date with DNS records for tailscale ingress and egress proxies. |
|
nameserver
Package nameserver provides reconciliation logic for the DNSConfig custom resource definition.
|
Package nameserver provides reconciliation logic for the DNSConfig custom resource definition. |
|
peerrelay
Package peerrelay provides reconciliation logic for the PeerRelay custom resource definition.
|
Package peerrelay provides reconciliation logic for the PeerRelay custom resource definition. |
|
proxyclass
Package proxyclass provides reconciliation logic for the ProxyClass custom resource definition.
|
Package proxyclass provides reconciliation logic for the ProxyClass custom resource definition. |
|
proxygrouppolicy
Package proxygrouppolicy provides reconciliation logic for the ProxyGroupPolicy custom resource definition.
|
Package proxygrouppolicy provides reconciliation logic for the ProxyGroupPolicy custom resource definition. |
|
reconcilertest
Package reconcilertest provides helpers for testing the CRD reconcilers under k8s-operator/reconciler.
|
Package reconcilertest provides helpers for testing the CRD reconcilers under k8s-operator/reconciler. |
|
recorder
Package recorder provides reconciliation logic for the Recorder custom resource definition.
|
Package recorder provides reconciliation logic for the Recorder custom resource definition. |
|
staticendpoints
Package staticendpoints provisions the cluster resources needed to expose proxies to the tailnet on 'static' endpoints (ProxyClass spec.staticEndpoints): a NodePort Service is created for each replica of the proxy's StatefulSet, and the ExternalIPs of the selected Nodes combined with the allocated NodePorts are advertised as static endpoints in each replica's tailscaled config.
|
Package staticendpoints provisions the cluster resources needed to expose proxies to the tailnet on 'static' endpoints (ProxyClass spec.staticEndpoints): a NodePort Service is created for each replica of the proxy's StatefulSet, and the ExternalIPs of the selected Nodes combined with the allocated NodePorts are advertised as static endpoints in each replica's tailscaled config. |
|
tailnet
Package tailnet provides reconciliation logic for the Tailnet custom resource definition.
|
Package tailnet provides reconciliation logic for the Tailnet custom resource definition. |
|
tailscaled
Package tailscaled provides shared building blocks for operator reconcilers that manage StatefulSets running tailscaled pods (peer relays, connectors, proxy groups, etc).
|
Package tailscaled provides shared building blocks for operator reconcilers that manage StatefulSets running tailscaled pods (peer relays, connectors, proxy groups, etc). |
|
Package sessionrecording contains functionality for recording Kubernetes API server proxy 'kubectl exec/attach' sessions.
|
Package sessionrecording contains functionality for recording Kubernetes API server proxy 'kubectl exec/attach' sessions. |
|
fakes
Package fakes contains mocks used for testing 'kubectl exec' session recording functionality.
|
Package fakes contains mocks used for testing 'kubectl exec' session recording functionality. |
|
spdy
Package spdy contains functionality for parsing SPDY streaming sessions.
|
Package spdy contains functionality for parsing SPDY streaming sessions. |
|
tsrecorder
Package tsrecorder contains functionality for connecting to a tsrecorder instance.
|
Package tsrecorder contains functionality for connecting to a tsrecorder instance. |
|
ws
Package ws has functionality to parse 'kubectl exec/attach' sessions streamed using WebSocket protocol.
|
Package ws has functionality to parse 'kubectl exec/attach' sessions streamed using WebSocket protocol. |
|
Package tsclient provides a mockable wrapper around the tailscale-client-go-v2 package for use by the Kubernetes operator.
|
Package tsclient provides a mockable wrapper around the tailscale-client-go-v2 package for use by the Kubernetes operator. |