How to set up IP whitelist based on nginx ingress
- 本文有使用到
Kubernetes,nginx ingress和Cloudflare
Installation
使用 helm 3 安裝 nginx ingress, 這裡就直接演示 Makefile 了。
1 | # Makefile |
Configuration
兩個重要的設定
1 | controller: |
How to use
在 Cloudflare 中就可以開啟 proxy mode,透過 CF-Connecting-IP 拿到 client 的真實 IP 進行過濾。
設定 ingress 參考 whitelist-source-range
1 | ingress: |