一、pod-infrastructure:latest镜像下载失败

报错一:p_w_picpath pull failed for registry.access.redhat.com/rhel7/pod-infrastructure:latest, this may be because there are no credentials on this request.  details: (open /etc/docker/certs.d/registry.access.redhat.com/redhat-ca.crt: no such file or directory)

解决方案:yum install *rhsm* -y

报错二:Failed to create pod infra container: ImagePullBackOff; Skipping pod "redis-master-jj6jw_default(fec25a87-cdbe-11e7-ba32-525400cae48b)": Back-off pulling p_w_picpath "registry.access.redhat.com/rhel7/pod-infrastructure:latest

解决方法:试试通过手动下载

docker pull registry.access.redhat.com/rhel7/pod-infrastructure:latest


二、POD创建失败

报错:Event(api.ObjectReference{Kind:"ReplicationController", Namespace:"default", Name:"redis-master", UID:"a4f26317-cdbe-11e7-bad0-525400cae48b", APIVersion:"v1", ResourceVersion:"13245", FieldPath:""}): type: 'Warning' reason: 'FailedCreate' Error creating: No API token found for service account "default", retry after the token is automatically created and added to the service account

Nov 20 14:49:22 k8s-master kube-controller-manager: E1120 14:49:22.778739     566 replica

解决方法:关闭api的servicecount,修改/etc/kubernetes/apiserver

KUBE_ADMISSION_CONTROL="--admission_control=NamespaceLifecycle,NamespaceExists,LimitRanger,ResourceQuota"


三、POD测试文件

apiVersion: v1

kind: ReplicationController

metadata: 

  name: redis-master

  labels:

    name: redis

spec:

  replicas: 1

  selector:

    name: redis

  template:

   metadata:

    labels:

      name: redis

   spec:

    containers:

    - name: master

      p_w_picpath: kubeguide/redis-master

      ports:

      - containerPort: 6379


四、启动CNI网络插件:

插件路径:/opt/cni/bin

插件配置文件路径:/etc/cni/net.d

kubelet配置文件添加以下参数

  --network-plugin-dir=/etc/cni/net.d 

  --network-plugin=cni