namespace/kube-flannel unchanged clusterrole.rbac.authorization.k8s.io/flannel unchanged clusterrolebinding.rbac.authorization.k8s.io/flannel unchanged serviceaccount/flannel unchanged configmap/kube-flannel-cfg unchanged error: error parsing kube-flannelv1.19.1.yaml: error converting YAML to JSON: yaml: line 34: mapping values are not allowed in this context 部署k8s集群报错
时间: 2024-04-12 11:34:34 浏览: 59
部署Kubernetes集群时遇到了一个错误。根据错误消息,看起来是在解析名为"kube-flannelv1.19.1.yaml"的文件时出错了,具体是在第34行的位置。错误消息还提到了一个问题,即在此上下文中不允许使用映射值。
这个错误通常是由于YAML文件的语法错误造成的。请检查"kube-flannelv1.19.1.yaml"文件的第34行附近的代码,确保语法正确。可能有一个映射值放在了不正确的位置,导致了这个错误。
如果你需要进一步的帮助,请提供"kube-flannelv1.19.1.yaml"文件的内容,这样我可以更好地帮助你解决问题。
相关问题
namespace/kube-flannel created clusterrole.rbac.authorization.k8s.io/flannel created clusterrolebinding.rbac.authorization.k8s.io/flannel created serviceaccount/flannel created configmap/kube-flannel-cfg created daemonset.apps/kube-flannel-ds created
这些命令是在 Kubernetes 中创建 Flannel 网络插件所需的资源。以下是每个资源的解释:
1. namespace/kube-flannel: 创建一个名为 "kube-flannel" 的命名空间,用于隔离 Flannel 相关的资源。
2. clusterrole.rbac.authorization.k8s.io/flannel: 创建一个名为 "flannel" 的 ClusterRole,定义了 Flannel 所需的权限。
3. clusterrolebinding.rbac.authorization.k8s.io/flannel: 创建一个名为 "flannel" 的 ClusterRoleBinding,将 ClusterRole "flannel" 绑定到默认的 serviceaccount/flannel。
4. serviceaccount/flannel: 创建一个名为 "flannel" 的 ServiceAccount,用于授权 Flannel 访问 Kubernetes API。
5. configmap/kube-flannel-cfg: 创建一个名为 "kube-flannel-cfg" 的 ConfigMap,包含 Flannel 配置信息。
6. daemonset.apps/kube-flannel-ds: 创建一个名为 "kube-flannel-ds" 的 DaemonSet,它确保在每个节点上运行一个 Pod,该 Pod 包含 Flannel 容器和所需的网络配置。
这些资源的创建是为了在 Kubernetes 集群中部署和配置 Flannel 网络插件,以提供集群内部的网络通信和跨节点的 Pod 互联。通过这些资源的创建,Flannel 将在每个节点上自动部署并配置网络功能。
https://raw.githubusercontent.com/flannel-io/flannel/master/Documentation/kube-flannel.yml文件内容
抱歉,我无法直接访问互联网。但你可以通过以下步骤获取 `https://raw.githubusercontent.com/flannel-io/flannel/master/Documentation/kube-flannel.yml` 文件的内容:
1. 打开浏览器并访问 `https://raw.githubusercontent.com/flannel-io/flannel/master/Documentation/kube-flannel.yml`。
2. 在浏览器中,你应该能看到该文件的原始内容。如果你看到了文件内容,你可以将其复制到一个文本编辑器中进行保存。
3. 如果你无法在浏览器中看到文件内容,可能是因为 GitHub 的原始文件链接需要进行重定向。你可以尝试使用工具(如 curl 或 wget)从命令行下载文件内容。在命令行中运行以下命令:
使用 curl:
```
curl -o kube-flannel.yml https://raw.githubusercontent.com/flannel-io/flannel/master/Documentation/kube-flannel.yml
```
使用 wget:
```
wget -O kube-flannel.yml https://raw.githubusercontent.com/flannel-io/flannel/master/Documentation/kube-flannel.yml
```
这将下载文件并将其保存为 `kube-flannel.yml`。
请注意,这是一个来自 flannel 项目的 YAML 文件,用于在 Kubernetes 集群中部署 flannel 网络插件。确保在使用该文件之前,先了解并适应你的特定环境和需求。
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)