-
Notifications
You must be signed in to change notification settings - Fork 585
config: add Network type #141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,20 +13,56 @@ type Network struct { | |
| // Standard object's metadata. | ||
| metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
|
||
| // spec holds user settable values for configuration | ||
| // spec holds user settable values for configuration. | ||
| Spec NetworkSpec `json:"spec"` | ||
| // status holds observed values from the cluster. They may not be overridden. | ||
| Status NetworkStatus `json:"status"` | ||
| } | ||
|
|
||
| // NetworkSpec is the desired network configuration. | ||
| // As a general rule, this SHOULD NOT be read directly. Instead, you should | ||
| // consume the NetworkStatus, as it indicates the currently deployed configuration. | ||
| // Currently, none of these fields may be changed after installation. | ||
| type NetworkSpec struct { | ||
| // serviceCIDR | ||
| // servicePortRange | ||
| // vxlanPort | ||
| // ClusterNetworks []ClusterNetworkEntry `json:"clusterNetworks"` | ||
| // IP address pool to use for pod IPs. | ||
| ClusterNetwork []ClusterNetworkEntry `json:"clusterNetwork"` | ||
|
|
||
| // IP address pool for services. | ||
| // Currently, we only support a single entry here. | ||
| ServiceNetwork []string `json:"serviceNetwork"` | ||
|
|
||
| // NetworkType is the plugin that is to be deployed (e.g. OpenShiftSDN). | ||
| // This should match a value that the cluster-network-operator understands, | ||
| // or else no networking will be installed. | ||
| // Currently supported values are: | ||
| // - OpenShiftSDN | ||
| NetworkType string `json:"networkType"` | ||
| } | ||
|
|
||
| // NetworkStatus is the current network configuration. | ||
| type NetworkStatus struct { | ||
| // IP address pool to use for pod IPs. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure when
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we require
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
We need it when we're reconciling the workload resources to a particular level. I don't anticipate seeing it in these types. |
||
| ClusterNetwork []ClusterNetworkEntry `json:"clusterNetwork"` | ||
|
|
||
| // IP address pool for services. | ||
| // Currently, we only support a single entry here. | ||
| ServiceNetwork []string `json:"serviceNetwork"` | ||
|
|
||
| // NetworkType is the plugin that is deployed (e.g. OpenShiftSDN). | ||
| NetworkType string `json:"networkType"` | ||
|
|
||
| // ClusterNetworkMTU is the MTU for inter-pod networking. | ||
| ClusterNetworkMTU int `json:"clusterNetworkMTU"` | ||
| } | ||
|
|
||
| // ClusterNetworkEntry is a contiguous block of IP addresses from which pod IPs | ||
| // are allocated. | ||
| type ClusterNetworkEntry struct { | ||
| // The complete block for pod IPs. | ||
| CIDR string `json:"cidr"` | ||
|
|
||
| // The size (prefix) of block to allocate to each node. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe explicitly note that this is the inverse of the 3.x "HostSubnetLength" |
||
| HostPrefix uint32 `json:"hostPrefix"` | ||
| } | ||
|
|
||
| // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to explain what the set of possible values is or at least indicate where the canonical list is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: specify that the change is not supported after installation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just making this a type and create constants matching the possible values. This will limit the scope of errors. We this in several places already.