v1

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: May 29, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package v1 contains API Schema definitions for the kubewg v1 API group

Index

Constants

This section is empty.

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "kubewg.net", 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
)

Functions

This section is empty.

Types

type ExternalVPNSpec

type ExternalVPNSpec struct {
	// Connection is the Wireguard connection configuration
	Connection WireguardConnectionSpec `json:"connection"`

	// Credentials are the external VPN Wireguard credentials
	Credentials WireguardCredentialsSpec `json:"credentials"`
}

ExternalVPNSpec defines the an external VPN connection

func (*ExternalVPNSpec) DeepCopy

func (in *ExternalVPNSpec) DeepCopy() *ExternalVPNSpec

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

func (*ExternalVPNSpec) DeepCopyInto

func (in *ExternalVPNSpec) DeepCopyInto(out *ExternalVPNSpec)

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

type FirewallRuleSpec

type FirewallRuleSpec struct {

	// Protocol is the network protocol
	// If not specified, the default protocol of ALL is used
	//+optional
	Protocol Protocol `json:"protocol"`

	// StartPort is the start port for a range of ports
	// If the end port is not specified, the default end port is the same as the start port
	StartPort uint16 `json:"startPort"`

	// EndPort is the end port for a range of ports
	// If not specified, the default end port is the same as the start port
	//+optional
	EndPort uint16 `json:"endPort,omitempty"`

	// IP is the IP address of the subject
	// Either an IP or CIDR must be specified
	//+optional
	IP string `json:"ip,omitempty"`

	// CIDR is the CIDR block of the subject
	// Either an IP or CIDR must be specified
	//+optional
	CIDR string `json:"cidr,omitempty"`
}

FirewallRuleSpec defines a firewall rule

func (*FirewallRuleSpec) DeepCopy

func (in *FirewallRuleSpec) DeepCopy() *FirewallRuleSpec

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

func (*FirewallRuleSpec) DeepCopyInto

func (in *FirewallRuleSpec) DeepCopyInto(out *FirewallRuleSpec)

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

type FirewallRulesSpec

type FirewallRulesSpec struct {
	// Allow is a list of firewall rules to allow traffic
	//+optional
	Allow []FirewallRuleSpec `json:"allow,omitempty"`

	// Block is a list of firewall rules to block traffic
	//+optional
	Block []FirewallRuleSpec `json:"block,omitempty"`
}

FirewallRulesSpec defines a list of firewall rules

func (*FirewallRulesSpec) DeepCopy

func (in *FirewallRulesSpec) DeepCopy() *FirewallRulesSpec

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

func (*FirewallRulesSpec) DeepCopyInto

func (in *FirewallRulesSpec) DeepCopyInto(out *FirewallRulesSpec)

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

type FirewallSpec

type FirewallSpec struct {

	// Enabled is a flag to enable the firewall.
	// The default firewall configuration is to block all non-VPN traffic, aka a kill switch.
	//+optional
	Enabled bool `json:"enabled"`

	// AllowWorkloadNetworkChanges is a flag to allow pods that could potentially make changes to the workload network
	// This is disabled by default and will reject any containers with the NET_RAW or NET_ADMIN capabilities as
	// these capabilities can be used to make changes to the network. Enabling this flag will allow containers with
	// these capabilities to be deployed.
	//+optional
	AllowWorkloadNetworkChanges bool `json:"allowWorkloadNetworkChanges,omitempty"`

	// Egress is a list of egress firewall rules
	// These rules are applied to traffic leaving the container
	// The default egress rules are to block all RFC1918 IPs and allow all other traffic
	//+optional
	Egress []FirewallRulesSpec `json:"egress,omitempty"`

	// Ingress is a list of ingress firewall rules
	// These rules are applied to traffic entering the container
	// The default ingress rules are to block all traffic
	//+optional
	Ingress []FirewallRulesSpec `json:"ingress,omitempty"`
}

FirewallSpec defines the firewall configuration for a container

func (*FirewallSpec) DeepCopy

func (in *FirewallSpec) DeepCopy() *FirewallSpec

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

func (*FirewallSpec) DeepCopyInto

func (in *FirewallSpec) DeepCopyInto(out *FirewallSpec)

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

type InitSpec

type InitSpec struct {

	// Image is the container image
	// If not specified, the default image of ghcr.io/usa-reddragon/wireguard:main is used
	//+optional
	Image string `json:"image,omitempty"`
}

InitSpec defines the initial container configuration

func (*InitSpec) DeepCopy

func (in *InitSpec) DeepCopy() *InitSpec

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

func (*InitSpec) DeepCopyInto

func (in *InitSpec) DeepCopyInto(out *InitSpec)

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

