ingress controller 创建启动的时候报错,求大神


yaml是官方的nginx-ingress-controller.yaml

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: nginx-ingress-controller
labels:
k8s-app: nginx-ingress-controller
namespace: kube-system
spec:
replicas: 1
template:
metadata:
labels:
k8s-app: nginx-ingress-controller
spec:
terminationGracePeriodSeconds: 60
hostNetwork: true
containers:
- image: 192.168.2.160:5000/nginx-ingress-controller:0.9.0-beta.2 #这是我私有仓库的镜像
imagePullPolicy: IfNotPresent
name: nginx-ingress-controller
readinessProbe:
httpGet:
path: /healthz
port: 10254
scheme: HTTP
livenessProbe:
httpGet:
path: /healthz
port: 10254
scheme: HTTP
initialDelaySeconds: 10
timeoutSeconds: 1
ports:
- containerPort: 80
hostPort: 80
- containerPort: 443
hostPort: 443
env:
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
args:
- /nginx-ingress-controller
- --default-backend-service=$(POD_NAMESPACE)/default-http-backend

创建之后报错了

Back-off restarting failed docker container
Error syncing pod, skipping: failed to "StartContainer" for "nginx-ingress-controller" with CrashLoopBackOff: "Back-off 10s restarting failed container=nginx-ingress-controller pod=nginx-ingress-controller-3711901782-w0sli_kube-system(1e6e1c1a-046e-11e7-89ce-000c297a0ed6)"

求个为大神帮帮忙 这是什么原因导致的 该这么解决 ?
QQ图片20170309101746.png
已邀请:

xiphis

赞同来自:

  1. liveprobe和readprobe, 监听10254端口干嘛? 监听不成功,k8s肯定杀掉容器重启。
  2. k8s 1.3.6之后不支持hostport方式,使用hostnetwork代替。

justinfu - 80后容器极客

赞同来自:


@xiphis 他这个监听不成功是为啥?

grovers

赞同来自:


在容器里面还报错这个:

2017-03-14T03:50:58.487737540Z F0314 03:50:58.486458 5 launch.go:242] Error while initializing connection to Kubernetes apiserver. This most likely means that the cluster is misconfigured (e.g., it has invalid apiserver certificates or service accounts configuration). Reason: invalid configuration: no configuration has been provided

justinfu - 80后容器极客

赞同来自:


这个问题我也遇到了,这是因为跟apiserver通信采用的serviceaccount不是默认的default,需要一个token,官方文档里面有说明。

tacy_lee

赞同来自:


需要补充kubelet log

seansa

赞同来自:


碰到同样的问题,已解决
https://github.com/kubernetes/ ... ng.md

要回复问题请先登录注册