-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added the networkconfig.liqonet.liqo.io CRD to the network api
Refactoring of the network api
- Loading branch information
Showing
22 changed files
with
413 additions
and
15 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
File renamed without changes.
File renamed without changes.
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,35 @@ | ||
/* | ||
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 contains API Schema definitions for the liqonetliqoio v1alpha1 API group | ||
// +kubebuilder:object:generate=true | ||
// +groupName=liqonet.liqo.io | ||
package v1alpha1 | ||
|
||
import ( | ||
"k8s.io/apimachinery/pkg/runtime/schema" | ||
"sigs.k8s.io/controller-runtime/pkg/scheme" | ||
) | ||
|
||
var ( | ||
// GroupVersion is group version used to register these objects | ||
GroupVersion = schema.GroupVersion{Group: "liqonet.liqo.io", Version: "v1alpha1"} | ||
|
||
// 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 | ||
) |
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,73 @@ | ||
/* | ||
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" | ||
) | ||
|
||
// 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. | ||
|
||
// NetworkConfigSpec defines the desired state of NetworkConfig | ||
type NetworkConfigSpec struct { | ||
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster | ||
// Important: Run "make" to regenerate code after modifying this file | ||
//the ID of the remote cluster that will receive this CRD | ||
ClusterID string `json:"clusterID"` | ||
//network subnet used in the local cluster for the pod IPs | ||
PodCIDR string `json:"podCIDR"` | ||
//public IP of the node where the VPN tunnel is created | ||
TunnelPublicIP string `json:"tunnelPublicIP"` | ||
//the IP address of the node in the private VPN subnet | ||
TunnelPrivateIP string `json:"tunnelPrivateIP"` | ||
} | ||
|
||
// NetworkConfigStatus defines the observed state of NetworkConfig | ||
type NetworkConfigStatus struct { | ||
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster | ||
// Important: Run "make" to regenerate code after modifying this file | ||
//indicates if the NAT is enabled for the remote cluster | ||
NATEnabled bool `json:"natEnabled,omitempty"` | ||
//the new subnet used to NAT the pods' subnet of the remote cluster | ||
PodCIDRNAT string `json:"podCIDRNAT,omitempty"` | ||
} | ||
|
||
// +kubebuilder:object:root=true | ||
// +kubebuilder:subresource:status | ||
// +kubebuilder:resource:scope=Cluster | ||
|
||
// NetworkConfig is the Schema for the networkconfigs API | ||
type NetworkConfig struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Spec NetworkConfigSpec `json:"spec,omitempty"` | ||
Status NetworkConfigStatus `json:"status,omitempty"` | ||
} | ||
|
||
// +kubebuilder:object:root=true | ||
|
||
// NetworkConfigList contains a list of NetworkConfig | ||
type NetworkConfigList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []NetworkConfig `json:"items"` | ||
} | ||
|
||
func init() { | ||
SchemeBuilder.Register(&NetworkConfig{}, &NetworkConfigList{}) | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
83 changes: 83 additions & 0 deletions
83
config/liqonet/crd/bases/liqonet.liqo.io_networkconfigs.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,83 @@ | ||
|
||
--- | ||
apiVersion: apiextensions.k8s.io/v1beta1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
annotations: | ||
controller-gen.kubebuilder.io/version: v0.2.5 | ||
creationTimestamp: null | ||
name: networkconfigs.liqonet.liqo.io | ||
spec: | ||
group: liqonet.liqo.io | ||
names: | ||
kind: NetworkConfig | ||
listKind: NetworkConfigList | ||
plural: networkconfigs | ||
singular: networkconfig | ||
scope: Cluster | ||
subresources: | ||
status: {} | ||
validation: | ||
openAPIV3Schema: | ||
description: NetworkConfig is the Schema for the networkconfigs API | ||
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: NetworkConfigSpec defines the desired state of NetworkConfig | ||
properties: | ||
clusterID: | ||
description: 'INSERT ADDITIONAL SPEC FIELDS - desired state of cluster | ||
Important: Run "make" to regenerate code after modifying this file | ||
the ID of the remote cluster that will receive this CRD' | ||
type: string | ||
podCIDR: | ||
description: network subnet used in the local cluster for the pod IPs | ||
type: string | ||
tunnelPrivateIP: | ||
description: the IP address of the node in the private VPN subnet | ||
type: string | ||
tunnelPublicIP: | ||
description: public IP of the node where the VPN tunnel is created | ||
type: string | ||
required: | ||
- clusterID | ||
- podCIDR | ||
- tunnelPrivateIP | ||
- tunnelPublicIP | ||
type: object | ||
status: | ||
description: NetworkConfigStatus defines the observed state of NetworkConfig | ||
properties: | ||
natEnabled: | ||
description: 'INSERT ADDITIONAL STATUS FIELD - define observed state | ||
of cluster Important: Run "make" to regenerate code after modifying | ||
this file indicates if the NAT is enabled for the remote cluster' | ||
type: boolean | ||
podCIDRNAT: | ||
description: the new subnet used to NAT the pods' subnet of the remote | ||
cluster | ||
type: string | ||
type: object | ||
type: object | ||
version: v1alpha1 | ||
versions: | ||
- name: v1alpha1 | ||
served: true | ||
storage: true | ||
status: | ||
acceptedNames: | ||
kind: "" | ||
plural: "" | ||
conditions: [] | ||
storedVersions: [] |
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
Oops, something went wrong.