-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
integrate external network with peering
- Loading branch information
Showing
4 changed files
with
304 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
// Copyright 2019-2023 The Liqo Authors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package v1alpha1 | ||
|
||
import ( | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
"k8s.io/apimachinery/pkg/runtime/schema" | ||
) | ||
|
||
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! | ||
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. | ||
|
||
// ExternalNetworkResource the name of the external network resources. | ||
var ExternalNetworkResource = "externalnetworks" | ||
|
||
// ExternalNetworkKind is the kind name used to register the ExternalNetwork CRD. | ||
var ExternalNetworkKind = "ExternalNetwork" | ||
|
||
// ExternalNetworkGroupResource is group resource used to register these objects. | ||
var ExternalNetworkGroupResource = schema.GroupResource{Group: GroupVersion.Group, Resource: ExternalNetworkResource} | ||
|
||
// ExternalNetworkGroupVersionResource is groupResourceVersion used to register these objects. | ||
var ExternalNetworkGroupVersionResource = GroupVersion.WithResource(ExternalNetworkResource) | ||
|
||
// ExternalNetworkSpec defines the desired state of ExternalNetworks. | ||
type ExternalNetworkSpec struct { | ||
// Configuration contains the configuration for the originating cluster. | ||
Configuration *ConfigurationSpec `json:"configuration,omitempty"` | ||
} | ||
|
||
// ExternalNetworkStatus defines the observed state of ExternalNetworks. | ||
type ExternalNetworkStatus struct { | ||
// Configuration contains the configuration for the target cluster. | ||
Configuration *ConfigurationSpec `json:"configuration,omitempty"` | ||
} | ||
|
||
// +kubebuilder:object:root=true | ||
// +kubebuilder:resource:categories=liqo | ||
// +kubebuilder:subresource:status | ||
|
||
// ExternalNetwork is used to share information about the network configuration of a | ||
// peer of clusters. It is replicated by the CRD replicator. | ||
type ExternalNetwork struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Spec ExternalNetworkSpec `json:"spec,omitempty"` | ||
Status ExternalNetworkStatus `json:"status,omitempty"` | ||
} | ||
|
||
// +kubebuilder:object:root=true | ||
|
||
// ExternalNetworkList contains a list of ExternalNetworks. | ||
type ExternalNetworkList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []ExternalNetwork `json:"items"` | ||
} | ||
|
||
func init() { | ||
SchemeBuilder.Register(&ExternalNetwork{}, &ExternalNetworkList{}) | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
125 changes: 125 additions & 0 deletions
125
deployments/liqo/charts/liqo-crds/crds/networking.liqo.io_externalnetworks.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
--- | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
annotations: | ||
controller-gen.kubebuilder.io/version: v0.13.0 | ||
name: externalnetworks.networking.liqo.io | ||
spec: | ||
group: networking.liqo.io | ||
names: | ||
categories: | ||
- liqo | ||
kind: ExternalNetwork | ||
listKind: ExternalNetworkList | ||
plural: externalnetworks | ||
singular: externalnetwork | ||
scope: Namespaced | ||
versions: | ||
- name: v1alpha1 | ||
schema: | ||
openAPIV3Schema: | ||
description: ExternalNetwork is used to share information about the network | ||
configuration of a peer of clusters. It is replicated by the CRD replicator. | ||
properties: | ||
apiVersion: | ||
description: 'APIVersion defines the versioned schema of this representation | ||
of an object. Servers should convert recognized schemas to the latest | ||
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' | ||
type: string | ||
kind: | ||
description: 'Kind is a string value representing the REST resource this | ||
object represents. Servers may infer this from the endpoint the client | ||
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' | ||
type: string | ||
metadata: | ||
type: object | ||
spec: | ||
description: ExternalNetworkSpec defines the desired state of ExternalNetworks. | ||
properties: | ||
configuration: | ||
description: Configuration contains the configuration for the originating | ||
cluster. | ||
properties: | ||
local: | ||
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. | ||
pattern: ^(([1-9]{0,1}[0-9]{0,2}|2[0-4][0-9]|25[0-5])\.){3}([1-9]{0,1}[0-9]{0,2}|2[0-4][0-9]|25[0-5])\/([0-9]|[1-2][0-9]|3[0-2])$ | ||
type: string | ||
pod: | ||
description: Pod CIDR of the cluster. | ||
pattern: ^(([1-9]{0,1}[0-9]{0,2}|2[0-4][0-9]|25[0-5])\.){3}([1-9]{0,1}[0-9]{0,2}|2[0-4][0-9]|25[0-5])\/([0-9]|[1-2][0-9]|3[0-2])$ | ||
type: string | ||
type: object | ||
type: object | ||
remote: | ||
description: Remote network configuration (the other cluster). | ||
properties: | ||
cidr: | ||
description: CIDR of the cluster. | ||
properties: | ||
external: | ||
description: External CIDR of the cluster. | ||
pattern: ^(([1-9]{0,1}[0-9]{0,2}|2[0-4][0-9]|25[0-5])\.){3}([1-9]{0,1}[0-9]{0,2}|2[0-4][0-9]|25[0-5])\/([0-9]|[1-2][0-9]|3[0-2])$ | ||
type: string | ||
pod: | ||
description: Pod CIDR of the cluster. | ||
pattern: ^(([1-9]{0,1}[0-9]{0,2}|2[0-4][0-9]|25[0-5])\.){3}([1-9]{0,1}[0-9]{0,2}|2[0-4][0-9]|25[0-5])\/([0-9]|[1-2][0-9]|3[0-2])$ | ||
type: string | ||
type: object | ||
type: object | ||
type: object | ||
type: object | ||
status: | ||
description: ExternalNetworkStatus defines the observed state of ExternalNetworks. | ||
properties: | ||
configuration: | ||
description: Configuration contains the configuration for the target | ||
cluster. | ||
properties: | ||
local: | ||
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. | ||
pattern: ^(([1-9]{0,1}[0-9]{0,2}|2[0-4][0-9]|25[0-5])\.){3}([1-9]{0,1}[0-9]{0,2}|2[0-4][0-9]|25[0-5])\/([0-9]|[1-2][0-9]|3[0-2])$ | ||
type: string | ||
pod: | ||
description: Pod CIDR of the cluster. | ||
pattern: ^(([1-9]{0,1}[0-9]{0,2}|2[0-4][0-9]|25[0-5])\.){3}([1-9]{0,1}[0-9]{0,2}|2[0-4][0-9]|25[0-5])\/([0-9]|[1-2][0-9]|3[0-2])$ | ||
type: string | ||
type: object | ||
type: object | ||
remote: | ||
description: Remote network configuration (the other cluster). | ||
properties: | ||
cidr: | ||
description: CIDR of the cluster. | ||
properties: | ||
external: | ||
description: External CIDR of the cluster. | ||
pattern: ^(([1-9]{0,1}[0-9]{0,2}|2[0-4][0-9]|25[0-5])\.){3}([1-9]{0,1}[0-9]{0,2}|2[0-4][0-9]|25[0-5])\/([0-9]|[1-2][0-9]|3[0-2])$ | ||
type: string | ||
pod: | ||
description: Pod CIDR of the cluster. | ||
pattern: ^(([1-9]{0,1}[0-9]{0,2}|2[0-4][0-9]|25[0-5])\.){3}([1-9]{0,1}[0-9]{0,2}|2[0-4][0-9]|25[0-5])\/([0-9]|[1-2][0-9]|3[0-2])$ | ||
type: string | ||
type: object | ||
type: object | ||
type: object | ||
type: object | ||
type: object | ||
served: true | ||
storage: true | ||
subresources: | ||
status: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters