我正在学习Kubernetes,在访问本地Minikube (Docker驱动程序)中的API时遇到了麻烦。我有一个运行angluar客户端的pod,它试图到达一个后端pod。前端Pod由NodePort服务公开。后端pod通过ClusterIP服务向群集公开。 但是,当我尝试从前端访问clusterip服务时,无法解析dns transpile-svc.default.svc.cluster.local。error message in the client dns应该能正常工作。我遵循这个https://kubernetes.io/docs/tasks/administer-cluste
我读了一本书"kubernetes in action",书中提到了“云提供商上的侵入控制器(例如,在GKE中)要求In宿指出一个NodePort服务”。
当Ingress控制器从服务本身获取Pod并将请求直接路由到IP和端口时,它为什么需要NodePort服务?节点的IP和端口(由NodePort服务提供)用于什么?
我从rancher启动了一个pod,我的pgsql守护进程运行良好。然后,使用目标(pod名称)和端口5432设置ingres,然后使用kubectl启动端口转发
完成这些步骤后,我可以使用以下命令从kubernetes集群中访问数据库
kubectl exec -it pod/<pod_name> -n <ns_name> -- psql -U postgres
这运行得很好。
然后,我尝试在笔记本电脑上使用pgadmin连接到数据库。它总是失败,并显示Unable to connect to server:
Could not connect to server:
我试图使用最新的bitnami图表将postgres部署到本地kubernetes集群(mac,停靠桌面4.4.2,kubernetes 1.22.5):
我已经设置了节点端口:
primary:
service:
# Kubernetes Service type
type: NodePort
nodePorts:
# Node port for PostgreSQL
postgresql: '30000'
该服务可见:
NAME TYPE CLUSTER
我正在学习Kubernetes,并且我在裸金属上创建了一个实验室,所以我是Kubernetes noob!
我确实创建了我的deployment,它正在运行并使用NodePort进行访问,但是当我使用nginx-ingress时,nginx容器正在运行,并且它使用curl localhost在容器内进行响应,但是当我尝试从外部世界尝试时,我看到了这样的消息:curl: (7) Failed to connect to app.example.com port 80: Connection refused。
这是他们正在运行的我的app-service.yml和app-ingress.yml。