v1

package
v0.0.27 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package v1 contains API Schema definitions for the v1 API group +kubebuilder:object:generate=true +groupName=cni.webmesh.io

Index

Constants

View Source
const (
	// PeerContainerFinalizer is the PeerContainer finalizer.
	PeerContainerFinalizer = "peercontainer.cniv1.webmesh.io"
	// PeerContainerPodNameLabel is the label for the pod name.
	PeerContainerPodNameLabel = "webmesh.io/pod-name"
	// PeerContainerPodNamespaceLabel is the label for the pod namespace.
	PeerContainerPodNamespaceLabel = "webmesh.io/pod-namespace"
)
View Source
const (
	// RemoteNetworkFinalizer is the RemoteNetwork finalizer.
	RemoteNetworkFinalizer = "remotenetwork.cniv1.webmesh.io"
	// KubeconfigKey is the key in the secret containing the kubeconfig
	// for the remote network.
	KubeconfigKey = "kubeconfig"
	// TLSCertificateKey is the key in the secret containing the TLS certificate
	// for the remote network.
	TLSCertificateKey = "tls.crt"
	// TLSPrivateKeyKey is the key in the secret containing the TLS private key
	// for the remote network.
	TLSPrivateKeyKey = "tls.key"
	// TLSCACertificateKey is the key in the secret containing the TLS CA certificate
	// for the remote network.
	TLSCACertificateKey = "ca.crt"
	// PreSharedKeyKey is the key in the secret containing the pre-shared-key
	// for the remote network.
	PreSharedKeyKey = "pre-shared-key"
)
View Source
const FieldOwner = "webmesh-cni"

FieldOwner is the field owner for CNI objects.

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "cni.webmesh.io", Version: "v1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)
View Source
var PeerContainerTypeMeta = metav1.TypeMeta{
	APIVersion: GroupVersion.String(),
	Kind:       "PeerContainer",
}

PeerContainerTypeMeta is the type meta for the PeerContainer.

View Source
var RemoteNetworkTypeMeta = metav1.TypeMeta{
	APIVersion: GroupVersion.String(),
	Kind:       "RemoteNetwork",
}

RemoteNetworkTypeMeta is the type meta for the RemoteNetwork.

Functions

This section is empty.

Types

type BridgeStatus added in v0.0.17

type BridgeStatus string

BridgeStatus is the current status of a bridge interface.

const (
	// InterfaceStatusCreated is the initial phase of a new peer interface.
	BridgeStatusCreated BridgeStatus = "Created"
	// InterfaceStatusStarting is the phase when the interface is starting.
	BridgeStatusStarting BridgeStatus = "Starting"
	// InterfaceStatusRunning is the phase when the interface is running.
	BridgeStatusRunning BridgeStatus = "Running"
	// InterfaceStatusFailed is the phase when the interface failed to start.
	BridgeStatusFailed BridgeStatus = "Failed"
)

type InterfaceStatus

type InterfaceStatus string

InterfaceStatus is the current status of a container interface.

const (
	// InterfaceStatusCreated is the initial phase of a new peer interface.
	InterfaceStatusCreated InterfaceStatus = "Created"
	// InterfaceStatusStarting is the phase when the interface is starting.
	InterfaceStatusStarting InterfaceStatus = "Starting"
	// InterfaceStatusRunning is the phase when the interface is running.
	InterfaceStatusRunning InterfaceStatus = "Running"
	// InterfaceStatusFailed is the phase when the interface failed to start.
	InterfaceStatusFailed InterfaceStatus = "Failed"
)

type NetworkConfig added in v0.0.17

type NetworkConfig struct {
	// WireGuardPort is the port to use for WireGuard. One will be
	// allocated automatically if not provided.
	WireGuardPort int `json:"wireguardPort,omitempty"`
	// InterfaceName is the name to give the interface. It will be
	// automatically chosen from the name of the remote network if
	// not provided.
	InterfaceName string `json:"interfaceName,omitempty"`
	// MTU is the MTU to use for the interface. It will be automatically
	// chosen if not provided.
	MTU int `json:"mtu,omitempty"`
	// ForwardDNS enables forwarding DNS requests from the remote network.
	// Requires that a MeshDNS server is running on each peered CNI node.
	ForwardDNS bool `json:"forwardDNS,omitempty"`
	// DisableIPv4 disables IPv4 forwarding on the interface.
	DisableIPv4 bool `json:"disableIPv4,omitempty"`
	// DisableIPv6 disables IPv6 forwarding on the interface.
	DisableIPv6 bool `json:"disableIPv6,omitempty"`
}

NetworkConfig is configuration options for the bridge connection.

func (*NetworkConfig) DeepCopy added in v0.0.17

func (in *NetworkConfig) DeepCopy() *NetworkConfig

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

func (*NetworkConfig) DeepCopyInto added in v0.0.17

func (in *NetworkConfig) DeepCopyInto(out *NetworkConfig)

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

type Peer added in v0.0.7

type Peer struct {
	// ID is the ID of the peer. If provided, the native authentication
	// will attempt ID based authentication. If not provided, an ID will
	// be extracted from the public key and used for authentication.
	ID string `json:"id,omitempty"`
	// PublicKey is the public key of the peer. This must be provided if no
	// ID is provided.
	PublicKey string `json:"publicKey,omitempty"`
	// Endpoints are the endpoints of the peer. When not performing
	// authentication and not using peer-discovery, these are remote
	// wireguard endpoints. When performing authentication without
	// peer-discovery, these are remote gRPC endpoints.
	Endpoints []string `json:"endpoints,omitempty"`
	// Rendezvous is a rendezvous point for the peer. This is used for
	// peer discovery.
	Rendezvous string `json:"rendezvous,omitempty"`
}

Peer is a CNI node in the remote network.

func (*Peer) DeepCopy added in v0.0.7

func (in *Peer) DeepCopy() *Peer

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

func (*Peer) DeepCopyInto added in v0.0.7

func (in *Peer) DeepCopyInto(out *Peer)

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

type PeerContainer

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

	Spec   PeerContainerSpec   `json:"spec,omitempty"`
	Status PeerContainerStatus `json:"status,omitempty"`
}

PeerContainer is the Schema for the peercontainers API

func (PeerContainer) AppendToResults

func (p PeerContainer) AppendToResults(result *cniv1.Result) error

AppendToResults appends the network information to the results.

func (*PeerContainer) DeepCopy

func (in *PeerContainer) DeepCopy() *PeerContainer

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

func (*PeerContainer) DeepCopyInto

func (in *PeerContainer) DeepCopyInto(out *PeerContainer)

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

func (*PeerContainer) DeepCopyObject

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

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

type PeerContainerList

type PeerContainerList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []PeerContainer `json:"items"`
}

PeerContainerList contains a list of PeerContainer

func (*PeerContainerList) DeepCopy

func (in *PeerContainerList) DeepCopy() *PeerContainerList

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

func (*PeerContainerList) DeepCopyInto

func (in *PeerContainerList) DeepCopyInto(out *PeerContainerList)

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

func (*PeerContainerList) DeepCopyObject

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

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

type PeerContainerSpec

type PeerContainerSpec struct {
	// NodeID is the ID to use for the container.
	NodeID string `json:"nodeID,omitempty"`
	// ContainerID is the ID of the container being created.
	ContainerID string `json:"containerID,omitempty"`
	// Netns is the network namespace of the container being created.
	Netns string `json:"netns,omitempty"`
	// IfName is the name of the interface create.
	IfName string `json:"ifName,omitempty"`
	// NodeName is the name of the node the container is running on.
	NodeName string `json:"nodeName,omitempty"`
	// MTU is the MTU to set on the interface.
	MTU int `json:"mtu,omitempty"`
	// DisableIPv4 is whether to disable IPv4 on the interface.
	DisableIPv4 bool `json:"disableIPv4,omitempty"`
	// DisableIPv6 is whether to disable IPv6 on the interface.
	DisableIPv6 bool `json:"disableIPv6,omitempty"`
	// LogLevel is the log level for the webmesh interface.
	LogLevel string `json:"logLevel,omitempty"`
}

PeerContainerSpec defines the desired state of PeerContainer

func (*PeerContainerSpec) DeepCopy

func (in *PeerContainerSpec) DeepCopy() *PeerContainerSpec

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

func (*PeerContainerSpec) DeepCopyInto

func (in *PeerContainerSpec) DeepCopyInto(out *PeerContainerSpec)

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

type PeerContainerStatus

type PeerContainerStatus struct {
	// InterfaceStatus is the current status of the interface.
	InterfaceStatus InterfaceStatus `json:"status,omitempty"`
	// InterfaceName is the name of the interface.
	InterfaceName string `json:"interfaceName,omitempty"`
	// MACAddress is the MAC address of the interface.
	MACAddress string `json:"macAddress,omitempty"`
	// IPv4Address is the IPv4 address of the interface.
	IPv4Address string `json:"ipv4Address,omitempty"`
	// IPv6Address is the IPv6 address of the interface.
	IPv6Address string `json:"ipv6Address,omitempty"`
	// NetworkV4 is the IPv4 network of the interface.
	NetworkV4 string `json:"networkV4,omitempty"`
	// NetworkV6 is the IPv6 network of the interface.
	NetworkV6 string `json:"networkV6,omitempty"`
	// DNSServers is an optional list of extra DNS servers to use for the interface.
	DNSServers []string `json:"dnsServers,omitempty"`
	// Error is any error that occurred while peering the interface.
	Error string `json:"error,omitempty"`
}

PeerContainerStatus defines the observed state of PeerContainer

func (*PeerContainerStatus) DeepCopy

func (in *PeerContainerStatus) DeepCopy() *PeerContainerStatus

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

func (*PeerContainerStatus) DeepCopyInto

func (in *PeerContainerStatus) DeepCopyInto(out *PeerContainerStatus)

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

func (PeerContainerStatus) HasNetworkInfo

func (p PeerContainerStatus) HasNetworkInfo() bool

HasNetworkInfo returns true if the status has network information.

func (PeerContainerStatus) IsEmpty

func (p PeerContainerStatus) IsEmpty() bool

IsEmpty returns true if the status is empty.

type RemoteAuthMethod added in v0.0.7

type RemoteAuthMethod string

RemoteAuthMethod is a method for authenticating with a remote network.

const (
	// RemoteAuthMethodNone is the no authentication method.
	RemoteAuthMethodNone RemoteAuthMethod = "none"
	// RemoteAuthMethodNative is the native gRPC authentication method.
	// This may or may not require TLS credentials depending on the remote
	// network configuration.
	RemoteAuthMethodNative RemoteAuthMethod = "native"
	// RemoteAuthMethodKubernetes is the Kubernetes authentication method.
	// This requires a kubeconfig for the remote network where this node
	// will write its network configuration directly to the cluster.
	RemoteAuthMethodKubernetes RemoteAuthMethod = "kubernetes"
)

type RemoteNetwork added in v0.0.8

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

	Spec   RemoteNetworkSpec   `json:"spec,omitempty"`
	Status RemoteNetworkStatus `json:"status,omitempty"`
}

RemoteNetwork is the Schema for the remotenetworks API

func (*RemoteNetwork) DeepCopy added in v0.0.8

func (in *RemoteNetwork) DeepCopy() *RemoteNetwork

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

func (*RemoteNetwork) DeepCopyInto added in v0.0.8

func (in *RemoteNetwork) DeepCopyInto(out *RemoteNetwork)

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

func (*RemoteNetwork) DeepCopyObject added in v0.0.8

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

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

type RemoteNetworkList added in v0.0.17

