发布时间:2020-02-17 16:15:02来源:阅读:
花了一个上午来追踪问题,k8s都反复新建了十多次,docker都重启了几次。(一次显示不有获取磁盘空间,重启docker,清空存储解决)
在用kubeadm安装容器化的几个组件时,flannel组件死活不能启动,报如下问题:
Failed to create SubnetManager: error retrieving pod spec for ‘kube-system/kube-flannel-ds-xxx’: the server does not allow access to the requested resource.
在如下Url找到解决办法:
http://blog.csdn.net/ximenghappy/article/details/70157361
明天搞DNS和节点加入….
================================================
Kubernetes一共提供五种网络组件,可以根据自己的需要选择。我使用的Flannel网络,此处1.5.5和1.6.1也是不一样的,1.6.1加了RBAC。需要执行一下两个命令:
kubectl create -f http://github.com/coreos/flannel/raw/master/Documentation/kube-flannel-rbac.yml
clusterrole “flannel” configured
clusterrolebinding “flannel” configured
kubectl create -f http://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
serviceaccount “flannel” created
configmap “kube-flannel-cfg” created
daemonset “kube-flannel-ds” created
解决此问题参考:
http://github.com/kubernetes/kubernetes/issues/44029
http://github.com/kubernetes/kubeadm/issues/212#issuecomment-290908868
kube-flannel-rbac.yaml文件内容:
# Create the clusterrole and clusterrolebinding:
# $ kubectl create -f kube-flannel-rbac.yml
# Create the pod using the same namespace used by the flannel serviceaccount:
# $ kubectl create --namespace kube-system -f kube-flannel.yml
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: flannel
rules:
- apiGroups:
- ""
resources:
- pods
verbs:
- get
- apiGroups:
- ""
resources:
- nodes
verbs:
- list
- watch
- apiGroups:
- ""
resources:
- nodes/status
verbs:
- patch
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: flannel
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: flannel
subjects:
- kind: ServiceAccount
name: flannel
namespace: kube-system
kube-flannel.yaml内容:
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: flannel
namespace: kube-system
---
kind: ConfigMap
apiVersion: v1
metadata:
name: kube-flannel-cfg
namespace: kube-system
labels:
tier: node
app: flannel
data:
cni-conf.json: |
{
"name": "cbr0",
"type": "flannel",
"delegate": {
"isDefaultGateway": true
}
}
net-conf.json: |
{
"Network": "10.244.0.0/16",
"Backend": {
"Type": "vxlan"
}
}
---
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
name: kube-flannel-ds
namespace: kube-system
labels:
tier: node
app: flannel
spec:
template:
metadata:
labels:
tier: node
app: flannel
spec:
hostNetwork: true
nodeSelector:
beta.kubernetes.io/arch: amd64
tolerations:
- key: node-role.kubernetes.io/master
operator: Exists
effect: NoSchedule
serviceAccountName: flannel
containers:
- name: kube-flannel
image: quay.io/coreos/flannel-amd64:v0.7.1
command: [ "/opt/bin/flanneld", "--ip-masq", "--kube-subnet-mgr" ]
securityContext:
privileged: true
env:
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
volumeMounts:
- name: run
mountPath: /run
- name: flannel-cfg
mountPath: /etc/kube-flannel/
- name: install-cni
image: quay.io/coreos/flannel-amd64:v0.7.1
command: [ "/bin/sh", "-c", "set -e -x; cp -f /etc/kube-flannel/cni-conf.json /etc/cni/net.d/10-flannel.conf; while true; do sleep 3600; done" ]
volumeMounts:
- name: cni
mountPath: /etc/cni/net.d
- name: flannel-cfg
mountPath: /etc/kube-flannel/
volumes:
- name: run
hostPath:
path: /run
- name: cni
hostPath:
path: /etc/cni/net.d
- name: flannel-cfg
configMap:
name: kube-flannel-cfg
3d蓝光播放器(高清3D影音播放软件) V1.8.0.4 绿色免安装版
36.8 MB
HofoSetup(安装程序制作软件)v8.5.4 破解版
5.7M
msvcr80.dll丢失怎么办 64位/32位 附丢失解决方法
234 KB
矮人DOS工具箱 V5.3 Bulid 6.713 安装版
9.01M
硬盘安装器(系统安装工具) 1.6.10.6 中文版
17.35 MB
系统之家一键重装系统(系统自动安装工具)12.5.48.1830 最新版
28.4M
黄山IE修复专家 v9.0 官方安装版
4.44MB
360安全桌面下载
42.53M
Virtual CloneDrive下载
1.6MB
autocad2014(cad设计软件) 免费版
1505.28MB
editplus3下载
1.41M
pkpm2010破解版下载
1.56GB
usb3.0驱动下载
8.67MB
xlive下载
21.3MB
和平网络电视下载
4.2M
驱动总裁下载
287.73M
2020-02-18
手动删除开机跳出记事本病毒
小米除了手机具有性价比以外,这款键盘也魅力十足!
万全R670 6100千兆网卡驱动(Intel 82545GM)
IdeaPad Y400/Y500系统下如何开启3D立体幻境(3D VISION)
php apc加速器安装
Windows 8系统是否需要设置虚拟内存
使用awk来统计访问站点的响应状态码
打开计算机弹出“位置不可用”的对话框或黑屏,只有回收站
管理swarm(9) – swarm实践 – 删除服务