我是Ingress控制器的新手。 我为基本的nginx-ingress-controller安装了必要的名称空间,我正在docker-for-mac上运行。
据我所知,没有设置RBAC
,我的配置非常简单:
apiVersion: v1
kind: Service
metadata:
name: ingress-nginx
namespace: ingress-nginx
spec:
ports:
- port: 80
targetPort: 80
selector:
app.kubernetes.io/name: ingress-nginx
type: NodePort
kubectl describe ingress
返回:
Name: test
Namespace: default
Address: localhost
Default backend: nginx:80 (10.1.0.123:80,10.1.0.124:80,10.1.0.125:80 + 1 more...)
Rules:
Host Path Backends
---- ---- --------
foo.bar.com
/v nginx:80 (10.1.0.123:80,10.1.0.124:80,10.1.0.125:80 + 1 more...)
/v20 nginx20:80 (10.1.0.123:80,10.1.0.125:80)
/v23 nginx23:80 (10.1.0.124:80,10.1.0.128:80)
运行curl http://localhost:30874/v/version.html -H "host: foo.bar.com"
时出现403错误,并且入口控制窗格显示:
192.168.65.3 - [192.168.65.3] - - [05/Feb/2019:15:25:49 +0000] "GET /v/version.html HTTP/1.1" 403 169 "-" "curl/7.54.0" 89 0.001 [default-nginx-80] 10.1.0.128:80 169 0.000 403 3c8127da10e5d1c991414ea0edf88c80
您能告诉我此配置有什么问题吗?