Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bowei/k8s-custom-iptables
How to add custom iptables rules to a Kubernetes cluster
https://github.com/bowei/k8s-custom-iptables
iptables k8s kubernetes masquerade nat networking
Last synced: about 2 months ago
JSON representation
How to add custom iptables rules to a Kubernetes cluster
- Host: GitHub
- URL: https://github.com/bowei/k8s-custom-iptables
- Owner: bowei
- License: apache-2.0
- Created: 2017-04-17T23:40:21.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-10-18T10:15:57.000Z (11 months ago)
- Last Synced: 2024-06-15T22:35:14.377Z (3 months ago)
- Topics: iptables, k8s, kubernetes, masquerade, nat, networking
- Language: Shell
- Homepage:
- Size: 18.6 KB
- Stars: 59
- Watchers: 7
- Forks: 34
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# k8s-custom-iptables
An example of how to add custom IP tables rules to a Kubernetes cluster.
This collection of scripts creates a NAT (MASQ) rule for outbound traffic
to a TARGETS CIDR range(s) given to the script.# Installing rules into the cluster.
Install the daemonset that configures the cluster to NAT an IP range.
```
TARGETS="1.2.3.4/24 4.5.6.7/16" ./install.sh
```# Uninstall rules from the cluster.
Uninstall the IP tables rules from the cluster.
```
./uninstall.sh
```# Configuring
The configuration for which ranges are NAT'd are in the `k8s-custom-iptables` ConfigMap.
Values can be changed via `kubectl edit cm/k8s-custom-iptables`:```
apiVersion: v1
kind: ConfigMap
metadata:
name: k8s-custom-iptables
data:
nat.rules: "10.0.0.0/24 192.168.0.0/16"
```# Creating and pushing the image.
```sh
REGISTRY=gcr.io/my-registry make
```