我正在设置一个kind集群
Creating cluster "kind" ...\n \xe2\x9c\x93 Ensuring node image (kindest/node:v1.22.1) \n \xe2\x9c\x93 Preparing nodes \n \xe2\x9c\x93 Writing configuration \n \xe2\x9c\x93 Starting control-plane \xef\xb8\x8f \n \xe2\x9c\x93 Installing CNI \n \xe2\x9c\x93 Installing StorageClass \n \xe2\x9c\x93 Joining worker nodes \n \xe2\x9c\x93 Waiting \xe2\x89\xa4 5m0s for control-plane = Ready \xe2\x8f\xb3 \n \xe2\x80\xa2 Ready after 0s \nRun Code Online (Sandbox Code Playgroud)\n然后尝试按照版本 1.6 的说明安装 ECK 运算符
\nkubectl apply -f https://download.elastic.co/downloads/eck/1.6.0/all-in-one.yaml\nRun Code Online (Sandbox Code Playgroud)\n但是该过程失败了,好像kind不支持 CRD...是这样吗?
namespace/elastic-system created\nserviceaccount/elastic-operator created\nsecret/elastic-webhook-server-cert created\nconfigmap/elastic-operator created\nclusterrole.rbac.authorization.k8s.io/elastic-operator created\nclusterrole.rbac.authorization.k8s.io/elastic-operator-view …Run Code Online (Sandbox Code Playgroud) 我已经成功部署了以下集群:
apiVersion: kind.x-k8s.io/v1alpha4
kind: Cluster
nodes:
- role: control-plane
extraPortMappings:
- containerPort: 80
hostPort: 30000
listenAddress: "0.0.0.0" # Optional, defaults to "0.0.0.0"
protocol: tcp # Optional, defaults to tcp
- role: worker
Run Code Online (Sandbox Code Playgroud)
然后是一个非常简单的部署:
apiVersion: apps/v1
kind: Deployment
metadata:
name: hostname-deployment
labels:
app: hostname
spec:
replicas: 2
selector:
matchLabels:
app: hostname
template:
metadata:
labels:
app: hostname
spec:
containers:
- name: hostname
image: hostname:0.1
ports:
- containerPort: 80
Run Code Online (Sandbox Code Playgroud)
和一项服务:
apiVersion: v1
kind: Service
metadata:
name: hostname-service
spec: …Run Code Online (Sandbox Code Playgroud) 我正在kind本地 Macbook 上运行测试 kubernetes 集群。
我发现其中一个节点的状态为NotReady:
$ kind get clusters
mc
$ kubernetes get nodes
NAME STATUS ROLES AGE VERSION
mc-control-plane Ready master 4h42m v1.18.2
mc-control-plane2 Ready master 4h41m v1.18.2
mc-control-plane3 Ready master 4h40m v1.18.2
mc-worker NotReady <none> 4h40m v1.18.2
mc-worker2 Ready <none> 4h40m v1.18.2
mc-worker3 Ready <none> 4h40m v1.18.2
Run Code Online (Sandbox Code Playgroud)
唯一有趣的kubectl describe node mc-worker是 CNI 插件未初始化:
Conditions:
Type Status LastHeartbeatTime LastTransitionTime Reason Message
---- ------ ----------------- ------------------ ------ -------
MemoryPressure False Tue, 11 Aug …Run Code Online (Sandbox Code Playgroud) 我已经使用 containerd 运行时创建了一个 Kind 集群。这是我的节点:
root@dev-001:~# k get nodes -o wide
NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME
local-cluster-control-plane Ready control-plane,master 7d8h v1.20.2 172.18.0.2 <none> Ubuntu 20.10 5.4.0-81-generic containerd://1.4.0-106-gce4439a8
local-cluster-worker Ready <none> 7d8h v1.20.2 172.18.0.5 <none> Ubuntu 20.10 5.4.0-81-generic containerd://1.4.0-106-gce4439a8
local-cluster-worker2 Ready <none> 7d8h v1.20.2 172.18.0.3 <none> Ubuntu 20.10 5.4.0-81-generic containerd://1.4.0-106-gce4439a8
local-cluster-worker3 Ready <none> 7d8h v1.20.2 172.18.0.4 <none> Ubuntu 20.10 5.4.0-81-generic containerd://1.4.0-106-gce4439a8
Run Code Online (Sandbox Code Playgroud)
我如何 ssh 进入节点?
种类版本:0.11.1 或更高版本
运行时:containerd(不是docker)
我正在尝试为我的 kubernetes 集群设置一个kind集群。不幸的是,在写入节点时准备好节点后失败了。我将附上输出和一些信息。预先感谢您的任何帮助!
干杯
\n$ kind create cluster --config kind-config.yaml \n\nCreating cluster "kind" ...\n \xe2\x9c\x93 Ensuring node image (kindest/node:v1.20.2) \n \xe2\x9c\x93 Preparing nodes \n \xe2\x9c\x97 Writing configuration \nERROR: failed to create cluster: failed to generate kubeadm config content: failed to get kubernetes version from node: failed to get file: command "docker exec --privileged kind-worker3 cat /kind/version" failed with error: exit status 1\nCommand Output: Error response from daemon: Container c41566958be2239a9470ef2ea636c4b21958ee7620086f526954a02e4a605106 is not running\nRun Code Online (Sandbox Code Playgroud)\n我正在尝试按照本教程学习使用kind。我刚刚使用brew install安装的版本是:kind version 0.11.1
配置文件如下所示:
kind: Cluster
apiVersion: kind.sigs.k8s.io/v1alpha3
nodes:
- role: control-plane
extraPortMappings:
- containerPort: 30080
hostPort: 80
listenAddress: "0.0.0.0"
protocol: TCP
Run Code Online (Sandbox Code Playgroud)
ERROR: failed to create cluster: unknown apiVersion: kind.sigs.k8s.io/v1alpha3显然该版本是错误的,因为当我尝试创建集群时出现错误: $ kind create cluster --name mycluster --config config/kind.config.yaml --wait 5m。
我找到了一些其他版本字符串的示例,但是当尝试spec在同一教程中添加块时,我收到配置错误。我认为这意味着 API 在版本和我正在使用的 yaml 之间发生了中断。
为什么我会收到原始的“无法创建集群”错误,在哪里可以找到将种类版本与 yaml 语法相关联的文档?
我已经扫描了所有资源,仍然找不到在extraPortMappings不删除和重新创建的情况下更改 Kind 集群的方法。
这可能吗?如何实现?
我正在使用 Kind 在本地部署 k8s 集群。图像部署正常,当我查看服务列表时,我看到以下内容
我正在尝试访问的服务是chatt-service,如果您注意到该服务EXTERNAL-IP正在等待处理。我知道 minikube 有一个命令可以实现此操作,但如何在Kind集群上执行此操作?
我想设置一个持久卷(pv 和 pvc),由Kind 集群中的 pod 共享。但是我还需要将数据保留在我的笔记本电脑(主机服务器)中,因此卷的路径应该是我的笔记本电脑中的某些内容,我可以直接访问它。
如果我删除 kind 集群,该卷应该被持久化,而不是被破坏。
我希望可以轻松地添加或更新该卷,或者从我的主机笔记本电脑中复制文件。
如何让 Pod 在 KIND 集群中知道它?
粘贴我的kind.yaml供您参考
$ kind
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
- role: worker
- role: worker
- role: worker
Run Code Online (Sandbox Code Playgroud) 我安装了kind来玩弄 Kubernetes。
如果我使用topCPU 使用率(key)并进行排序C,那么我会发现它kube-apiserver不断消耗 5% 到 10% 的 CPU。
为什么?
我到目前为止还没有安装任何东西:
guettli@p15:~$ kubectl get pods --all-namespaces
NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system coredns-558bd4d5db-ntg7c 1/1 Running 0 40h
kube-system coredns-558bd4d5db-sx8w9 1/1 Running 0 40h
kube-system etcd-kind-control-plane 1/1 Running 0 40h
kube-system kindnet-9zkkg 1/1 Running 0 40h
kube-system kube-apiserver-kind-control-plane 1/1 Running 0 40h
kube-system kube-controller-manager-kind-control-plane 1/1 Running 0 40h
kube-system kube-proxy-dthwl 1/1 Running 0 40h
kube-system kube-scheduler-kind-control-plane 1/1 Running 0 40h
local-path-storage local-path-provisioner-547f784dff-xntql …Run Code Online (Sandbox Code Playgroud)