k8s kube-proxy 生成kube-config文件

接着上面的博客继续写

  pwd

  /etc/kubernetes

  设置集群参数

  kubectl config set-cluster kubernetes --certificate-authority=/etc/kubernetes/ssl/ca.pem --server=https://192.168.1.71:6443 --kubeconfig=kube-proxy.kubeconfig

  设置客户端认证参数

  kubectl config set-credentials kube-proxy --client-certificate=/etc/kubernetes/ssl/kube-proxy-1-71.pem --client-key=/etc/kubernetes/ssl/kube-proxy-1-71.key --kubeconfig=kube-proxy.kubeconfig

  设置上下文参数

  kubectl config set-context default --cluster=kubernetes --user=kube-proxy --kubeconfig=kube-proxy.kubeconfig

  设置默认上下文

  kubectl config use-context default --kubeconfig=kube-proxy.kubeconfig

  

  cat kube-proxy.kubeconfig  

apiVersion: v1
clusters:
- cluster:
    certificate-authority: ssl/ca.pem
    server: https://192.168.1.71:6443
  name: kubernetes
contexts:
- context:
    cluster: kubernetes
    user: kube-proxy
  name: default
current-context: default
kind: Config
preferences: {}
users:
- name: kube-proxy
  user:
    as-user-extra: {}
    client-certificate: ssl/kube-proxy-1-71.pem
    client-key: ssl/kube-proxy-1-71.key

 

上一篇:Qt 窗体应用基本操作


下一篇:《python解释器源码剖析》第0章--python的架构与编译python