type RemoteNetworkList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []RemoteNetwork `json:"items"`
}

RemoteNetworkList contains a list of RemoteNetworks.

func (*RemoteNetworkList) DeepCopy added in v0.0.17

func (in *RemoteNetworkList) DeepCopy() *RemoteNetworkList

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

func (*RemoteNetworkList) DeepCopyInto added in v0.0.17

func (in *RemoteNetworkList) DeepCopyInto(out *RemoteNetworkList)

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

func (*RemoteNetworkList) DeepCopyObject added in v0.0.17

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

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

type RemoteNetworkSpec added in v0.0.7

type RemoteNetworkSpec struct {
	// AuthMethod is the authentication method to use for peering with
	// the remote network.
	// +kubebuilder:validation:Enum=none;native;kubernetes
	// +kubebuilder:default=native
	AuthMethod RemoteAuthMethod `json:"authMethod"`
	// RemoteNamespace is the remote namespace to use for peer storage
	// when using the kubernetes authentication method. Defaults to the
	// storage namespace configured on the host.
	RemoteNamespace string `json:"remoteNamespace,omitempty"`
	// Network is the network configuration for the bridge connection.
	Network NetworkConfig `json:"network,omitempty"`
	// Peers are one or more peers in the remote network. These are optional
	// when using kubernetes authentication. Endpoints must be supplied for
	// one or more peers in the list if not using peer-discovery.
	Peers []Peer `json:"peers,omitempty"`
	// Credentials are a reference to a secret containing credentials for the remote
	// network. It may contain a kubeconfig for kubernetes authentication or TLS
	// credentials for mTLS authentication. If native authentication is set and no
	// kubeconfig or TLS credentials are present, ID authentication will be used.
	Credentials *corev1.ObjectReference `json:"credentials,omitempty"`
	// CheckInterval is the interval to check on the remote network status when
	// using native or no authentication. Defaults to 1 minute. Kubernetes authentication
	// relies on storage subscription events and does not require a check interval.
	CheckInterval *metav1.Duration `json:"checkInterval,omitempty"`
}

RemoteNetworkSpec defines the configuration for peering with another webmesh network.

func (*RemoteNetworkSpec) DeepCopy added in v0.0.7

func (in *RemoteNetworkSpec) DeepCopy() *RemoteNetworkSpec

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

func (*RemoteNetworkSpec) DeepCopyInto added in v0.0.7

func (in *RemoteNetworkSpec) DeepCopyInto(out *RemoteNetworkSpec)

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

type RemoteNetworkStatus added in v0.0.8

type RemoteNetworkStatus struct {
	// BridgeStatus is the status of the bridge interface.
	BridgeStatus BridgeStatus `json:"bridgeStatus,omitempty"`
	// InterfaceName is the name of the interface.
	InterfaceName string `json:"interfaceName"`
	// MACAddress is the MAC address of the interface.
	MACAddress string `json:"macAddress"`
	// IPv4Address is the IPv4 address of the interface.
	IPv4Address string `json:"ipv4Address"`
	// IPv6Address is the IPv6 address of the interface.
	IPv6Address string `json:"ipv6Address"`
	// NetworkV4 is the IPv4 network of the interface.
	NetworkV4 string `json:"networkV4"`
	// NetworkV6 is the IPv6 network of the interface.
	NetworkV6 string `json:"networkV6"`
	// Peers are the peers in the remote network.
	Peers []Peer `json:"peers,omitempty"`
	// Error is the last error encountered when peering with the remote network.
	Error string `json:"error,omitempty"`
}

RemoteNetworkStatus will contain the status of the peering with the remote network.

func (*RemoteNetworkStatus) DeepCopy added in v0.0.8

func (in *RemoteNetworkStatus) DeepCopy() *RemoteNetworkStatus

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

func (*RemoteNetworkStatus) DeepCopyInto added in v0.0.8

func (in *RemoteNetworkStatus) DeepCopyInto(out *RemoteNetworkStatus)

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