kubernetes服务外部IP待处理

编程入门 行业动态 更新时间:2024-10-24 08:22:32
本文介绍了kubernetes服务外部IP待处理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试在kubernetes上部署nginx,kubernetes版本是v1.5.2, 我已经部署了具有3个副本的nginx,YAML文件在下面,

I am trying to deploy nginx on kubernetes, kubernetes version is v1.5.2, I have deployed nginx with 3 replica, YAML file is below,

apiVersion: extensions/v1beta1 kind: Deployment metadata: name: deployment-example spec: replicas: 3 revisionHistoryLimit: 2 template: metadata: labels: app: nginx spec: containers: - name: nginx image: nginx:1.10 ports: - containerPort: 80

现在,我想在节点的端口30062上公开其端口80,为此我在下面创建了服务

and now I want to expose its port 80 on port 30062 of node, for that I created a service below,

kind: Service apiVersion: v1 metadata: name: nginx-ils-service spec: ports: - name: http port: 80 nodePort: 30062 selector: app: nginx type: LoadBalancer

该服务可以正常运行,但不仅在kubernetes仪表板上而且还在终端上显示为待处理.

this service is working good as it should be, but it is showing as pending not only on kubernetes dashboard also on terminal.

所以请帮助我解决此问题.谢谢...

so please help me to resolve this issue. Thanks ...

推荐答案

您似乎正在使用自定义的Kubernetes集群(使用minikube,kubeadm等).在这种情况下,没有集成LoadBalancer(与AWS或Google Cloud不同).使用此默认设置,您只能使用 NodePort 或入口控制器.

It looks like you are using a custom Kubernetes Cluster (using minikube, kubeadm or the like). In this case, there is no LoadBalancer integrated (unlike AWS or Google Cloud). With this default setup, you can only use NodePort or an Ingress Controller.

使用入口控制器,您可以设置域映射到您的广告连播的名称;如果您使用Ingress控制器,则无需为您的服务指定LoadBalancer类型.

With the Ingress Controller you can setup a domain name which maps to your pod; you don't need to give your Service the LoadBalancer type if you use an Ingress Controller.

更多推荐

kubernetes服务外部IP待处理

本文发布于:2023-11-09 20:27:18,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1573353.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:kubernetes   IP

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!