1. 程式人生 > >kubernetes安裝問題記錄

kubernetes安裝問題記錄

kubernetes問題記錄

一、pod-infrastructure:latest鏡像下載失敗

報錯一:image 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 image "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

image: 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





kubernetes安裝問題記錄