diff --git a/apis/network/v1alpha1/common_types.go b/apis/network/v1alpha1/common_types.go index 249672cde..c56b6c8c0 100644 --- a/apis/network/v1alpha1/common_types.go +++ b/apis/network/v1alpha1/common_types.go @@ -23,12 +23,14 @@ import ( // * a v1alpha1.Machine // * a Gateway // * a ReservedIP +// * a Subnet // * a raw IP // * a raw CIDR. type Target struct { Machine *MachineRouteTarget `json:"machine,omitempty"` Gateway *corev1.LocalObjectReference `json:"gateway,omitempty"` ReservedIP *corev1.LocalObjectReference `json:"reservedIP,omitempty"` + Subnet *corev1.LocalObjectReference `json:"subnet,omitempty"` IP string `json:"ip,omitempty"` CIDR string `json:"cidr,omitempty"` } diff --git a/apis/network/v1alpha1/zz_generated.deepcopy.go b/apis/network/v1alpha1/zz_generated.deepcopy.go index 182c50783..cc226888b 100644 --- a/apis/network/v1alpha1/zz_generated.deepcopy.go +++ b/apis/network/v1alpha1/zz_generated.deepcopy.go @@ -1823,6 +1823,11 @@ func (in *Target) DeepCopyInto(out *Target) { *out = new(v1.LocalObjectReference) **out = **in } + if in.Subnet != nil { + in, out := &in.Subnet, &out.Subnet + *out = new(v1.LocalObjectReference) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Target. diff --git a/config/crd/bases/network.onmetal.de_gateways.yaml b/config/crd/bases/network.onmetal.de_gateways.yaml index b1d8ced76..287cfe195 100644 --- a/config/crd/bases/network.onmetal.de_gateways.yaml +++ b/config/crd/bases/network.onmetal.de_gateways.yaml @@ -121,6 +121,15 @@ spec: TODO: Add other useful fields. apiVersion, kind, uid?' type: string type: object + subnet: + description: LocalObjectReference contains enough information + to let you locate the referenced object inside the same namespace. + properties: + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + type: object type: object required: - mode diff --git a/config/crd/bases/network.onmetal.de_routingdomains.yaml b/config/crd/bases/network.onmetal.de_routingdomains.yaml index cae7b7811..f02244330 100644 --- a/config/crd/bases/network.onmetal.de_routingdomains.yaml +++ b/config/crd/bases/network.onmetal.de_routingdomains.yaml @@ -105,6 +105,16 @@ spec: TODO: Add other useful fields. apiVersion, kind, uid?' type: string type: object + subnet: + description: LocalObjectReference contains enough information + to let you locate the referenced object inside the same + namespace. + properties: + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + type: object type: object type: object type: array diff --git a/config/samples/compute_v1alpha1_machine.yaml b/config/samples/compute_v1alpha1_machine.yaml index d011b6b0d..df41ff131 100644 --- a/config/samples/compute_v1alpha1_machine.yaml +++ b/config/samples/compute_v1alpha1_machine.yaml @@ -15,7 +15,7 @@ spec: - name: myinterface priority: 0 # optional target: - name: mySubnetName + name: subnet-sample securityGroups: - name: mysecgroup1 volumeAttachments: diff --git a/config/samples/network_v1alpha1_gateway.yaml b/config/samples/network_v1alpha1_gateway.yaml index b13dc8dfd..21d31fe0b 100644 --- a/config/samples/network_v1alpha1_gateway.yaml +++ b/config/samples/network_v1alpha1_gateway.yaml @@ -7,8 +7,5 @@ spec: uplink: subnet: name: subnet-sample -#status: -# state: Up -# ips: -# - 35.0.0.1 - + subnet: + name: subnet-sample-1 diff --git a/config/samples/storage_v1alpha1_volume.yaml b/config/samples/storage_v1alpha1_volume.yaml index 89d9eb42f..b705535be 100644 --- a/config/samples/storage_v1alpha1_volume.yaml +++ b/config/samples/storage_v1alpha1_volume.yaml @@ -3,7 +3,7 @@ kind: Volume metadata: name: volume-sample spec: - storageClass: + storageClassRef: name: storageclass-sample storagePool: name: storagepool-sample diff --git a/config/samples/storage_v1alpha1_volumeclaim.yaml b/config/samples/storage_v1alpha1_volumeclaim.yaml index bca08a6f8..7ebed0b57 100644 --- a/config/samples/storage_v1alpha1_volumeclaim.yaml +++ b/config/samples/storage_v1alpha1_volumeclaim.yaml @@ -3,5 +3,9 @@ kind: VolumeClaim metadata: name: volumeclaim-sample spec: + storageClassRef: + name: storageclass-sample volumeRef: name: volume-sample + resources: + storage: 100Gi diff --git a/config/samples/subnet_machine_interface_flow.yaml b/config/samples/subnet_machine_interface_flow.yaml index 1e58c85cc..94205aca3 100644 --- a/config/samples/subnet_machine_interface_flow.yaml +++ b/config/samples/subnet_machine_interface_flow.yaml @@ -1,15 +1,15 @@ apiVersion: network.onmetal.de/v1alpha1 kind: RoutingDomain metadata: - name: routingdomain-sample + name: routingdomain-sample-1 --- apiVersion: network.onmetal.de/v1alpha1 kind: Subnet metadata: - name: subnet-sample + name: subnet-sample-1 spec: routingDomain: - name: routingdomain-sample + name: routingdomain-sample-1 ranges: - cidr: 192.168.0.0/24 --- @@ -24,7 +24,7 @@ data: apiVersion: compute.onmetal.de/v1alpha1 kind: Machine metadata: - name: machine-sample + name: machine-sample-1 spec: hostname: myhost machineClass: @@ -38,10 +38,10 @@ spec: - name: myinterface priority: 0 # optional target: - name: subnet-sample + name: subnet-sample-1 - name: myotherinterface target: - name: subnet-sample + name: subnet-sample-1 securityGroups: - name: mysecgroup1 ignition: @@ -68,7 +68,7 @@ spec: - name: myinterface priority: 0 # optional target: - name: subnet-sample + name: subnet-sample-1 securityGroups: - name: mysecgroup1 ignition: