我正在尝试用Pulumi为我的吊舱安装HPA v1
new HorizontalPodAutoscaler(
`${prefixedHPAName}`,
{
apiVersion: 'autoscaling/v1',
kind: 'HorizontalPodAutoscaler',
metadata: {
name: 'worker',
clusterName: 'redacted',
namespace: namespaceName
},
spec: {
maxReplicas: 3,
minReplicas: 1,
scaleTargetRef: {
apiVersion: 'apps/v1',
kind: 'Deployment',
name: 'worker'
},
targetCPUUtilizationPercentage: 50,
}
}
);但我一直收到以下错误
kubernetes:autoscaling/v1:HorizontalPodAutoscaler (tushar-routex-routex-hpa):
error: configured Kubernetes cluster is unreachable: unable to load Kubernetes client configuration from kubeconfig file: invalid configuration: no configuration has been provided, try setting KUBERNETES_MASTER environment variable有什么例子说明如何通过普鲁米为我的舱设置HPA?
发布于 2022-08-10 22:36:32
这个问题与HPA或pulumi无关,这是kubectl/kubernetes客户端常见的问题,客户端无法找到连接到K8S API的kubectl文件。检查路径~/.kube/config中是否有配置文件,然后尝试在使用pulumi之前导出路径
export KUBECONFIG=~/.kube/config如果您没有文件,您可以检查云提供商的文档来创建它。
https://stackoverflow.com/questions/73312302
复制相似问题