mirror of
https://github.com/YuzuZensai/netbird-kubernetes-operator.git
synced 2026-09-13 18:59:09 +00:00
Add network router and resource (#189)
This change adds two new resources, NetworkRouter and NetworkResource, which enable clusters to expose Kubernetes services to Netbird. The NetworkRouter is responsible for creating the network, group, setup key and routing peer all of which are unique to the isntance. Along with the deployment of the client in the cluster. The NetworkResource exposes a service by linking to the specific router it wants to expose to. This makes coupling between the resource and network easy to understand. Routers also set a DNS zone which is used to give names to resources based on the name and namespace of the service being exposed. Part of #172 Signed-off-by: Philip Laine <philip.laine@gmail.com>
This commit is contained in:
@@ -0,0 +1,85 @@
|
||||
// Code generated by controller-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
|
||||
)
|
||||
|
||||
// NetworkResourceStatusApplyConfiguration represents a declarative configuration of the NetworkResourceStatus type for use
|
||||
// with apply.
|
||||
//
|
||||
// NetworkResourceStatus defines the observed state of NetworkResource.
|
||||
type NetworkResourceStatusApplyConfiguration struct {
|
||||
// ObservedGeneration is the last reconciled generation.
|
||||
ObservedGeneration *int64 `json:"observedGeneration,omitempty"`
|
||||
// Conditions holds the conditions for the NetworkResource.
|
||||
Conditions []v1.ConditionApplyConfiguration `json:"conditions,omitempty"`
|
||||
// NetworkID is the id of the network the resource is created in.
|
||||
NetworkID *string `json:"networkID,omitempty"`
|
||||
// ResourceID is the id of the created resource.
|
||||
ResourceID *string `json:"resourceID,omitempty"`
|
||||
// DNSZoneID is the id of the zone the DNS record is created in.
|
||||
DNSZoneID *string `json:"dnsZoneID,omitempty"`
|
||||
// DNSRecordID is the id of the created DNS record.
|
||||
DNSRecordID *string `json:"dnsRecordID,omitempty"`
|
||||
}
|
||||
|
||||
// NetworkResourceStatusApplyConfiguration constructs a declarative configuration of the NetworkResourceStatus type for use with
|
||||
// apply.
|
||||
func NetworkResourceStatus() *NetworkResourceStatusApplyConfiguration {
|
||||
return &NetworkResourceStatusApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the ObservedGeneration field is set to the value of the last call.
|
||||
func (b *NetworkResourceStatusApplyConfiguration) WithObservedGeneration(value int64) *NetworkResourceStatusApplyConfiguration {
|
||||
b.ObservedGeneration = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithConditions adds the given value to the Conditions field in the declarative configuration
|
||||
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
|
||||
// If called multiple times, values provided by each call will be appended to the Conditions field.
|
||||
func (b *NetworkResourceStatusApplyConfiguration) WithConditions(values ...*v1.ConditionApplyConfiguration) *NetworkResourceStatusApplyConfiguration {
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithConditions")
|
||||
}
|
||||
b.Conditions = append(b.Conditions, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithNetworkID sets the NetworkID field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the NetworkID field is set to the value of the last call.
|
||||
func (b *NetworkResourceStatusApplyConfiguration) WithNetworkID(value string) *NetworkResourceStatusApplyConfiguration {
|
||||
b.NetworkID = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithResourceID sets the ResourceID field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the ResourceID field is set to the value of the last call.
|
||||
func (b *NetworkResourceStatusApplyConfiguration) WithResourceID(value string) *NetworkResourceStatusApplyConfiguration {
|
||||
b.ResourceID = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithDNSZoneID sets the DNSZoneID field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the DNSZoneID field is set to the value of the last call.
|
||||
func (b *NetworkResourceStatusApplyConfiguration) WithDNSZoneID(value string) *NetworkResourceStatusApplyConfiguration {
|
||||
b.DNSZoneID = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithDNSRecordID sets the DNSRecordID field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the DNSRecordID field is set to the value of the last call.
|
||||
func (b *NetworkResourceStatusApplyConfiguration) WithDNSRecordID(value string) *NetworkResourceStatusApplyConfiguration {
|
||||
b.DNSRecordID = &value
|
||||
return b
|
||||
}
|
||||
Reference in New Issue
Block a user