Skip to content

Commit 06157be

Browse files
authored
Merge branch 'nephio-project:main' into req-status
2 parents 16b6c5f + d477a29 commit 06157be

13 files changed

+2430
-1
lines changed

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ help: ## Display this help.
5050
manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
5151
$(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases
5252

53+
.PHONY: generate
54+
generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
55+
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."
56+
57+
5358
##@ Build Dependencies
5459

5560
## Location to install dependencies to

config/crd/bases/req.nephio.org_capacities.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ spec:
4141
throughput
4242
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
4343
x-kubernetes-int-or-string: true
44+
maxNFConnections:
45+
description: MaxNFConnections defines the max NF(s) that can be connected
46+
to this NF/device
47+
type: integer
4448
maxSessions:
4549
description: MaxSessions defines the max sessions of the control plane
4650
expressed in unit of 1000s

config/crd/bases/workload.nephio.org_amfdeployments.yaml

Lines changed: 400 additions & 0 deletions
Large diffs are not rendered by default.

config/crd/bases/workload.nephio.org_smfdeployments.yaml

Lines changed: 400 additions & 0 deletions
Large diffs are not rendered by default.

config/crd/bases/workload.nephio.org_upfdeployments.yaml

Lines changed: 400 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
/*
2+
Copyright 2023 The Nephio Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
package v1alpha1
17+
18+
import (
19+
"reflect"
20+
21+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
22+
"k8s.io/apimachinery/pkg/runtime/schema"
23+
)
24+
25+
// +kubebuilder:object:root=true
26+
// +kubebuilder:subresource:status
27+
type AMFDeployment struct {
28+
metav1.TypeMeta `json:",inline" yaml:",inline"`
29+
metav1.ObjectMeta `json:"metadata,omitempty" yaml:"metadata,omitempty"`
30+
31+
Spec AMFDeploymentSpec `json:"spec,omitempty" yaml:"spec,omitempty"`
32+
Status AMFDeploymentStatus `json:"status,omitempty" yaml:"status,omitempty"`
33+
}
34+
35+
// +kubebuilder:object:root=true
36+
// AMFDeploymentList contains a list of AMFDeployments
37+
type AMFDeploymentList struct {
38+
metav1.TypeMeta `json:",inline" yaml:",inline"`
39+
metav1.ListMeta `json:"metadata,omitempty" yaml:"metadata,omitempty"`
40+
Items []AMFDeployment `json:"items" yaml:"items"`
41+
}
42+
43+
type AMFDeploymentSpec struct {
44+
NFDeploymentSpec `json:",inline" yaml:",inline"`
45+
}
46+
47+
type AMFDeploymentStatus struct {
48+
NFDeploymentStatus `json:",inline" yaml:",inline"`
49+
}
50+
51+
// Interface type metadata.
52+
var (
53+
AMFDeploymentKind = reflect.TypeOf(AMFDeployment{}).Name()
54+
AMFDeploymentGroupKind = schema.GroupKind{Group: Group, Kind: AMFDeploymentKind}.String()
55+
AMFDeploymentKindAPIVersion = AMFDeploymentKind + "." + GroupVersion.String()
56+
AMFDeploymenteGroupVersionKind = GroupVersion.WithKind(AMFDeploymentKind)
57+
)
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*
2+
Copyright 2023 The Nephio Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
// Package v1alpha1 contains API Schema definitions for the ipam v1alpha1 API group
18+
// +kubebuilder:object:generate=true
19+
// +groupName=workload.nephio.org
20+
package v1alpha1
21+
22+
import (
23+
"k8s.io/apimachinery/pkg/runtime/schema"
24+
"sigs.k8s.io/controller-runtime/pkg/scheme"
25+
)
26+
27+
const (
28+
// Group in the kubernetes api
29+
Group = "workload.nephio.org"
30+
// Version in the kubernetes api
31+
Version = "v1alpha1"
32+
)
33+
34+
var (
35+
// GroupVersion is group version used to register these objects
36+
GroupVersion = schema.GroupVersion{Group: Group, Version: Version}
37+
38+
// SchemeBuilder is used to add go types to the GroupVersionKind scheme
39+
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}
40+
41+
// AddToScheme adds the types in this group-version to the given scheme.
42+
AddToScheme = SchemeBuilder.AddToScheme
43+
)
Lines changed: 186 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,186 @@
1+
/*
2+
Copyright 2023 The Nephio Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
package v1alpha1
17+
18+
import (
19+
nephioreqv1alpha1 "github.com/nephio-project/api/nf_requirements/v1alpha1"
20+
corev1 "k8s.io/api/core/v1"
21+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
22+
)
23+
24+
// NFDeploymentSpec defines the characteristics of a deployment of a network function
25+
type NFDeploymentSpec struct {
26+
// capacity defines the capacity characteristics of the NF deployment
27+
// +optional
28+
Capacity *nephioreqv1alpha1.CapacitySpec `json:"capacity,omitempty" yaml:"capacity,omitempty"`
29+
// Interfaces defines the interfaces associated with the NF deployment
30+
// +optional
31+
Interfaces []InterfaceConfig `json:"interfaces,omitempty" yaml:"interfaces,omitempty"`
32+
// NetworkInstances defines the network instances associated with the NF deployment
33+
// +optional
34+
NetworkInstances []NetworkInstance `json:"networkInstances,omitempty" yaml:"networkInstances,omitempty"`
35+
// configRef defines addiitonal configuration references the nf depends upon
36+
// +optional
37+
ConfigRefs []corev1.ObjectReference `json:"configRefs,omitempty" yaml:"configRefs,omitempty"`
38+
}
39+
40+
// InterfaceConfig defines the configuration of the interface
41+
type InterfaceConfig struct {
42+
// Name defines the name of the interface
43+
//
44+
// +kubebuilder:validation:MinLength=1
45+
// +kubebuilder:validation:MaxLength=253
46+
Name string `json:"name" yaml:"name"`
47+
// IPv4 defines the ipv4 configuration of the interface
48+
// +optional
49+
IPv4 *IPv4 `json:"ipv4,omitempty" yaml:"ipv4,omitempty"`
50+
// IPv6Config defines the ipv6 configuration of the interface
51+
// +optional
52+
IPv6 *IPv6 `json:"ipv6,omitempty" yaml:"ipv6,omitempty"`
53+
// VLANID defines the specific vlan id associated on this interface
54+
// +optional
55+
VLANID *uint16 `json:"vlanID,omitempty" yaml:"vlanID,omitempty"`
56+
}
57+
58+
// IPv4 defines the configuration parameters of an ipv4 interface or peer
59+
type IPv4 struct {
60+
// Address defines the IPv4 address and prefix length in CIDR notation
61+
// [IP prefix, range IPv4 with host bits]
62+
Address string `json:"address" yaml:"address"`
63+
// Gateway defines the IPv4 address associated to the interface as a gateway
64+
// +optional
65+
Gateway *string `json:"gateway,omitempty" yaml:"gateway,omitempty"`
66+
}
67+
68+
// IPv6 defines the configuration parameters of an ipv6 interface or peer
69+
type IPv6 struct {
70+
// Address defines the IPv6 address and prefix length in CIDR notation
71+
// [IP prefix, range IPv6 with host bits]
72+
Address string `json:"address" yaml:"address"`
73+
// Gateway defines the IPv6 address associated to the interface as a gateway
74+
// +optional
75+
Gateway *string `json:"gateway,omitempty" yaml:"gateway,omitempty"`
76+
}
77+
78+
// A networkInstance is a Layer 3 forwarding construct
79+
// such as a virtual routing and forwarding (VRF) instance,
80+
type NetworkInstance struct {
81+
// Name defines the name of the network instance
82+
//
83+
// +kubebuilder:validation:MinLength=1
84+
// +kubebuilder:validation:MaxLength=253
85+
Name string `json:"name" yaml:"name"`
86+
// interfaces defines the interfaces associated with the network instance
87+
// +optional
88+
Interfaces []string `json:"interfaces,omitempty" yaml:"interfaces,omitempty"`
89+
// Peers defines the peer configuration associated with the network instance
90+
// +optional
91+
Peers []PeerConfig `json:"peers,omitempty" yaml:"peers,omitempty"`
92+
// DataNetworks defines the data networks assocated with the network instance
93+
// +optional
94+
DataNetworks []DataNetwork `json:"dataNetworks,omitempty" yaml:"dataNetworks,omitempty"`
95+
// BGP defines the BGP configuration associated with the network instance
96+
// +optional
97+
BGP *BGPConfig `json:"bgp,omitempty" yaml:"bgp,omitempty"`
98+
}
99+
100+
// A PeerConfig defines the peer configuration
101+
type PeerConfig struct {
102+
// Name defines the name of the data network
103+
//
104+
// +kubebuilder:validation:MinLength=1
105+
// +kubebuilder:validation:MaxLength=253
106+
Name *string `json:"name,omitempty" yaml:"name,omitempty"`
107+
// IPv4 defines the ipv4 configuration of the peer
108+
// +optional
109+
IPv4 *IPv4 `json:"ipv4,omitempty" yaml:"ipv4,omitempty"`
110+
// IPv6 defines the ipv6 configuration of the peer
111+
// +optional
112+
IPv6 *IPv6 `json:"ipv6,omitempty" yaml:"ipv6,omitempty"`
113+
}
114+
115+
// A DataNetwork defines the Data Network name defined by 3GPP
116+
type DataNetwork struct {
117+
// Name defines the name of the data network
118+
//
119+
// +kubebuilder:validation:MinLength=1
120+
// +kubebuilder:validation:MaxLength=253
121+
Name *string `json:"name,omitempty" yaml:"name,omitempty"`
122+
// Pool defines the list of address pools associated with the data network
123+
// +optional
124+
Pool []Pool `json:"pool,omitempty" yaml:"pool,omitempty"`
125+
}
126+
127+
type Pool struct {
128+
// Prefix defines the ip cidr in prefix notation. It is defines as a subnet
129+
// +kubebuilder:validation:Pattern=`(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))|((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))`
130+
Prefix string `json:"prefix" yaml:"prefix"`
131+
}
132+
133+
// BGPConfig specifies parameters for BGP related configuration for UPF and SMF
134+
type BGPConfig struct {
135+
// RouterID defines the router ID of the bgp process
136+
RouterID string `json:"routerID" yaml:"routerID"`
137+
// AutonomousSystem defines the AS number of the bgp process
138+
AutonomousSystem int `json:"autonomousSystem" yaml:"autonomousSystem"`
139+
// BGPNeigbors defines the configuration of the BGP neighbor
140+
BGPNeigbors []BGPNeighbor `json:"bgpNeighbors" yaml:"bgpNeighbors"`
141+
}
142+
143+
type BGPNeighbor struct {
144+
// Address defines the IPv4 or IPv6 address of the BGP neighbor
145+
Address string `json:"address" yaml:"address"`
146+
// BGP interface name, MUST match the one use in InterfaceConfig
147+
Name *string `json:"name,omitempty" yaml:"name,omitempty"`
148+
// PeerAS defines the AS number of the bgp peer
149+
PeerAS int `json:"peerAS" yaml:"peerAS"`
150+
}
151+
152+
// NFDeploymentStatus defines the observed state of nf deployment
153+
type NFDeploymentStatus struct {
154+
// The generation observed by the deployment controller.
155+
ObservedGeneration int32 `json:"observedGeneration" yaml:"observedGeneration"`
156+
// Conditions define the current state of the NF deployment
157+
Conditions []metav1.Condition `json:"conditions,omitempty" yaml:"conditions,omitempty"`
158+
}
159+
160+
type NFDeploymentConditionType string
161+
162+
const (
163+
// Reconciling implies that the deployment is progressing.
164+
// Reconciliation for a deployment is considered when a new version
165+
// is adopted, when new pods scale up or old pods scale down, or when
166+
// required peering is in progress.
167+
// Condition name follows Kpt guidelines.
168+
Reconciling NFDeploymentConditionType = "Reconciling"
169+
// Deployment is unable to make progress towards Reconciliation.
170+
// Reasons could be Pod creation failure, Peering failure etc.
171+
// Condition name follows Kpt guidelines.
172+
Stalled NFDeploymentConditionType = "Stalled"
173+
// The Deployment is considered available when following conditions hold:
174+
// 1. At-least the minimal set of Pods are up and running for at-least
175+
//minReadySeconds.
176+
// 2. The Deployment is ready for required peering.
177+
Available NFDeploymentConditionType = "Available"
178+
// The Deployment is making progress towards peering on the required
179+
// interfaces. A successful peering implies that the NF is reachable by
180+
// the required peers and is a able to reach them.
181+
Peering NFDeploymentConditionType = "Peering"
182+
// The Deployment is available and has peered successfully on required
183+
// interfaces.
184+
// At this stage, the deployment is ready to serve requests.
185+
Ready NFDeploymentConditionType = "Ready"
186+
)
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
/*
2+
Copyright 2023 The Nephio Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
package v1alpha1
17+
18+
import (
19+
"reflect"
20+
21+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
22+
"k8s.io/apimachinery/pkg/runtime/schema"
23+
)
24+
25+
//+kubebuilder:object:root=true
26+
//+kubebuilder:subresource:status
27+
28+
type SMFDeployment struct {
29+
metav1.TypeMeta `json:",inline" yaml:",inline"`
30+
metav1.ObjectMeta `json:"metadata,omitempty" yaml:"metadata,omitempty"`
31+
32+
Spec SMFDeploymentSpec `json:"spec,omitempty" yaml:"spec,omitempty"`
33+
Status SMFDeploymentStatus `json:"status,omitempty" yaml:"status,omitempty"`
34+
}
35+
36+
//+kubebuilder:object:root=true
37+
38+
// SMFDeploymentList contains a list of SMFDeployments
39+
type SMFDeploymentList struct {
40+
metav1.TypeMeta `json:",inline" yaml:",inline"`
41+
metav1.ListMeta `json:"metadata,omitempty" yaml:"metadata,omitempty"`
42+
Items []SMFDeployment `json:"items" yaml:"items"`
43+
}
44+
45+
type SMFDeploymentSpec struct {
46+
NFDeploymentSpec `json:",inline" yaml:",inline"`
47+
}
48+
49+
type SMFDeploymentStatus struct {
50+
NFDeploymentStatus `json:",inline" yaml:",inline"`
51+
}
52+
53+
// Interface type metadata.
54+
var (
55+
SMFDeploymentKind = reflect.TypeOf(SMFDeployment{}).Name()
56+
SMFDeploymentGroupKind = schema.GroupKind{Group: Group, Kind: SMFDeploymentKind}.String()
57+
SMFDeploymentKindAPIVersion = SMFDeploymentKind + "." + GroupVersion.String()
58+
SMFDeploymenteGroupVersionKind = GroupVersion.WithKind(SMFDeploymentKind)
59+
)

0 commit comments

Comments
 (0)