Skip to content

Commit

Permalink
fixup! add external network apis
Browse files Browse the repository at this point in the history
  • Loading branch information
aleoli committed Sep 19, 2023
1 parent 33fe68b commit 9742f32
Show file tree
Hide file tree
Showing 21 changed files with 80 additions and 43 deletions.
11 changes: 7 additions & 4 deletions apis/networking/v1alpha1/configuration_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,23 +50,26 @@ type ClusterConfig struct {

// ConfigurationSpec defines the desired state of Configuration.
type ConfigurationSpec struct {
// Local configuration.
// Local network configuration (the cluster where the resource is created).
Local ClusterConfig `json:"local,omitempty"`
// Remote configuration.
// LocalRemapped network configuration, it defines how the remote cluster sees the local cluster.
LocalRemapped ClusterConfig `json:"localRemapped,omitempty"`
// Remote network configuration (the other cluster).
Remote ClusterConfig `json:"remote,omitempty"`
}

// ConfigurationStatus defines the observed state of Configuration.
type ConfigurationStatus struct {
// Remote remapped configuration.
// Remote remapped configuration, it defines how the local cluster sees the remote cluster.
Remote ClusterConfig `json:"remote,omitempty"`
}

// +kubebuilder:object:root=true
// +kubebuilder:resource:categories=liqo
// +kubebuilder:subresource:status

// Configuration is the Schema for the configuration API.
// Configuration contains the network configuration of a pair of clusters,
// including the local and the remote pod and external CIDRs and how the where remapped.
type Configuration struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand Down
4 changes: 2 additions & 2 deletions apis/networking/v1alpha1/connection_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const (
type PingSpec struct {
// Enabled specifies whether the ping is enabled or not.
// +kubebuilder:default=true
Enabled bool `json:"enabled,omitempty"`
Enabled *bool `json:"enabled,omitempty"`
// Endpoint specifies the endpoint to ping.
Endpoint EndpointStatus `json:"endpoint,omitempty"`
}
Expand Down Expand Up @@ -118,7 +118,7 @@ type ConnectionStatus struct {
// +kubebuilder:resource:categories=liqo
// +kubebuilder:subresource:status

// Connection is the Schema for the connection API.
// Connection contains the status of a connection between two clusters (a client and a server).
type Connection struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion apis/networking/v1alpha1/firewallconfiguration_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ type FirewallConfigurationStatus struct {
// +kubebuilder:resource:categories=liqo
// +kubebuilder:subresource:status

// FirewallConfiguration is the Schema for the firewallconfiguration API.
// FirewallConfiguration contains a rule to be applied to the firewall in the gateway.
type FirewallConfiguration struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion apis/networking/v1alpha1/gatewayclient_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ type GatewayClientStatus struct {
// +kubebuilder:resource:categories=liqo
// +kubebuilder:subresource:status

// GatewayClient is the Schema for the gatewayclient API.
// GatewayClient defines a gateway client that needs to point to a remote gateway server.
type GatewayClient struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand Down
7 changes: 3 additions & 4 deletions apis/networking/v1alpha1/gatewayserver_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,24 +62,23 @@ type EndpointStatus struct {
// Port specifies the port of the endpoint.
Port int32 `json:"port,omitempty"`
// Protocol specifies the protocol of the endpoint.
// +kubebuilder:default=TCP
// +kubebuilder:validation:Enum=TCP;UDP
Protocol corev1.Protocol `json:"protocol,omitempty"`
Protocol *corev1.Protocol `json:"protocol,omitempty"`
}

// GatewayServerStatus defines the observed state of GatewayServer.
type GatewayServerStatus struct {
// ServerRef specifies the reference to the server.
ServerRef corev1.ObjectReference `json:"serverRef,omitempty"`
// Endpoint specifies the endpoint of the tunnel.
Endpoint EndpointStatus `json:"endpoint,omitempty"`
Endpoint *EndpointStatus `json:"endpoint,omitempty"`
}

// +kubebuilder:object:root=true
// +kubebuilder:resource:categories=liqo
// +kubebuilder:subresource:status

// GatewayServer is the Schema for the gatewayserver API.
// GatewayServer defines a gateway server that remote gateway clients need to point to.
type GatewayServer struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion apis/networking/v1alpha1/publickey_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ type PublicKeySpec struct {
// +kubebuilder:object:root=true
// +kubebuilder:resource:categories=liqo

// PublicKey is the Schema for the publickey API.
// PublicKey contains a public key data required by some interconnection technologies.
type PublicKey struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion apis/networking/v1alpha1/wggatewayclient_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ type WgGatewayClientStatus struct {
// +kubebuilder:resource:categories=liqo
// +kubebuilder:subresource:status

// WgGatewayClient is the Schema for the wggatewayclient API.
// WgGatewayClient defines a wireguard gateway client that needs to point to a remote wireguard gateway server.
type WgGatewayClient struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion apis/networking/v1alpha1/wggatewayclienttemplate_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ type WgGatewayClientTemplateSpec struct {
// +kubebuilder:object:root=true
// +kubebuilder:resource:categories=liqo

// WgGatewayClientTemplate is the Schema for the wggatewayclienttemplate API.
// WgGatewayClientTemplate contains a template for a wireguard gateway client.
type WgGatewayClientTemplate struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion apis/networking/v1alpha1/wggatewayserver_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ type WgGatewayServerStatus struct {
// +kubebuilder:resource:categories=liqo
// +kubebuilder:subresource:status

// WgGatewayServer is the Schema for the wggatewayserver API.
// WgGatewayServer defines a wireguard gateway server that will accept connections from remote wireguard gateway clients.
type WgGatewayServer struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion apis/networking/v1alpha1/wggatewayservertemplate_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ type WgGatewayServerTemplateSpec struct {
// +kubebuilder:object:root=true
// +kubebuilder:resource:categories=liqo

// WgGatewayServerTemplate is the Schema for the wggatewayservertemplate API.
// WgGatewayServerTemplate contains a template for a wireguard gateway server.
type WgGatewayServerTemplate struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand Down
18 changes: 17 additions & 1 deletion apis/networking/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 23 additions & 4 deletions deployments/liqo/crds/networking.liqo.io_configurations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ spec:
- name: v1alpha1
schema:
openAPIV3Schema:
description: Configuration is the Schema for the configuration API.
description: Configuration contains the network configuration of a pair of
clusters, including the local and the remote pod and external CIDRs and
how the where remapped.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
Expand All @@ -38,7 +40,23 @@ spec:
description: ConfigurationSpec defines the desired state of Configuration.
properties:
local:
description: Local configuration.
description: Local network configuration (the cluster where the resource
is created).
properties:
cidr:
description: CIDR of the cluster.
properties:
external:
description: External CIDR of the cluster.
type: string
pod:
description: Pod CIDR of the cluster.
type: string
type: object
type: object
localRemapped:
description: LocalRemapped network configuration, it defines how the
remote cluster sees the local cluster.
properties:
cidr:
description: CIDR of the cluster.
Expand All @@ -52,7 +70,7 @@ spec:
type: object
type: object
remote:
description: Remote configuration.
description: Remote network configuration (the other cluster).
properties:
cidr:
description: CIDR of the cluster.
Expand All @@ -70,7 +88,8 @@ spec:
description: ConfigurationStatus defines the observed state of Configuration.
properties:
remote:
description: Remote remapped configuration.
description: Remote remapped configuration, it defines how the local
cluster sees the remote cluster.
properties:
cidr:
description: CIDR of the cluster.
Expand Down
7 changes: 3 additions & 4 deletions deployments/liqo/crds/networking.liqo.io_connections.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ spec:
- name: v1alpha1
schema:
openAPIV3Schema:
description: Connection is the Schema for the connection API.
description: Connection contains the status of a connection between two clusters
(a client and a server).
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
Expand Down Expand Up @@ -95,9 +96,7 @@ spec:
format: int32
type: integer
protocol:
allOf:
- default: TCP
- default: TCP
default: TCP
description: Protocol specifies the protocol of the endpoint.
enum:
- TCP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ spec:
- name: v1alpha1
schema:
openAPIV3Schema:
description: FirewallConfiguration is the Schema for the firewallconfiguration
API.
description: FirewallConfiguration contains a rule to be applied to the firewall
in the gateway.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
Expand Down
3 changes: 2 additions & 1 deletion deployments/liqo/crds/networking.liqo.io_gatewayclients.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ spec:
- name: v1alpha1
schema:
openAPIV3Schema:
description: GatewayClient is the Schema for the gatewayclient API.
description: GatewayClient defines a gateway client that needs to point to
a remote gateway server.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
Expand Down
7 changes: 3 additions & 4 deletions deployments/liqo/crds/networking.liqo.io_gatewayservers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ spec:
- name: v1alpha1
schema:
openAPIV3Schema:
description: GatewayServer is the Schema for the gatewayserver API.
description: GatewayServer defines a gateway server that remote gateway clients
need to point to.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
Expand Down Expand Up @@ -112,9 +113,7 @@ spec:
format: int32
type: integer
protocol:
allOf:
- default: TCP
- default: TCP
default: TCP
description: Protocol specifies the protocol of the endpoint.
enum:
- TCP
Expand Down
3 changes: 2 additions & 1 deletion deployments/liqo/crds/networking.liqo.io_publickeys.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ spec:
- name: v1alpha1
schema:
openAPIV3Schema:
description: PublicKey is the Schema for the publickey API.
description: PublicKey contains a public key data required by some interconnection
technologies.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ spec:
- name: v1alpha1
schema:
openAPIV3Schema:
description: WgGatewayClient is the Schema for the wggatewayclient API.
description: WgGatewayClient defines a wireguard gateway client that needs
to point to a remote wireguard gateway server.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ spec:
- name: v1alpha1
schema:
openAPIV3Schema:
description: WgGatewayClientTemplate is the Schema for the wggatewayclienttemplate
API.
description: WgGatewayClientTemplate contains a template for a wireguard gateway
client.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ spec:
- name: v1alpha1
schema:
openAPIV3Schema:
description: WgGatewayServer is the Schema for the wggatewayserver API.
description: WgGatewayServer defines a wireguard gateway server that will
accept connections from remote wireguard gateway clients.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
Expand Down Expand Up @@ -8973,9 +8974,7 @@ spec:
format: int32
type: integer
protocol:
allOf:
- default: TCP
- default: TCP
default: TCP
description: Protocol specifies the protocol of the endpoint.
enum:
- TCP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ spec:
- name: v1alpha1
schema:
openAPIV3Schema:
description: WgGatewayServerTemplate is the Schema for the wggatewayservertemplate
API.
description: WgGatewayServerTemplate contains a template for a wireguard gateway
server.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
Expand Down

0 comments on commit 9742f32

Please sign in to comment.