如何编写 kubeadm 1.14.1 配置文件以将 Horizo​​ntal-pod-autoscaler-use-rest-clients 设置为 True

如何编写 kubeadm 1.14.1 配置文件以将 Horizo​​ntal-pod-autoscaler-use-rest-clients 设置为 True

我想创建一个 kubeadm 配置文件(kubeadm.yaml),它可以用于多个节点kubeadm init --config kubeadm.yaml

我现在面临的问题是,我想设置horizontal-pod-autoscaler-use-rest-clients到配置文件中。但是 kubeadmin 1.14.1 报告以下错误:

[root@testhost k8s]# kubeadm init --config kubeadm.yaml
W0417 12:54:19.923171    2745 strict.go:54] error unmarshaling configuration schema.GroupVersionKind{Group:"kubeadm.k8s.io", Version:"v1beta1", Kind:"InitConfiguration"}: error unmarshaling JSON: while decoding JSON: json: unknown field "controllerManager"
[init] Using Kubernetes version: v1.14.1
[preflight] Running pre-flight checks

kubeadm.yaml:

apiVersion: kubeadm.k8s.io/v1beta1
kind: InitConfiguration
controllerManager:
  ExtraArgs:
    horizontal-pod-autoscaler-use-rest-clients: "true"
    horizontal-pod-autoscaler-sync-period: "10s"
    node-monitor-grace-period: "10s"

已安装的 Kubernetes RPM:

kubernetes-cni-0.7.5-0.x86_64
kubeadm-1.14.0-0.x86_64
kubelet-1.14.0-0.x86_64
kubectl-1.14.0-0.x86_64

操作系统版本:CentOS Linux release 7.6.1810 (Core)

如果有人能帮助我我将不胜感激。

答案1

apiVersion: kubeadm.k8s.io/v1beta1
kind: ClusterConfiguration
kubernetesVersion: v1.14.1
networking:
    podSubnet: "192.168.0.0/16"
controllerManager:
  extraArgs:
    horizontal-pod-autoscaler-use-rest-clients: "true"
    horizontal-pod-autoscaler-sync-period: "10s"
    node-monitor-grace-period: "10s"

无法使用文件工作,kind: InitConfiguration但可以使用 ClusterConfiguration

相关内容