我首先使用 systemd 服务安装了 ectd、kubeapiserver 和 kubelet。服务运行良好并侦听所有必需的端口。
当我运行 kubectl cluster-info 时,我得到以下输出
Kubernetes master is running at http://localhost:8080
Run Code Online (Sandbox Code Playgroud)
当我运行 kubectl get componentstatuses 时,我得到以下输出
etcd-0 Healthy {"health": "true"}
Run Code Online (Sandbox Code Playgroud)
但是运行 kubectl get nodes ,我得到以下错误
Error from server (ServerTimeout): the server cannot complete the requested operation at this time, try again later (get nodes)
Run Code Online (Sandbox Code Playgroud)
任何人都可以帮我解决这个问题。
我们在 AKS 集群中部署了一个映像,需要在部署期间使用配置映射更新其配置条目。
配置文件具有以下键,我们尝试替换“ChildKey”的值而不替换整个文件 -
{
"ParentKey": {
"ChildKey": "123"
}
}
Run Code Online (Sandbox Code Playgroud)
配置映射看起来像 -
apiVersion: v1
data:
ParentKey: |
ChildKey: 456
kind: ConfigMap
name: cf
Run Code Online (Sandbox Code Playgroud)
在部署中,configmap的使用方式如下 -
apiVersion: extensions/v1beta1
kind: Deployment
spec:
template:
metadata:
creationTimestamp: null
labels:
app: abc
spec:
containers:
- env:
- name: ParentKey
valueFrom:
configMapKeyRef:
key: ParentKey
name: cf
Run Code Online (Sandbox Code Playgroud)
替换件不适用于上述设置。是否有不同的方法来声明嵌套结构的键名称?
苹果系统
我只是通过以下方式安装 kubectl: https: //kubernetes.io/docs/tasks/tools/install-kubectl/#install-kubectl-on-macos
MacBook-Air:~ admin$ kubectl version
Client Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.0", GitCommit:"70132b0f130acc0bed193d9ba59dd186f0e634cf", GitTreeState:"clean", BuildDate:"2019-12-07T21:20:10Z", GoVersion:"go1.13.4", Compiler:"gc", Platform:"darwin/amd64"}
The connection to the server localhost:8080 was refused - did you specify the right host or port?
Run Code Online (Sandbox Code Playgroud)
可能是什么问题,有什么想法吗?