portmap

package
v1.2.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

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

View Source
const DefaultMarkBit = 13

The default mark bit to signal that masquerading is required Kubernetes uses 14 and 15, Calico uses 20-31.

View Source
const MarkMasqChainName = "CNI-HOSTPORT-MASQ"
View Source
const OldTopLevelSNATChainName = "CNI-HOSTPORT-SNAT"
View Source
const SetMarkChainName = "CNI-HOSTPORT-SETMARK"
View Source
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

func CmdAdd

func CmdAdd(args *skel.CmdArgs, conf *config.Plugin) error

func CmdCheck

func CmdCheck(args *skel.CmdArgs, conf *config.Plugin) error

func CmdDel

func CmdDel(args *skel.CmdArgs, conf *config.Plugin) error

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL