kubernetes服务外部IP待处理 [英] kubernetes service external ip pending

查看:186
本文介绍了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集群(使用minikubekubeadm等).在这种情况下,没有集成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待处理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