配置kubectl在Windows上使用远程Kubernetes集群

问题描述 投票:0回答:1

我想配置kubectl使用远程Kubernetes簇我的本地Windows机器上遵循"Install with Chocolatey on Windows"教程。但是,我不太知道如何填写配置文件。它应该是这样的莫名其妙:

apiVersion: v1
clusters: []
contexts: []
current-context: ""
kind: Config
preferences: {}
users: []

或者这一点,但我喜欢不知道如何填补这些“变量”

apiVersion: v1
clusters:
- cluster:
    server: https://123.456.789.123:9999
    certificate-authority-data: yourcertificate
  name: your-k8s-cluster-name
contexts:
- context:
    cluster: your-k8s-cluster-name
    namespace: default
    user: admin
  name: default-context
current-context: default-context
kind: Config
preferences: {}
users:
- name: admin
  user:
    token: your-login-token
windows kubernetes config kubectl chocolatey
1个回答
1
投票

此变量必须用特殊的kubeconfig文件的K8S群集管理员提供。之后,你可以访问你--kubeconfig <path to you kubeconfig file>选项集群:

kubectl cluster-info --kubeconfig ./.kube/config -v=7 --insecure-skip-tls-verify=true --alsologtostderr
© www.soinside.com 2019 - 2024. All rights reserved.