精华内容
下载资源
问答
  • Kubernetes node节点执行kubectl命令

    千次阅读 2020-05-04 14:48:58
    Kubernetes node节点执行kubectl命令 集群搭建完成后,在Kubernetes的从节点上运行命令kubectl出现了如下错误: [root@master ~]# kubectl get nodes error: no configuration has been provided, try setting ...

    Kubernetes node节点执行kubectl命令

    集群搭建完成后,在Kubernetes的从节点上运行命令kubectl出现了如下错误:

    [root@master ~]# kubectl get nodes
    
    error: no configuration has been provided, try setting KUBERNETES_MASTER environme
    

    原因是kubectl命令需要使用kubernetes-admin来运行。现在就去看看如何破解这个问题。

    1. 复制/etc/kubernetes/admin.conf 文件
      解决方法如下,将主节点中的【/etc/kubernetes/admin.conf】文件拷贝到从节点相同目录下,然后配置环境变量。
      我这里使用scp命令复制:
    [root@node1 kubernetes]# scp root@192.168.1.12:/etc/kubernetes/admin.conf /etc/kubernetes/
    The authenticity of host '192.168.1.12 (192.168.1.12)' can't be established.
    ECDSA key fingerprint is SHA256:EG26pBKAbxAddDFuh6N81IY7sXWCoblngfn1oRbpNeU.
    Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
    Warning: Permanently added '192.168.1.12' (ECDSA) to the list of known hosts.
    root@192.168.1.12's password:
    admin.conf                                                                                   100% 5452    68.8KB/s   00:00
    
    
    1. 设置环境变量
      环境变量可在 ~/.bash_profile,修改 vim /etc/profile 配置文件,添加如下配置
    export KUBECONFIG=/etc/kubernetes/admin.conf
    

    保存退出,执行 source /etc/profile,配置立即生效。

    1. 查看验证kubectl命令
      在从节点上执行如下命令
    kubectl get pods -n kube-system
    
    kubectl get nodes
    

    发现可以正常展示信息。
    这里我们会发现,为何不需要指定api-server地址就可以直接执行相关命令,那是因为刚刚我们从master节点拷贝过来的admin.conf这个配置文件存放的是Kubernetes用户权限相关的配置。

    展开全文
  • Kubernetes node节点执行kubectl命令报错 error: no configuration has been provided, try setting KUBERNETES_MASTER environme [root@gst177026 ~]# kubectl get nodes 原因是kubectl命令需要使用kubernetes-...

    Kubernetes node节点执行kubectl命令报错

    error: no configuration has been provided, try setting
    KUBERNETES_MASTER environme

    [root@gst177026 ~]# kubectl get nodes
    

    在这里插入图片描述
    原因是kubectl命令需要使用kubernetes-admin来运行。
    解决方法:
    复制主节点中的/etc/kubernetes/admin.conf 文件到从节点相同位置,然后配置环境变量。

    [root@gst178243 kubernetes]# scp admin.conf root@219.223.177.26:/etc/kubernetes/
    

    设置环境变量
    环境变量可在 ~/.bash_profile,修改 vim /etc/profile 配置文件,添加如下配置

    [root@gst177026 kubernetes]# export KUBECONFIG=/etc/kubernetes/admin.conf
    

    保存退出,执行 source /etc/profile,配置立即生效。

    [root@gst177026  kubernetes]# source /etc/profile
    

    查看验证kubectl命令
    在从节点上执行如下命令

    [root@gst177026 kubernetes]# kubectl get po
    

    在这里插入图片描述

    展开全文
  • 1.准备集群管理配置文件 mkdir .kube scp master1:/root/.kube/config .kube/ 2.使用命令验证 kubectl get nodes

    1.准备集群管理配置文件

    mkdir .kube
    
    scp master1:/root/.kube/config .kube/
    
    

    2.使用命令验证

    kubectl get nodes

     

    展开全文
  • 1、部署kubectl 命令行工具准备二进制包[root@k8smaster ~]# cd /usr/local/src/kubernetes/client/bin[root@k8smaster bin]# cp kubectl /opt/kubernetes/bin/ 2、创建 admin 证书签名请求[root@k8smaster bin]# cd...

    1、部署kubectl 命令行工具
    准备二进制包
    [root@k8smaster ~]# cd /usr/local/src/kubernetes/client/bin
    [root@k8smaster bin]# cp kubectl /opt/kubernetes/bin/

    2、创建 admin 证书签名请求
    [root@k8smaster bin]# cd /usr/local/src/ssl/
    [root@k8smaster ssl]# vim admin-csr.json

    {
    "CN": "admin",
    "hosts": [],
    "key": {
    "algo": "rsa",
    "size": 2048
    },
    "names": [
    {
    "C": "CN",
    "ST": "BeiJing",
    "L": "BeiJing",
    "O": "system:masters",
    "OU": "System"
    }
    ]
    }

    3、生成 admin 证书和私钥:
    [root@k8smaster ssl]# cfssl gencert -ca=/opt/kubernetes/ssl/ca.pem \
    -ca-key=/opt/kubernetes/ssl/ca-key.pem \
    -config=/opt/kubernetes/ssl/ca-config.json \
    -profile=kubernetes admin-csr.json | cfssljson -bare admin

    2018/06/12 20:13:11 [INFO] generate received request
    2018/06/12 20:13:11 [INFO] received CSR
    2018/06/12 20:13:11 [INFO] generating key: rsa-2048
    2018/06/12 20:13:12 [INFO] encoded CSR
    2018/06/12 20:13:12 [INFO] signed certificate with serial number 165814787638355531945310975608531058629796019352
    2018/06/12 20:13:12 [WARNING] This certificate lacks a "hosts" field. This makes it unsuitable for
    websites. For more information see the Baseline Requirements for the Issuance and Management
    of Publicly-Trusted Certificates, v.1.1.6, from the CA/Browser Forum (https://cabforum.org);
    specifically, section 10.2.3 ("Information Requirements").

    [root@k8smaster ssl]# mv admin*.pem /opt/kubernetes/ssl/

    4、设置集群参数
    [root@k8smaster ~]# kubectl config set-cluster kubernetes \
    --certificate-authority=/opt/kubernetes/ssl/ca.pem \
    --embed-certs=true \
    --server=https://192.168.137.171:6443
    Cluster "kubernetes" set.

    5、设置客户端认证参数
    [root@k8smaster ~]# kubectl config set-credentials admin \
    --client-certificate=/opt/kubernetes/ssl/admin.pem \
    --embed-certs=true \
    --client-key=/opt/kubernetes/ssl/admin-key.pem
    User "admin" set.

    6、 设置上下文参数
    [root@k8smaster ~]# kubectl config set-context kubernetes \
    --cluster=kubernetes \
    --user=admin
    Context "kubernetes" created.

    7、 设置默认上下文
    [root@k8smaster ~]# kubectl config use-context kubernetes
    Switched to context "kubernetes".

    8、 使用kubectl工具
    [root@k8smaster ~]# kubectl get cs
    NAME STATUS MESSAGE ERROR
    scheduler Healthy ok
    etcd-0 Healthy {"health": "true"}
    controller-manager Healthy ok
    etcd-1 Healthy {"health": "true"}
    etcd-2 Healthy {"health": "true"}

    [root@k8smaster ~]# cat .kube/config
    apiVersion: v1
    clusters:

    • cluster:
      certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUR2akNDQXFhZ0F3SUJBZ0lVSDVEQ05wSU5D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0VCL3dJQkFqQWQKQmdOVkhRNEVGZ1FVSSt1MHI5SXJoK0dnRng5bVJ5bUZzRFVOcFdFd0h3WURWUjBqQkJnd0ZvQVVJK3UwcjlJcgpoK0dnRng5bVJ5bUZzRFVOcFdFd0RRWUpLb1pJaHZjTkFRRUxCUUFEZ2dFQkFIM3pNVktBVzFrSVo2VllhbnM0Ck9nekdyMmdrQTcvRHVzNGhpeTR4KzNwNVpFZjRZaWJPcE1YSk42Ti94WU9mdC93VTlTSW1nZm9NVjJQKy9lc2wKZXNsNklmMzdNM3gxOC96MnJrcnlCd3JmU3d6RHZMQlVjQnJSSlZkMEdYQWpQRkU3dVRyRHQ1SFBFWTlIVXlwWQpybWNIRTRab3p6WHhFQ09LT0FuSU9jbWtGS1ZZOWlaSmRkTUFhejRpTFZMejNUR0FzZC94aEg3ZVU4c05tUVIxCk9RVks2ZU9UUzAvdnBmd0llaGt2b3VXQS81NkoxS3BCMThXVFIwUmQ0QU9qOWxCOW5PYW5WYi9MbUducCtqMHEKYWxKQ3QvTkJhZU1kUzVBYndrNERtQ3Z5MzRhZlpETXN6WFRZMENTV3BlSlVxMzRFRnFvV0ZYSzVJdmZ1bGlPYwpKL1k9Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K
      server: https://192.168.137.171:6443
      name: kubernetes
      contexts:
    • context:
      cluster: kubernetes
      user: admin
      name: kubernetes
      current-context: kubernetes
      kind: Config
      preferences: {}
      users:
    • name: admin
      user:
      client-certificate-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUQzVENDQXNXZ0F3SUJBZ0lVSFF0a2FXRVQ4SE9OaEFzbmxSRWtBU2JGdkpnd0RRWUpLb1pJaHZjTkFRRUwKQlFBd1pURUxNQWtHQTFVRUJoTUNRMDR4RURBT0JnTlZCQWdUQjBKbGFVcHBibWN4RURBT0JnTlZCQWNUQjBKbAphVXBwYm1jeEREQUtCZ05WQkFvVEEyczRjekVQTUEwR0ExVUVDeE1H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VemwrT1ZtTnU3TWZWLzNCbkJwUTNHQUtVeGxrdk1VZlNwQm5Nd0x6blBXRgpWWG5hZHJQckRVUjVkWkNNQ3NRTTFTYitBRGhJTDBwYXZwZU9pY1B6Q3R5cTlrcXJpQ2YxcjdRWHZycHBNMnRYCk9NNTVuelJ2aFJNaUJYR1NQK3diSHZFQ2dZQXBxaU9VRFIvNE5UcUJVY09jWWpuczZkR1ZlNFloNGdtcW1WbVAKY3B3cVdCVmpkYitlTnpBdFRlaHQ0RWJwM0ZIV242dXB2Y0xFQTBjT0tIMlF3SGFHdHNsRzBPc0czTDE0aXlNUwoxQ0lmZjRIMlgyb24xSm9iY3doa0ZIUHRZL3hTL1ErdGpnR00yOWVuamdSUGJCK1BFYXphRTB6ZjlEZmJqL3dlCjA1bWlBUUtCZ1FDMGhsdXdDUVBPWnBWQzIrVTZoWDhnbDFJbk1ycEpLK0dLK1lCVUxQZ0kyeGc2SzlqbHdaZmcKUGhTT3VzZE9yZCtTZXlIRHQ3ajFoZi9sVmltdVFrSzZMTCtGZmw5emlMY3ozRkFZSFV1TzNYS3BXdHllM1FvRAp3TG9uZEpXVjBja3NSVXFmM0VncCs0cjF2V2FERXNNcXlTa2drYVFrWWtSVHd6OEg4M2ZvR0E9PQotLS0tLUVORCBSU0EgUFJJVkFURSBLRVktLS0tLQo=
      [root@k8smaster ~]#

    转载于:https://blog.51cto.com/andyliu/2129068

    展开全文
  • k8s主节点更换证书后,从节点使用kubectl get pods命令报Config not found: /etc/kubernetes/admin.conf: 解决: 1.替换config文件 更换主节点的证书后,将主节点”.kube/config“文件复制到从节点相应位置 2.复制...
  • kubectl 命令备忘单

    2018-12-17 13:30:48
    kubectl 命令备忘单,常用kubectl命令如:创建对象 显示和查找资源 更新资源 修补资源 编辑资源 扩展资源 删除资源 与运行中的 Pod 交互 与节点和集群交互
  • kubectl命令

    2020-04-14 14:47:38
    kubectl 详细命令用法可以参考官网: https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands kubectl 常用的命令总结 只显示默认命名空间的pods kubectl get pods 显示所有空间的pod kubectl...
  • kubectl命令使用记录

    2020-05-07 17:27:42
    文章目录kubectl 命令tab自动补全配置简单的kubectl 命令使用kubectl 与awk、xargs 的组合命令使用节点上下线维护 kubectl 命令tab自动补全配置 yum install -y bash-completion source /usr/share/bash-completion/...
  • kubectl命令详解

    2020-11-05 18:09:04
    文章目录Kubernetes kubectl 命令表"一劳永逸" 的话,有是有的,而 "一劳永逸" 的事却极少kubectl run语法:示例:其它详细说明kubectl expose语法kubectl annotate有效资源类型包括:语法示例kubectl autoscale语法...
  • Kubectl命令使用

    2020-09-10 13:36:31
    Kubectl 命令使用 查看帮助 kubectl --help kubectl get --help 查看集群地址,节点,运行状态 kubectl cluster-info 查看集群版本 kubectl version kubectl get 查看资源 kubectl get <资源类型> ...
  • 1、先进入master节点 cd 到/root./kube文件 复制./kube文件下的config文件 2、到工作节点下 cd 到/root/目录下 mkdir .kube 创建.kube文件 cd .kube cd到.kube文件 将主节点中的config文件粘贴到这个目录下即可
  • kubectl 命令梳理

    2019-09-18 05:16:36
    kubectl 命令梳理 Kubctl 命令是操作 kubernetes 集群的最直接的途径,下面对相关命令进行简介: 语法 $ kubectl [command] [TYPE] ...kubectl命令的帮助很详细,kubectl -h会列出所有的子命令,在任何子命令后跟 -...
  • 从Kubernetes 1.12开始,kubectl现在允许添加外部可执行文件作为子命令。 有关更多详细信息,请参见 您可以使用kubectl ssh-jump ...运行插件kubectl ssh-jump ... Kubectl版本< 1.12.0 您仍然可以直接使用...
  • kubectl命令大全

    万次阅读 2018-07-01 16:09:36
    kubectl 输出格式 显示Pod的更多信息 kubectl get pod &amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;lt;pod-name&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt; -o wide 以yaml格式...
  • kubectl命令的用法

    2020-05-07 22:57:32
    kubectl命令的用法 今天来跟大家聊聊如何使用kubectl的命令 kubectl命令 1.创建命令和docker run命令很像。我们通过–help来看看怎么用。 kubectl run --help Create and run a particular image, possibly ...
  • kubectl命令总结

    2021-04-26 17:38:31
    kubectl命令 基础命令:create,delete,get,run,expose,explain,edit,set create命令:通过文件名或标准输入创建资源 例:创建Bigeyes和Service资源 kubectl create -f demo-Bigeyes.yaml kubectl create -f demo-...
  • 运行命令kubectl get pod 报错: The connection to the server localhost:8080 was refused - did you specify the right host or port? 解决方法: cat /etc/kubernetes/kubelet.conf clusters.cluster....
  • 常用kubectl命令

    2020-08-24 20:12:37
    kubectl get nodes 显示node 的详细信息 kubectl describe nodes “node-name” 将 node 节点标记为不可调度,不影响现有 pod。注意 daemonSet 不受影响 kubectl cordon node-name 驱逐该节点的 pod kubectl ...
  • kubectl命令解析

    2018-10-26 09:30:45
    kubectl命令工具:  kubectl &lt;command&gt; help  基础命令:  create 通过文件名或标准输入创建资源  expose 将一个资源公开为一个新的kubernetes服务  run 1.创建并运行一个特定的镜像 2.创建一个...
  • 常用的kubectl命令

    2019-05-06 16:22:00
    这里主要借助kubectl命令来实现。以下列出常用命令,后面会对每个命令进行详细解释,并举例: kubectl核心命令 get 获取列出一个或多个资源的信息。(资源分为pod、instance、service等很多种)describe 输出指定...
  • k8s集群管理----kubectl命令 文章目录k8s集群管理----kubectl命令1. kubectl2. kubectl命令格式 1. kubectl kubectl的命令 kubectl annotate – 更新资源的注解。 kubectl api-versions – 以“组/版本”的格式...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 16,335
精华内容 6,534
关键字:

节点没有kubectl命令