hi,
i have a k8s cluseter deployed inside a proxmox host.
everytime i deploy an app inside the cluster , i make a NodePoer service for it, ex :30001, and in order to access the app outside the cluster using the public IP, i create a NAT rule in proxmox host for that reason like :
Code:
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 30001 -j DNAT --to 172.16.104.107:30001
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp --dport 30001 -j DNAT --to 172.16.104.107:30001
now, i have installed an ingress controller inside my cluster and i have deployed an nginx app for test pupose, and i can access from proxmox host :
Code:
curl --header "HOST: nginx.example.com" http://172.16.104.107:30747
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
html { color-scheme: light dark; }
body { width: 35em; margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif; }
</style>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>
<p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p>
<p><em>Thank you for using nginx.</em></p>
</body>
</html>
where 30747 is number of the nodeport for http ans 30755 for https.
but my problem is asking the user to type the port number each time they want to access our HTTP/(S) is not the best way to go. So, is it possible to dot a nat NAT that look like this:
i have tested this :
and from the browser when i type : http://244.12.85.96 nothing happens
could you help please ?thanks
i have a k8s cluseter deployed inside a proxmox host.
everytime i deploy an app inside the cluster , i make a NodePoer service for it, ex :30001, and in order to access the app outside the cluster using the public IP, i create a NAT rule in proxmox host for that reason like :
Code:
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 30001 -j DNAT --to 172.16.104.107:30001
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp --dport 30001 -j DNAT --to 172.16.104.107:30001
now, i have installed an ingress controller inside my cluster and i have deployed an nginx app for test pupose, and i can access from proxmox host :
Code:
curl --header "HOST: nginx.example.com" http://172.16.104.107:30747
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
html { color-scheme: light dark; }
body { width: 35em; margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif; }
</style>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>
<p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p>
<p><em>Thank you for using nginx.</em></p>
</body>
</html>
where 30747 is number of the nodeport for http ans 30755 for https.
but my problem is asking the user to type the port number each time they want to access our HTTP/(S) is not the best way to go. So, is it possible to dot a nat NAT that look like this:
public IP | Port | Local IP | POrt |
my public ip | 80 | 172.16.104.107 | TCP/30747 |
my public ip | 443 | 172.16.104.107 | TCP/30755 |
i have tested this :
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 80 -j DNAT --to 172.16.104.107:30747
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp --dport 80 -j DNAT --to 172.16.104.107:30747
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 443 -j DNAT --to 172.16.104.107:30755
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp --dport 443 -j DNAT --to 172.16.104.107:30755
and from the browser when i type : http://244.12.85.96 nothing happens
could you help please ?thanks
Last edited: