Skip to content

Commit 060b43b

Browse files
Merge pull request #16561 from danwinship/auto-egress-ip
Automatic merge from submit-queue. Semi-automatic egress IP This is the first half of the automatic egress IP work; it handles routing traffic through egress IPs, but not the assigning of IPs to nodes, which must be done manually by the administrator at this point (by editing the HostSubnet records; in the future the SDN master will do this automatically based on annotations on the Node records). The set of Egress IPs active on a node was stored in HostSubnet rather than Node because (a) there are no upstream compatibility issues to deal with that way, and (b) nodes already have a HostSubnet watch, but not a Node watch. (And Node statuses change constantly, while HostSubnets are much more low-bandwidth.) Oh, the other thing that's there for future expansion is that a NetNamespace can have an array of EgressIPs, but only the first one gets used. In the future we will likely support multiple IPs, either at the same time, or sequentially failing over. @openshift/sig-networking PTAL
2 parents 2af8e92 + 7d92222 commit 060b43b

27 files changed

+1106
-123
lines changed

api/docs/apis-network.openshift.io/v1.HostSubnet.adoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ Expand or mouse-over a field for more information about it.
1919
++++
2020
<pre>
2121
<div style="margin-left:13px;"><span title="(string) 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/api-conventions.md#resources">apiVersion</span>:
22-
</div><div style="margin-left:13px;"><span title="(string) Host is the name of the node. (This is the same as the object&#39;s name, but both fields must be set.)">host</span>:
22+
</div><details><summary><span title="(array) EgressIPs is the list of automatic egress IP addresses currently hosted by this node">egressIPs</span>:
23+
</summary><div style="margin-left:13px;">- <span title="(string)">[string]</span>:
24+
</div></details><div style="margin-left:13px;"><span title="(string) Host is the name of the node. (This is the same as the object&#39;s name, but both fields must be set.)">host</span>:
2325
</div><div style="margin-left:13px;"><span title="(string) HostIP is the IP address to be used as a VTEP by other nodes in the overlay network">hostIP</span>:
2426
</div><div style="margin-left:13px;"><span title="(string) 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/api-conventions.md#types-kinds">kind</span>:
2527
</div><details open><summary><span title="(v1.ObjectMeta) Standard object&#39;s metadata.">metadata</span>:

api/docs/apis-network.openshift.io/v1.NetNamespace.adoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ Expand or mouse-over a field for more information about it.
1919
++++
2020
<pre>
2121
<div style="margin-left:13px;"><span title="(string) 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/api-conventions.md#resources">apiVersion</span>:
22-
</div><div style="margin-left:13px;"><span title="(string) 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/api-conventions.md#types-kinds">kind</span>:
22+
</div><details><summary><span title="(array) EgressIPs is a list of reserved IPs that will be used as the source for external traffic coming from pods in this namespace. (If empty, external traffic will be masqueraded to Node IPs.)">egressIPs</span>:
23+
</summary><div style="margin-left:13px;">- <span title="(string)">[string]</span>:
24+
</div></details><div style="margin-left:13px;"><span title="(string) 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/api-conventions.md#types-kinds">kind</span>:
2325
</div><details open><summary><span title="(v1.ObjectMeta) Standard object&#39;s metadata.">metadata</span>:
2426
</summary><details><summary> <span title="(object) Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations">annotations</span>:
2527
</summary><div style="margin-left:13px;"> <span title="(string)">[string]</span>:

api/docs/oapi/v1.HostSubnet.adoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ Expand or mouse-over a field for more information about it.
1919
++++
2020
<pre>
2121
<div style="margin-left:13px;"><span title="(string) 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/api-conventions.md#resources">apiVersion</span>:
22-
</div><div style="margin-left:13px;"><span title="(string) Host is the name of the node. (This is the same as the object&#39;s name, but both fields must be set.)">host</span>:
22+
</div><details><summary><span title="(array) EgressIPs is the list of automatic egress IP addresses currently hosted by this node">egressIPs</span>:
23+
</summary><div style="margin-left:13px;">- <span title="(string)">[string]</span>:
24+
</div></details><div style="margin-left:13px;"><span title="(string) Host is the name of the node. (This is the same as the object&#39;s name, but both fields must be set.)">host</span>:
2325
</div><div style="margin-left:13px;"><span title="(string) HostIP is the IP address to be used as a VTEP by other nodes in the overlay network">hostIP</span>:
2426
</div><div style="margin-left:13px;"><span title="(string) 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/api-conventions.md#types-kinds">kind</span>:
2527
</div><details open><summary><span title="(v1.ObjectMeta) Standard object&#39;s metadata.">metadata</span>:

api/docs/oapi/v1.NetNamespace.adoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ Expand or mouse-over a field for more information about it.
1919
++++
2020
<pre>
2121
<div style="margin-left:13px;"><span title="(string) 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/api-conventions.md#resources">apiVersion</span>:
22-
</div><div style="margin-left:13px;"><span title="(string) 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/api-conventions.md#types-kinds">kind</span>:
22+
</div><details><summary><span title="(array) EgressIPs is a list of reserved IPs that will be used as the source for external traffic coming from pods in this namespace. (If empty, external traffic will be masqueraded to Node IPs.)">egressIPs</span>:
23+
</summary><div style="margin-left:13px;">- <span title="(string)">[string]</span>:
24+
</div></details><div style="margin-left:13px;"><span title="(string) 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/api-conventions.md#types-kinds">kind</span>:
2325
</div><details open><summary><span title="(v1.ObjectMeta) Standard object&#39;s metadata.">metadata</span>:
2426
</summary><details><summary> <span title="(object) Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations">annotations</span>:
2527
</summary><div style="margin-left:13px;"> <span title="(string)">[string]</span>:

api/protobuf-spec/github_com_openshift_origin_pkg_network_apis_network_v1.proto

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/swagger-spec/oapi-v1.json

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25756,7 +25756,8 @@
2575625756
"required": [
2575725757
"host",
2575825758
"hostIP",
25759-
"subnet"
25759+
"subnet",
25760+
"egressIPs"
2576025761
],
2576125762
"properties": {
2576225763
"kind": {
@@ -25782,6 +25783,13 @@
2578225783
"subnet": {
2578325784
"type": "string",
2578425785
"description": "Subnet is the CIDR range of the overlay network assigned to the node for its pods"
25786+
},
25787+
"egressIPs": {
25788+
"type": "array",
25789+
"items": {
25790+
"type": "string"
25791+
},
25792+
"description": "EgressIPs is the list of automatic egress IP addresses currently hosted by this node"
2578525793
}
2578625794
}
2578725795
},
@@ -26908,7 +26916,8 @@
2690826916
"description": "NetNamespace describes a single isolated network. When using the redhat/openshift-ovs-multitenant plugin, every Namespace will have a corresponding NetNamespace object with the same name. (When using redhat/openshift-ovs-subnet, NetNamespaces are not used.)",
2690926917
"required": [
2691026918
"netname",
26911-
"netid"
26919+
"netid",
26920+
"egressIPs"
2691226921
],
2691326922
"properties": {
2691426923
"kind": {
@@ -26930,6 +26939,13 @@
2693026939
"netid": {
2693126940
"type": "integer",
2693226941
"description": "NetID is the network identifier of the network namespace assigned to each overlay network packet. This can be manipulated with the \"oc adm pod-network\" commands."
26942+
},
26943+
"egressIPs": {
26944+
"type": "array",
26945+
"items": {
26946+
"type": "string"
26947+
},
26948+
"description": "EgressIPs is a list of reserved IPs that will be used as the source for external traffic coming from pods in this namespace. (If empty, external traffic will be masqueraded to Node IPs.)"
2693326949
}
2693426950
}
2693526951
},

api/swagger-spec/openshift-openapi-spec.json

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90978,13 +90978,21 @@
9097890978
"required": [
9097990979
"host",
9098090980
"hostIP",
90981-
"subnet"
90981+
"subnet",
90982+
"egressIPs"
9098290983
],
9098390984
"properties": {
9098490985
"apiVersion": {
9098590986
"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/api-conventions.md#resources",
9098690987
"type": "string"
9098790988
},
90989+
"egressIPs": {
90990+
"description": "EgressIPs is the list of automatic egress IP addresses currently hosted by this node",
90991+
"type": "array",
90992+
"items": {
90993+
"type": "string"
90994+
}
90995+
},
9098890996
"host": {
9098990997
"description": "Host is the name of the node. (This is the same as the object's name, but both fields must be set.)",
9099090998
"type": "string"
@@ -91069,6 +91077,13 @@
9106991077
"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/api-conventions.md#resources",
9107091078
"type": "string"
9107191079
},
91080+
"egressIPs": {
91081+
"description": "EgressIPs is a list of reserved IPs that will be used as the source for external traffic coming from pods in this namespace. (If empty, external traffic will be masqueraded to Node IPs.)",
91082+
"type": "array",
91083+
"items": {
91084+
"type": "string"
91085+
}
91086+
},
9107291087
"kind": {
9107391088
"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/api-conventions.md#types-kinds",
9107491089
"type": "string"

pkg/network/apis/network/types.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ type HostSubnet struct {
5050
Host string
5151
HostIP string
5252
Subnet string
53+
54+
EgressIPs []string
5355
}
5456

5557
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
@@ -65,13 +67,15 @@ type HostSubnetList struct {
6567
// +genclient:nonNamespaced
6668
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
6769

68-
// NetNamespace holds the network id against its name
70+
// NetNamespace holds information about the SDN configuration of a Namespace
6971
type NetNamespace struct {
7072
metav1.TypeMeta
7173
metav1.ObjectMeta
7274

7375
NetName string
7476
NetID uint32
77+
78+
EgressIPs []string
7579
}
7680

7781
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

0 commit comments

Comments
 (0)