type NameSelectorSpec

type NameSelectorSpec struct {
	// Name is the name of the resource
	Name string `json:"name"`
}

NameSelectorSpec defines a name selector for a resource

func (*NameSelectorSpec) DeepCopy

func (in *NameSelectorSpec) DeepCopy() *NameSelectorSpec

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

func (*NameSelectorSpec) DeepCopyInto

func (in *NameSelectorSpec) DeepCopyInto(out *NameSelectorSpec)

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

type Network

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

	Spec   NetworkSpec   `json:"spec,omitempty"`
	Status NetworkStatus `json:"status,omitempty"`
}

Network is the Schema for the networks API

func (*Network) DeepCopy

func (in *Network) DeepCopy() *Network

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

func (*Network) DeepCopyInto

func (in *Network) DeepCopyInto(out *Network)

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

func (*Network) DeepCopyObject

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

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

type NetworkList

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

NetworkList contains a list of Network

func (*NetworkList) DeepCopy

func (in *NetworkList) DeepCopy() *NetworkList

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

func (*NetworkList) DeepCopyInto

func (in *NetworkList) DeepCopyInto(out *NetworkList)

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

func (*NetworkList) DeepCopyObject

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

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

type NetworkSpec

type NetworkSpec struct {

	// DNS is the optional DNS configuration
	//+optional
	DNS corev1.PodDNSConfig `json:"dns"`
}

NetworkSpec defines the desired state of Network

func (*NetworkSpec) DeepCopy

func (in *NetworkSpec) DeepCopy() *NetworkSpec

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

func (*NetworkSpec) DeepCopyInto

func (in *NetworkSpec) DeepCopyInto(out *NetworkSpec)

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

type NetworkStatus

type NetworkStatus struct {

	// Ready is a flag to indicate if the network is ready
	Ready bool `json:"ready"`

	// ID is the ID of the network
	ID string `json:"id,omitempty"`

	// Status is the status of the network
	Status uint8 `json:"status,omitempty"`
}

NetworkStatus defines the observed state of Network

func (*NetworkStatus) DeepCopy

func (in *NetworkStatus) DeepCopy() *NetworkStatus

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

func (*NetworkStatus) DeepCopyInto

func (in *NetworkStatus) DeepCopyInto(out *NetworkStatus)

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

type Peer

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

	Spec   PeerSpec   `json:"spec,omitempty"`
	Status PeerStatus `json:"status,omitempty"`
}

Peer is the Schema for the peers API

func (*Peer) DeepCopy

func (in *Peer) DeepCopy() *Peer

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

func (*Peer) DeepCopyInto

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

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

func (*Peer) DeepCopyObject

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

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

type PeerList

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

PeerList contains a list of Peer

func (*PeerList) DeepCopy

func (in *PeerList) DeepCopy() *PeerList

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

func (*PeerList) DeepCopyInto

func (in *PeerList) DeepCopyInto(out *PeerList)

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

func (*PeerList) DeepCopyObject

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

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

type PeerSpec

type PeerSpec struct {

	// Network is the selector for the network this peer is a part of
	Network NameSelectorSpec `json:"network"`

	// Pods is the selector for the pods that are peers in the network
	Pods metav1.LabelSelector `json:"pods"`

	// Init is the optional initial container configuration that is applied to the peer
	//+optional
	Init InitSpec `json:"init,omitempty"`

	// Firewall is the optional firewall configuration that is applied to the peer
	//+optional
	Firewall FirewallSpec `json:"firewall,omitempty"`
}

PeerSpec defines the desired state of Peer

func (*PeerSpec) DeepCopy

func (in *PeerSpec) DeepCopy() *PeerSpec

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

func (*PeerSpec) DeepCopyInto

func (in *PeerSpec) DeepCopyInto(out *PeerSpec)

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

type PeerStatus

type PeerStatus struct {

	// Ready is a flag to indicate if the peer is ready
	Ready bool `json:"ready"`

	// ID is the ID of the peer
	ID string `json:"id,omitempty"`

	// Status is the status of the peer
	Status uint8 `json:"status,omitempty"`
}

PeerStatus defines the observed state of Peer

func (*PeerStatus) DeepCopy

func (in *PeerStatus) DeepCopy() *PeerStatus

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

func (*PeerStatus) DeepCopyInto

func (in *PeerStatus) DeepCopyInto(out *PeerStatus)

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

type Protocol

type Protocol string

Protocol defines a network protocol

type Router

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

	Spec   RouterSpec   `json:"spec,omitempty"`
	Status RouterStatus `json:"status,omitempty"`
}

Router is the Schema for the routers API

func (*Router) DeepCopy

func (in *Router) DeepCopy() *Router

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

func (*Router) DeepCopyInto

func (in *Router) DeepCopyInto(out *Router)

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

func (*Router) DeepCopyObject

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

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

type RouterList

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

RouterList contains a list of Router

func (*RouterList) DeepCopy

func (in *RouterList) DeepCopy() *RouterList

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

func (*RouterList) DeepCopyInto

func (in *RouterList) DeepCopyInto(out *RouterList)

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

func (*RouterList) DeepCopyObject

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

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

type RouterSpec

type RouterSpec struct {

	// Replicas is the number of router replicas
	// This defaults to 0, the same as disabling the router
	//+optional
	Replicas int32 `json:"replicas,omitempty"`

	// Network is the selector for the network this peer is a part of
	Network NameSelectorSpec `json:"network"`

	// Image is the container image for the router
	// This defaults to ghcr.io/usa-reddragon/wireguard:main
	Image string `json:"image,omitempty"`

	// DNS is the optional DNS configuration
	// This overrides the default DNS configuration from the Network
	//+optional
	DNS corev1.PodDNSConfig `json:"dns"`

	// ExternalVPN is the optional external VPN configuration
	// If specified, the router will route traffic through the external VPN
	// Paired with enabling the firewall, this can be used to create a VPN kill-switched
	// connection to an external VPN provider from all pods in the network
	//+optional
	ExternalVPN ExternalVPNSpec `json:"externalVPN,omitempty"`

	// Firewall is the optional firewall configuration that is applied to the peer
	//+optional
	Firewall FirewallSpec `json:"firewall,omitempty"`
}

RouterSpec defines the desired state of Router

func (*RouterSpec) DeepCopy

func (in *RouterSpec) DeepCopy() *RouterSpec

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

func (*RouterSpec) DeepCopyInto

func (in *RouterSpec) DeepCopyInto(out *RouterSpec)

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

type RouterStatus

type RouterStatus struct {

	// Ready is a flag to indicate if the network is ready
	Ready bool `json:"ready"`

	// ID is the ID of the network
	ID string `json:"id,omitempty"`

	// Status is the status of the network
	Status uint8 `json:"status,omitempty"`

	// Replicas is the number of router replicas
	Replicas int32 `json:"replicas"`

	// Selector is the selector for scaling the router pods
	Selector string `json:"selector"`
}

RouterStatus defines the observed state of Router

func (*RouterStatus) DeepCopy

func (in *RouterStatus) DeepCopy() *RouterStatus

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

func (*RouterStatus) DeepCopyInto

func (in *RouterStatus) DeepCopyInto(out *RouterStatus)

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

type WireguardConnectionSpec

type WireguardConnectionSpec struct {
	// Address is the IP address or hostname of the Wireguard server
	//+optional
	Address string `json:"address,omitempty"`

	// Port is the port of the Wireguard server
	//+optional
	Port uint16 `json:"port,omitempty"`

	// Secret is the selector for the secret containing the Wireguard connection configuration in the keys "address" and "port"
	//+optional
	Secret NameSelectorSpec `json:"secret,omitempty"`
}

WireguardConnectionSpec defines a Wireguard connection

func (*WireguardConnectionSpec) DeepCopy

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

func (*WireguardConnectionSpec) DeepCopyInto

func (in *WireguardConnectionSpec) DeepCopyInto(out *WireguardConnectionSpec)

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

type WireguardCredentialsSpec

type WireguardCredentialsSpec struct {

	// PrivateKey is the 44-character private key for the Wireguard client in base64 format
	PrivateKey WireguardKey `json:"privateKey,omitempty"`

	// PeerPublicKey is the 44-character public key for the peer in base64 format
	PeerPublicKey WireguardKey `json:"peerPublicKey,omitempty"`

	// PreSharedKey is the optional pre-shared key for the Wireguard connection
	//+optional
	PreSharedKey string `json:"preSharedKey,omitempty"`

	// Secret is the name of the secret containing the Wireguard credentials in the keys "privateKey", "peerPublicKey", and "preSharedKey"
	//+optional
	Secret NameSelectorSpec `json:"secret,omitempty"`
}

WireguardCredentialsSpec defines a set of Wireguard credentials

func (*WireguardCredentialsSpec) DeepCopy

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

func (*WireguardCredentialsSpec) DeepCopyInto

func (in *WireguardCredentialsSpec) DeepCopyInto(out *WireguardCredentialsSpec)

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

type WireguardKey

type WireguardKey string

WireguardKey is a 44-character base64-encoded Wireguard key

Jump to

Keyboard shortcuts

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