我正在运行裸机k8s集群,因此我必须手动配置ingress-nginx。 我已应用强制性yaml和裸金属yaml: kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/mandatory.yaml kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/provider/baremetal/service-nodeport.yaml
如doc中所述。 我不确定是否需要应用其他任何东西,例如RBAC。这创建了一个部署和一个pod,但是没有服务。我需要使用here中所述的NodePort方法创建服务。
问题是我的服务尚未启动,但仍处于待处理状态。有人在这方面有成功吗?如何配置Nginx服务?
答案 0 :(得分:0)
可能导致裸机处于待处理状态的问题:
在这种情况下,您的服务似乎无法声明该端口。您能否尝试使用系统上的其他端口(在一开始进行测试):
apiVersion: v1
kind: Service
metadata:
name: ingress-nginx
namespace: ingress-nginx
labels:
app.kubernetes.io/name: ingress-nginx
app.kubernetes.io/part-of: ingress-nginx
spec:
type: NodePort
ports:
- name: http
nodePort: 30080
port: 80
protocol: TCP
- name: https
port: 443
nodePort: 30443
protocol: TCP
selector:
app.kubernetes.io/name: ingress-nginx
app.kubernetes.io/part-of: ingress-nginx
,然后您的入口将从外部的那些nodePort 30236 -> 80
和30443 -> 443
可用。