From 801e754dc275129022b4d363b80e4ef93e38daa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=C3=ABl=20Cluseau?= Date: Fri, 30 Apr 2021 21:58:50 +0200 Subject: [PATCH] hack: add setup_node_nft_masq --- hack/kpng-local-up.sh | 3 ++- hack/setup_node_nft_masq | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 hack/setup_node_nft_masq diff --git a/hack/kpng-local-up.sh b/hack/kpng-local-up.sh index e896632d0..ec29099b0 100755 --- a/hack/kpng-local-up.sh +++ b/hack/kpng-local-up.sh @@ -1,7 +1,7 @@ #!/bin/bash # build the kpng image... -IMAGE="jayunit100/kpng-server:latest" +: ${IMAGE:="jayunit100/kpng-server:latest"} function setup_k8s { # make a gopath if not one existing... @@ -32,6 +32,7 @@ function build { function install { # substitute it with your changes... + echo "Applying template with KPNG_IMAGE=$IMAGE" cat kpng-deployment-ds.yaml.tmpl | sed "s,KPNG_IMAGE,$IMAGE," > kpng-deployment-ds.yaml kubectl -n kube-system create sa kpng diff --git a/hack/setup_node_nft_masq b/hack/setup_node_nft_masq new file mode 100644 index 000000000..57a90d31b --- /dev/null +++ b/hack/setup_node_nft_masq @@ -0,0 +1,21 @@ +#! /bin/sh +# this script sets a basic masquerading for pods to reach the outside + +set -ex +apt update +apt install -y nftables + +nft -f - <