创建 Ingress-Nginx
目录
Overview
NGINX Ingress Controller 作为集群插件部署在 cpaas-system
命名空间中。本指南涵盖了在 Kubernetes 集群中安装、配置及管理 Ingress NGINX Controller 的最佳实践。
Installation
- 进入
Administrator -> Marketplace -> Cluster Plugin
- 找到 Ingress NGINX 插件并点击
Install

Configuration Management
Updating Configuration
- 配置 kubectl 使用 global 集群上下文
- 获取集群对应的 ModuleInfo 名称:
kubectl get minfo | grep ingress | grep $CLUSTER_NAME
- 编辑 ModuleInfo 配置:
kubectl edit minfo $MINFO
其中 spec.config
部分对应 Ingress NGINX Helm Chart 的 values。
Common Configuration Scenarios
通过 LoadBalancer 暴露
使用 LoadBalancer 类型的 Service 暴露 Ingress Controller:
spec:
config:
controller:
service:
type: LoadBalancer
MetalLB 集成
使用 MetalLB 时指定 LoadBalancer VIP:
spec:
config:
controller:
service:
annotations:
metallb.universe.tf/loadBalancerIPs: "192.168.2.2" # 期望的 VIP
metallb.universe.tf/address-pool: "pool-name" # MetalLB 地址池
高级 Controller 部署设置
配置网络模式、副本数、资源限制及节点选择:
spec:
config:
controller:
hostNetwork: false
replicaCount: 1
nodeSelector:
kubernetes.io/os: linux
resources:
limits:
cpu: 200m
memory: 256Mi
requests:
cpu: 200m
memory: 256Mi
SSL 透传
启用 SSL 透传功能:
spec:
config:
controller:
extraArgs:
enable-ssl-passthrough: ""
IPv6 单栈支持
配置仅使用 IPv6:
spec:
config:
controller:
service:
ipFamilies:
- IPv6
Performance Tuning
资源分配指南
小规模(< 300 QPS)
spec:
config:
controller:
resources:
limits:
cpu: 200m
memory: 256Mi
requests:
cpu: 200m
memory: 256Mi
中等规模(< 10,000 QPS)
spec:
config:
controller:
resources:
limits:
cpu: "2"
memory: 1Gi
requests:
cpu: "2"
memory: 1Gi
大规模(< 20,000 QPS)
spec:
config:
controller:
resources:
limits:
cpu: "4"
memory: 2Gi
requests:
cpu: "4"
memory: 2Gi
高性能(无限制)
最大性能且无 CPU 限制:
spec:
config:
controller:
resources:
requests:
cpu: "4"
memory: 2Gi
Important Notes
Limitations
- 每个集群仅支持一个 Ingress NGINX Controller 实例
Version Compatibility
当前版本对应关系:
- ACP Ingress NGINX 4.1.x 对应官方 Ingress NGINX 4.12.2
更多详细配置选项,请参考官方 Ingress NGINX chart 文档。