Documentation ¶
Overview ¶
Copyright UCloud. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. A copy of the License is located at
https://www.apache.org/licenses/LICENSE-2.0
or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
This is a post-setup plugin that establishes port forwarding - using iptables, from the host's network interface(s) to a pod's network interface.
It is intended to be used as a chained CNI plugin, and determines the container IP from the previous result. If the result includes an IPv6 address, it will also be configured. (IPTables will not forward cross-family).
This has one notable limitation: it does not perform any kind of reservation of the actual host port. If there is a service on the host, it will have all its traffic captured by the container. If another container also claims a given port, it will caputure the traffic - it is last-write-wins.
Copyright UCloud. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. A copy of the License is located at
https://www.apache.org/licenses/LICENSE-2.0
or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
Constants ¶
const DefaultMarkBit = 13
The default mark bit to signal that masquerading is required Kubernetes uses 14 and 15, Calico uses 20-31.
const MarkMasqChainName = "CNI-HOSTPORT-MASQ"
const OldTopLevelSNATChainName = "CNI-HOSTPORT-SNAT"
const SetMarkChainName = "CNI-HOSTPORT-SETMARK"
const TopLevelDNATChainName = "CNI-HOSTPORT-DNAT"
The names of the top-level summary chains. These should never be changed, or else upgrading will require manual intervention.
Variables ¶
This section is empty.
Functions ¶
Types ¶
This section is empty.