在k8s中安装flannel的故障解决: Failed to create SubnetManager: error retrieving pod spec for : the server does not allow access to the requested resource
花了一个上午来追踪问题,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 https://github.com/coreos/flannel/raw/master/Documentation/kube-flannel-rbac.yml clusterrole "flannel" configured clusterrolebinding "flannel" configured kubectl create -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml serviceaccount "flannel" created configmap "kube-flannel-cfg" created daemonset "kube-flannel-ds" created
解决此问题参考:
https://github.com/kubernetes/kubernetes/issues/44029
https://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
在k8s中安装flannel的故障解决: Failed to create SubnetManager: error retrieving pod spec for : the server does not allow access to the requested resource的更多相关文章
- Apache 2.4.7在CentOS6.4中安装配置反向代理解决单外网IP对应多个内网主机的方法实践
欢迎转载,转载时请保留全文及出处. Apache 2.4.7在CentOS6.4中安装配置反向代理解决单外网IP对应多个内网主机的方法实践 Apache安装 下载源程序(http://httpd.ap ...
- 新版的K8S中的flannel.yaml文件中要注意的细节
部署flannel作为k8s中的网络插件,yaml文件都大小同异. 但在要注意以下细节. 以前,只需要前面master判断. 现在也需要有not-ready状态了. tolerations: - ke ...
- PandorBox 中安装aria2失败的解决办法
来自:http://www.right.com.cn/forum/thread-174358-1-1.html 不论luci界面还是opkg中安装,都提示缺少依赖包uclibc,pandorabox默 ...
- phpstorm failed to create jvm:error code -6 解决办法 解决方法
phpStorm 软件打开运行提示 failed to create JVM的解决办法. 修改文件 D:\Program Files (x86)\JetBrains\PhpStorm 7.1.3\bi ...
- rsync安装配置及故障解决完全教程[window, 文件同步]
Rsync是的全称是: remote synchronize, 也就是远程同步数据, 它是一款不错的文件同步软件,而且是免费的, 它在镜像保存整个目录树和文件系统的同时保持原来文件的权限.时间.软硬链 ...
- CentOS7在VMWare12中安装后不能上网解决办法
首先要保证你的VMWare Workstation12 在安装号CentOS7后没改动什么关于网络相关的. 1.我的电脑一开始用的是VMWare WorkStations10,发现VMnet8根本不通 ...
- k8s中安装rabbitmq集群
官方文档地址:https://www.rabbitmq.com/kubernetes/operator/quickstart-operator.html 要求 1.k8s版本要1.18及其以上 2.能 ...
- 在K8S中安装jenkins
以 NFS 为存储卷的示例,将在 NFS 存储卷上创建 Jenkins 目录,然后创建 NFS 类型的 PV.PVC. 1.NFS 存储卷创建 Jenkins 目录 进入 NFS Server 服务器 ...
- Python爬虫html解析工具beautifulSoup在pycharm中安装及失败的解决办法
1.安装步骤: 首先,你要先进入pycharm的Project Interpreter界面,进入方法是:setting(ctrl+alt+s) ->Project Interpreter,Pro ...
随机推荐
- push与createElement性能比较
下面的实验是验证push()函数与CreateElement()函数在创建HTML元素的效率.可以看出,实用push()确实效率要比后者要高,不过究竟可以高出多少,还需要有专研精神的朋友去测试了,这里 ...
- 一篇博文将JavaScript尽收眼底
简介 这篇文章是为专业程序员介绍的JavaScript语言的,它是一种小巧的语言,如果你熟悉其他的编程语言,那么这篇文章对你来讲不是那么难以理解. JavaScript不是Java,他们是两门完全不同 ...
- openstack安装问题
KeyStone NoHandlers Errorroot@openstack-dev-r910:/home/brent/openstack# ./keystone_data.shNo handler ...
- html 让一行文字居中
文本在行高范围内垂直居中 可以利用行高特性让一行文本居中 line-height:100px://父容器的高度
- ICPC2017 Urumqi - K - Sum of the Line
题目描述 Consider a triangle of integers, denoted by T. The value at (r, c) is denoted by Tr,c , where 1 ...
- Cppcheck代码分析上
1.检查点 1.自动变量检查: 返回自动变量(局部变量)指针: 2.越界检查:数组越界返回自动变量(局部变量)指针: 3.类检查:构造函数初始化: 4.内存泄露检查: 5.空指针检查: 6.废弃函数 ...
- shell 25个常用命令
1.列出所有目录使用量,并按大小排序. ls|xargs du -h|sort -rn #不递归下级目录使用du -sh 2.查看文件排除以#开关和空白行,适合查看配置文件. egrep -v ...
- 「6月雅礼集训 2017 Day8」route
[题目大意] 给出平面上$n$个点,求一条连接$n$个点的不相交的路径,使得转换的方向符合所给长度为$n-2$的字符串. $n \leq 5000$ [题解] 考虑取凸包上一点,然后如果下一个是‘R' ...
- Spring与MyBatis的整合(山东数漫江湖)
首先看一下项目结构图: 具体步骤如下: 1.建立JDBC属性文件 jdbc.properties (文件编码修改为 utf-8 ) driver=com.mysql.jdbc.Driver url=j ...
- 2009 Round2 A Crazy Rows (模拟)
Problem You are given an N x N matrix with 0 and 1 values. You can swap any two adjacent rows of the ...