{"id":79729,"date":"2026-03-02T23:18:47","date_gmt":"2026-03-02T15:18:47","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/79729.html"},"modified":"2026-03-02T23:18:47","modified_gmt":"2026-03-02T15:18:47","slug":"%e5%a6%82%e4%bd%95%e5%9c%a8%e9%a6%99%e6%b8%af%e6%9c%8d%e5%8a%a1%e5%99%a8-ubuntu-22-04-%e4%b8%8a-%e5%ae%89%e8%a3%85-kubernetes-%e9%9b%86%e7%be%a4-kubesphere-%e6%8e%a7%e5%88%b6%e5%8f%b0-%e5%ae%9e","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/79729.html","title":{"rendered":"\u5982\u4f55\u5728\u9999\u6e2f\u670d\u52a1\u5668 Ubuntu 22.04 \u4e0a \u5b89\u88c5 Kubernetes \u96c6\u7fa4 + KubeSphere \u63a7\u5236\u53f0 \u5b9e\u73b0\u5bb9\u5668\u5316\u670d\u52a1\u7ba1\u7406\u6559\u7a0b\uff08\u6df1\u5ea6\u6280\u672f\u65b9\u6848\uff09"},"content":{"rendered":"<p>\u5982\u4f55\u5728\u9999\u6e2f\u670d\u52a1\u5668\u4e0a\u7528 Ubuntu 22.04 \u6784\u5efa\u751f\u4ea7\u7ea7 Kubernetes \u96c6\u7fa4&#xff0c;\u5e76\u5b89\u88c5 KubeSphere \u63a7\u5236\u53f0\u7528\u4e8e\u53ef\u89c6\u5316\u5bb9\u5668\u5316\u670d\u52a1\u7ba1\u7406\u7684\u5b8c\u6574\u843d\u5730\u65b9\u6848\u3002A5\u6570\u636e\u5168\u7a0b\u6d89\u53ca\u786c\u4ef6\u914d\u7f6e\u5efa\u8bae\u3001\u7f51\u7edc\u65b9\u6848\u5bf9\u6bd4\u3001\u8be6\u7ec6\u4ee3\u7801\u793a\u4f8b\u3001\u914d\u7f6e\u6587\u4ef6\u3001\u7ec4\u4ef6\u7248\u672c\u63a7\u5236\u548c\u5173\u952e\u6280\u672f\u7ec6\u8282\u3002<\/p>\n<hr \/>\n<h3>\u4e00\u3001\u524d\u8a00<\/h3>\n<p>\u5728\u8de8\u5883\u670d\u52a1\u573a\u666f\u4e2d&#xff0c;\u9ad8\u53ef\u7528\u3001\u53ef\u89c2\u6d4b\u7684\u5bb9\u5668\u5e73\u53f0\u662f\u73b0\u4ee3\u5fae\u670d\u52a1\u3001CI\/CD \u548c DevOps \u7684\u6838\u5fc3\u57fa\u7840\u8bbe\u65bd\u3002\u6211\u4eec\u9009\u7528 Kubernetes&#xff08;k8s&#xff09;\u4f5c\u4e3a\u5bb9\u5668\u8c03\u5ea6\u5f15\u64ce&#xff0c;\u5e76\u5f15\u5165 KubeSphere \u63d0\u4f9b\u53ef\u89c6\u5316\u3001\u9879\u76ee\u9694\u79bb\u3001\u8fd0\u7ef4\u5ba1\u8ba1\u7b49\u4f01\u4e1a\u7ea7\u7ba1\u7406\u529f\u80fd\u3002<\/p>\n<hr \/>\n<h3>\u4e8c\u3001\u76ee\u6807\u5e73\u53f0\u4e0e\u7248\u672c<\/h3>\n<table>\n<tr>\u7ec4\u4ef6\u7248\u672c\/\u8bf4\u660e<\/tr>\n<tbody>\n<tr>\n<td>\u64cd\u4f5c\u7cfb\u7edf<\/td>\n<td>Ubuntu 22.04 LTS x86_64<\/td>\n<\/tr>\n<tr>\n<td>Kubernetes<\/td>\n<td>v1.26.x<\/td>\n<\/tr>\n<tr>\n<td>Container Runtime<\/td>\n<td>containerd v1.6.x<\/td>\n<\/tr>\n<tr>\n<td>\u7f51\u7edc\u63d2\u4ef6<\/td>\n<td>Calico v3.25<\/td>\n<\/tr>\n<tr>\n<td>KubeSphere<\/td>\n<td>v4.3.x<\/td>\n<\/tr>\n<tr>\n<td>DNS<\/td>\n<td>CoreDNS<\/td>\n<\/tr>\n<tr>\n<td>LoadBalancer<\/td>\n<td>MetalLB (Bare Metal LB)<\/td>\n<\/tr>\n<tr>\n<td>\u65f6\u95f4\u540c\u6b65<\/td>\n<td>chrony<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<h3>\u4e09\u3001\u9999\u6e2f\u670d\u52a1\u5668www.a5idc.com\u786c\u4ef6\u4e0e\u7f51\u7edc\u914d\u7f6e\u5efa\u8bae<\/h3>\n<p>\u9488\u5bf9\u751f\u4ea7\u7ea7\u96c6\u7fa4&#xff0c;\u63a8\u8350\u6700\u4f4e\u786c\u4ef6\u5982\u4e0b&#xff1a;<\/p>\n<table>\n<tr>\u8282\u70b9\u7c7b\u578bCPU\u5185\u5b58\u78c1\u76d8\u5e26\u5bbd\/\u7f51\u7edc<\/tr>\n<tbody>\n<tr>\n<td>master \u8282\u70b9<\/td>\n<td>4 vCPU<\/td>\n<td>8 GB<\/td>\n<td>100 GB SSD<\/td>\n<td>1 Gbps<\/td>\n<\/tr>\n<tr>\n<td>worker \u8282\u70b9<\/td>\n<td>8 vCPU<\/td>\n<td>16 GB<\/td>\n<td>200&#043; GB SSD<\/td>\n<td>1 Gbps<\/td>\n<\/tr>\n<tr>\n<td>\u5b58\u50a8\u76d8<\/td>\n<td>NVMe SSD \u4f18\u5148<\/td>\n<td>\u2014<\/td>\n<td>\u2014<\/td>\n<td>\u2014<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u6ce8\u610f \u5728\u9999\u6e2f\u670d\u52a1\u5668\u73af\u5883\u4e2d&#xff0c;\u516c\u7f51\u5e26\u5bbd\u8d28\u91cf\u4e0e\u5ef6\u8fdf\u5bf9\u955c\u50cf\u62c9\u53d6\u3001Pod \u7f51\u7edc\u901a\u8baf\u6709\u76f4\u63a5\u5f71\u54cd\u3002\u52a1\u5fc5\u4fdd\u8bc1 CN2 \/ BGP \u5e26\u5bbd\u53ef\u7528&#xff0c;\u5e76\u5728\u5fc5\u8981\u65f6\u914d\u7f6e\u955c\u50cf\u52a0\u901f&#xff08;\u8be6\u89c1\u540e\u6587&#xff09;\u3002<\/p>\n<hr \/>\n<h3>\u56db\u3001\u8282\u70b9\u51c6\u5907\u4e0e\u7cfb\u7edf\u4f18\u5316<\/h3>\n<h4>4.1 \u5173\u95ed Swap<\/h4>\n<p><span class=\"token function\">sudo<\/span> swapoff -a<br \/>\n<span class=\"token function\">sudo<\/span> <span class=\"token function\">sed<\/span> -i <span class=\"token string\">&#039;\/ swap \/ s\/^\/#\/&#039;<\/span> \/etc\/fstab<\/p>\n<h4>4.2 \u7cfb\u7edf\u53c2\u6570\u8c03\u6574&#xff08;\u7528\u4e8e Kubernetes&#xff09;<\/h4>\n<p>\u521b\u5efa \/etc\/sysctl.d\/k8s.conf&#xff1a;<\/p>\n<p><span class=\"token function\">cat<\/span> <span class=\"token operator\">&lt;&lt;<\/span><span class=\"token string\">EOF<span class=\"token bash punctuation\"> <span class=\"token operator\">|<\/span> <span class=\"token function\">sudo<\/span> <span class=\"token function\">tee<\/span> \/etc\/sysctl.d\/k8s.conf<\/span><br \/>\nnet.bridge.bridge-nf-call-ip6tables &#061; 1<br \/>\nnet.bridge.bridge-nf-call-iptables &#061; 1<br \/>\nnet.ipv4.ip_forward &#061; 1<br \/>\nEOF<\/span><br \/>\n<span class=\"token function\">sudo<\/span> sysctl &#8211;system<\/p>\n<h4>4.3 \u5b89\u88c5\u57fa\u7840\u4f9d\u8d56<\/h4>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">apt<\/span> update <span class=\"token operator\">&amp;&amp;<\/span> <span class=\"token function\">sudo<\/span> <span class=\"token function\">apt<\/span> <span class=\"token function\">install<\/span> -y apt-transport-https ca-certificates <span class=\"token function\">curl<\/span> software-properties-common chrony<\/p>\n<p>\u542f\u7528 chrony \u65f6\u95f4\u540c\u6b65&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> systemctl <span class=\"token builtin class-name\">enable<\/span> &#8211;now chrony<\/p>\n<hr \/>\n<h3>\u4e94\u3001\u5bb9\u5668\u8fd0\u884c\u65f6\u5b89\u88c5&#xff1a;containerd<\/h3>\n<p>\u5b89\u88c5 containerd&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">apt<\/span> <span class=\"token function\">install<\/span> -y containerd<br \/>\n<span class=\"token function\">sudo<\/span> <span class=\"token function\">mkdir<\/span> -p \/etc\/containerd<br \/>\ncontainerd config default <span class=\"token operator\">|<\/span> <span class=\"token function\">sudo<\/span> <span class=\"token function\">tee<\/span> \/etc\/containerd\/config.toml<br \/>\n<span class=\"token function\">sudo<\/span> systemctl restart containerd<br \/>\n<span class=\"token function\">sudo<\/span> systemctl <span class=\"token builtin class-name\">enable<\/span> containerd<\/p>\n<p>\u786e\u4fdd\u4f7f\u7528 Systemd cgroup&#xff1a;<\/p>\n<p>\u7f16\u8f91 \/etc\/containerd\/config.toml&#xff1a;<\/p>\n<p>[plugins.&#034;io.containerd.grpc.v1.cri&#034;.containerd.runtimes.runc.options]<br \/>\n  SystemdCgroup &#061; true<\/p>\n<p>\u91cd\u542f containerd&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> systemctl restart containerd<\/p>\n<hr \/>\n<h3>\u516d\u3001Kubernetes \u7ec4\u4ef6\u5b89\u88c5<\/h3>\n<h4>6.1 \u6dfb\u52a0 Kubernetes apt \u6e90<\/h4>\n<p><span class=\"token function\">curl<\/span> -fsSL https:\/\/packages.cloud.google.com\/apt\/doc\/apt-key.gpg <span class=\"token operator\">|<\/span> <span class=\"token function\">sudo<\/span> apt-key <span class=\"token function\">add<\/span> &#8211;<br \/>\n<span class=\"token function\">sudo<\/span> add-apt-repository <span class=\"token string\">&#034;deb https:\/\/apt.kubernetes.io\/ kubernetes-xenial main&#034;<\/span><br \/>\n<span class=\"token function\">sudo<\/span> <span class=\"token function\">apt<\/span> update<\/p>\n<h4>6.2 \u5b89\u88c5 kubeadm\u3001kubelet\u3001kubectl<\/h4>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">apt<\/span> <span class=\"token function\">install<\/span> -y <span class=\"token assign-left variable\">kubelet<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token number\">1.26<\/span>.7-00 <span class=\"token assign-left variable\">kubeadm<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token number\">1.26<\/span>.7-00 <span class=\"token assign-left variable\">kubectl<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token number\">1.26<\/span>.7-00<br \/>\n<span class=\"token function\">sudo<\/span> apt-mark hold kubelet kubeadm kubectl<\/p>\n<p>\u7248\u672c\u53f7\u4f9d\u636e\u5b9e\u9645\u53d1\u5e03\u65e5\u671f\u8c03\u6574\u3002<\/p>\n<hr \/>\n<h3>\u4e03\u3001\u96c6\u7fa4\u521d\u59cb\u5316<\/h3>\n<p>\u5728\u7b2c\u4e00\u4e2a master \u8282\u70b9\u6267\u884c&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> kubeadm init <span class=\"token punctuation\">\\\\<\/span><br \/>\n  &#8211;apiserver-advertise-address<span class=\"token operator\">&#061;<\/span><span class=\"token operator\">&lt;<\/span>MASTER_PRIVATE_IP<span class=\"token operator\">&gt;<\/span> <span class=\"token punctuation\">\\\\<\/span><br \/>\n  &#8211;pod-network-cidr<span class=\"token operator\">&#061;<\/span><span class=\"token number\">192.168<\/span>.0.0\/16 <span class=\"token punctuation\">\\\\<\/span><br \/>\n  &#8211;control-plane-endpoint<span class=\"token operator\">&#061;<\/span><span class=\"token operator\">&lt;<\/span>LOAD_BALANCER_IP_OR_DNS<span class=\"token operator\">&gt;<\/span><\/p>\n<p>\u8f93\u51fa\u4e2d\u4f1a\u5305\u542b kubeadm join \u547d\u4ee4&#xff0c;\u7528\u4e8e\u540e\u7eed\u8282\u70b9\u52a0\u5165\u3002<\/p>\n<p>\u914d\u7f6e kubeconfig&#xff1a;<\/p>\n<p><span class=\"token function\">mkdir<\/span> -p <span class=\"token environment constant\">$HOME<\/span>\/.kube<br \/>\n<span class=\"token function\">sudo<\/span> <span class=\"token function\">cp<\/span> -i \/etc\/kubernetes\/admin.conf <span class=\"token environment constant\">$HOME<\/span>\/.kube\/config<br \/>\n<span class=\"token function\">sudo<\/span> <span class=\"token function\">chown<\/span> <span class=\"token variable\"><span class=\"token variable\">$(<\/span><span class=\"token function\">id<\/span> -u<span class=\"token variable\">)<\/span><\/span><span class=\"token builtin class-name\">:<\/span><span class=\"token variable\"><span class=\"token variable\">$(<\/span><span class=\"token function\">id<\/span> -g<span class=\"token variable\">)<\/span><\/span> <span class=\"token environment constant\">$HOME<\/span>\/.kube\/config<\/p>\n<hr \/>\n<h3>\u516b\u3001\u7f51\u7edc\u63d2\u4ef6\u5bf9\u6bd4\u4e0e\u9009\u62e9<\/h3>\n<p>\u6211\u4eec\u63a8\u8350\u4f7f\u7528 Calico \u4f5c\u4e3a CNI&#xff08;\u9ad8\u6027\u80fd\u3001\u652f\u6301 NetworkPolicy&#xff09;&#xff1a;<\/p>\n<table>\n<tr>\u7f51\u7edc\u63d2\u4ef6\u4f18\u70b9\u7f3a\u70b9<\/tr>\n<tbody>\n<tr>\n<td>Calico<\/td>\n<td>\u7f51\u7edc\u7b56\u7565\u4e30\u5bcc\u3001\u9ad8\u6027\u80fd<\/td>\n<td>\u914d\u7f6e\u9009\u9879\u591a&#xff0c;\u5b66\u4e60\u66f2\u7ebf\u7a0d\u9661<\/td>\n<\/tr>\n<tr>\n<td>Flannel<\/td>\n<td>\u7b80\u5355\u6613\u7528<\/td>\n<td>\u4e0d\u652f\u6301\u7ec6\u7c92\u5ea6\u7f51\u7edc\u7b56\u7565<\/td>\n<\/tr>\n<tr>\n<td>Weave<\/td>\n<td>\u81ea\u52a8\u62d3\u6251\u53d1\u73b0<\/td>\n<td>\u5927\u89c4\u6a21\u573a\u666f\u6027\u80fd\u6709\u9650<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u5b89\u88c5 Calico&#xff1a;<\/p>\n<p>kubectl apply -f https:\/\/docs.projectcalico.org\/manifests\/calico.yaml<\/p>\n<hr \/>\n<h3>\u4e5d\u3001\u52a0\u5165 Worker \u8282\u70b9<\/h3>\n<p>\u5728\u6bcf\u4e2a Worker \u8282\u70b9\u6267\u884c master \u521d\u59cb\u5316\u65f6\u8f93\u51fa\u7684 join \u547d\u4ee4&#xff0c;\u4f8b\u5982&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> kubeadm <span class=\"token function\">join<\/span> <span class=\"token operator\">&lt;<\/span>MASTER_IP<span class=\"token operator\">&gt;<\/span>:6443 <span class=\"token punctuation\">\\\\<\/span><br \/>\n  &#8211;token <span class=\"token operator\">&lt;<\/span>TOKEN<span class=\"token operator\">&gt;<\/span> <span class=\"token punctuation\">\\\\<\/span><br \/>\n  &#8211;discovery-token-ca-cert-hash sha256:<span class=\"token operator\">&lt;<\/span>HASH<span class=\"token operator\">&gt;<\/span><\/p>\n<p>\u9a8c\u8bc1&#xff1a;<\/p>\n<p>kubectl get nodes<\/p>\n<hr \/>\n<h3>\u5341\u3001KubeSphere \u63a7\u5236\u53f0\u5b89\u88c5<\/h3>\n<h4>10.1 KubeSphere \u5b89\u88c5\u51c6\u5907<\/h4>\n<p>\u786e\u4fdd\u96c6\u7fa4\u72b6\u6001\u5065\u5eb7&#xff1a;<\/p>\n<p>kubectl get cs<\/p>\n<h4>10.2 \u5b89\u88c5 KubeSphere<\/h4>\n<p>\u4f7f\u7528\u5b98\u65b9\u4e00\u952e\u5b89\u88c5\u811a\u672c&#xff1a;<\/p>\n<p><span class=\"token function\">curl<\/span> -L https:\/\/kubesphere.io\/dls\/kubesphere-v4.3.3\/kubesphere-installer.yaml -o kubesphere-installer.yaml<br \/>\nkubectl apply -f kubesphere-installer.yaml<\/p>\n<p>\u7b49\u5f85\u7ec4\u4ef6\u542f\u52a8\u5b8c\u6bd5&#xff1a;<\/p>\n<p>kubectl get pods -n kubesphere-system<\/p>\n<p>\u5e94\u7528 KubeSphere&#xff1a;<\/p>\n<p><span class=\"token function\">curl<\/span> -L https:\/\/kubesphere.io\/dls\/kubesphere-v4.3.3\/kubesphere-installer.yaml <span class=\"token punctuation\">\\\\<\/span><br \/>\n<span class=\"token operator\">|<\/span> <span class=\"token function\">sed<\/span> <span class=\"token string\">&#039;s\/EnableAPIServer&#061;true\/EnableAPIServer&#061;true\\\\n  EnableOAuth&#061;true\/&#039;<\/span> <span class=\"token punctuation\">\\\\<\/span><br \/>\n<span class=\"token operator\">|<\/span> kubectl apply -f &#8211;<\/p>\n<p>\u9996\u6b21\u8bbf\u95ee\u63a7\u5236\u53f0&#xff1a;<\/p>\n<p>\u9ed8\u8ba4\u8d26\u53f7&#xff1a;admin \u9ed8\u8ba4\u5bc6\u7801&#xff1a;P&#064;88w0rd<\/p>\n<p>\u8bbf\u95ee\u5730\u5740&#xff1a;<\/p>\n<p>http:\/\/&lt;MASTER_OR_LOADBALANCER_IP&gt;:30880<\/p>\n<p>\u53ef\u6839\u636e\u73af\u5883\u6539\u7528 Ingress\u3001LoadBalancer \u7c7b\u578b\u670d\u52a1\u3002<\/p>\n<hr \/>\n<h3>\u5341\u4e00\u3001\u5916\u90e8 LoadBalancer \u65b9\u6848&#xff08;MetalLB&#xff09;<\/h3>\n<p>\u5728\u88f8\u673a\u6216 VPS \u73af\u5883&#xff0c;\u6211\u4eec\u5efa\u8bae\u4f7f\u7528 MetalLB \u63d0\u4f9b LoadBalancer \u670d\u52a1&#xff1a;<\/p>\n<p>\u5b89\u88c5 MetalLB&#xff1a;<\/p>\n<p>kubectl apply -f https:\/\/raw.githubusercontent.com\/metallb\/metallb\/v0.13.10\/config\/manifests\/metallb-native.yaml<\/p>\n<p>\u914d\u7f6e IP \u6c60&#xff08;\u4f8b\u5982 192.168.100.240\u2013192.168.100.250&#xff09;&#xff1a;<\/p>\n<p><span class=\"token function\">cat<\/span> <span class=\"token operator\">&lt;&lt;<\/span><span class=\"token string\">EOF<span class=\"token bash punctuation\"> <span class=\"token operator\">|<\/span> kubectl apply -f &#8211;<\/span><br \/>\napiVersion: metallb.io\/v1beta1<br \/>\nkind: IPAddressPool<br \/>\nmetadata:<br \/>\n  name: lb-pool<br \/>\n  namespace: metallb-system<br \/>\nspec:<br \/>\n  addresses:<br \/>\n  &#8211; 192.168.100.240-192.168.100.250<br \/>\n&#8212;<br \/>\napiVersion: metallb.io\/v1beta1<br \/>\nkind: L2Advertisement<br \/>\nmetadata:<br \/>\n  name: l2adv<br \/>\n  namespace: metallb-system<br \/>\nEOF<\/span><\/p>\n<hr \/>\n<h3>\u5341\u4e8c\u3001\u955c\u50cf\u52a0\u901f<\/h3>\n<p>\u5728\u9999\u6e2f\u670d\u52a1\u5668\u5e38\u89c1\u7684\u95ee\u9898\u662f\u8bbf\u95ee Docker Hub \u6216 k8s.gcr.io \u8f83\u6162\u3002\u63a8\u8350\u4f7f\u7528\u56fd\u5185\u955c\u50cf\u52a0\u901f&#xff1a;<\/p>\n<p>\u7f16\u8f91 \/etc\/containerd\/config.toml&#xff1a;<\/p>\n<p>[plugins.&#034;io.containerd.grpc.v1.cri&#034;.registry.mirrors.&#034;docker.io&#034;]<br \/>\n  endpoint &#061; [&#034;https:\/\/registry-mirror.example.com&#034;]<\/p>\n<p>\u66ff\u6362\u4e3a\u963f\u91cc\u4e91\u3001\u817e\u8baf\u4e91\u7b49\u52a0\u901f\u5730\u5740\u3002<\/p>\n<p>\u91cd\u542f containerd&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> systemctl restart containerd<\/p>\n<hr \/>\n<h3>\u5341\u4e09\u3001\u5178\u578b\u95ee\u9898\u4e0e\u6392\u67e5<\/h3>\n<h4>13.1 \u8282\u70b9\u72b6\u6001 NotReady<\/h4>\n<p>kubectl describe <span class=\"token function\">node<\/span> <span class=\"token operator\">&lt;<\/span>node-name<span class=\"token operator\">&gt;<\/span><\/p>\n<p>\u68c0\u67e5 network plugin \u662f\u5426\u6b63\u786e\u542f\u52a8&#xff1a;<\/p>\n<p>kubectl get pods -n kube-system <span class=\"token operator\">|<\/span> <span class=\"token function\">grep<\/span> calico<\/p>\n<h4>13.2 kube-dns\/ CoreDNS \u4e0d\u53ef\u7528<\/h4>\n<p>\u786e\u4fdd DNS \u914d\u7f6e&#xff1a;<\/p>\n<p>kubectl logs -n kube-system -l k8s-app<span class=\"token operator\">&#061;<\/span>kube-dns<\/p>\n<hr \/>\n<h3>\u5341\u56db\u3001\u76d1\u63a7\u4e0e\u65e5\u5fd7\u65b9\u6848<\/h3>\n<p>\u5efa\u8bae\u5f15\u5165\u4ee5\u4e0b\u7ec4\u4ef6&#xff1a;<\/p>\n<table>\n<tr>\u65b9\u6848\u529f\u80fd<\/tr>\n<tbody>\n<tr>\n<td>Prometheus<\/td>\n<td>\u6307\u6807\u76d1\u63a7<\/td>\n<\/tr>\n<tr>\n<td>Grafana<\/td>\n<td>\u53ef\u89c6\u5316<\/td>\n<\/tr>\n<tr>\n<td>EFK Stack<\/td>\n<td>\u65e5\u5fd7\u6536\u96c6\u4e0e\u5206\u6790<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u53ef\u901a\u8fc7 KubeSphere \u5185\u7f6e\u5e02\u573a\u4e00\u952e\u90e8\u7f72\u8fd9\u4e9b\u7ec4\u4ef6\u3002<\/p>\n<hr \/>\n<h3>\u5341\u4e94\u3001\u603b\u7ed3<\/h3>\n<p>A5\u6570\u636e\u672c\u6587\u63d0\u4f9b\u4e86\u4e00\u4e2a\u4ece\u96f6\u5f00\u59cb&#xff0c;\u5728 Ubuntu 22.04 \u7684\u9999\u6e2f\u670d\u52a1\u5668\u4e0a\u90e8\u7f72\u751f\u4ea7\u7ea7 Kubernetes \u96c6\u7fa4&#xff0c;\u5e76\u5b89\u88c5 KubeSphere \u63a7\u5236\u53f0\u7684\u6df1\u5ea6\u65b9\u6848&#xff0c;\u5305\u62ec&#xff1a;<\/p>\n<ul>\n<li>\u786c\u4ef6\u4e0e\u7f51\u7edc\u914d\u7f6e\u5efa\u8bae<\/li>\n<li>\u5bb9\u5668\u8fd0\u884c\u65f6 containerd \u5b89\u88c5\u7ec6\u8282<\/li>\n<li>Kubernetes \u6838\u5fc3\u7ec4\u4ef6\u5b89\u88c5\u4e0e\u521d\u59cb\u5316<\/li>\n<li>\u7f51\u7edc\u63d2\u4ef6\u9009\u62e9\u4e0e\u90e8\u7f72\u5b9e\u8df5<\/li>\n<li>\u53ef\u89c6\u5316\u7ba1\u7406\u5e73\u53f0 KubeSphere \u5b89\u88c5\u4e0e\u8bbf\u95ee<\/li>\n<li>LoadBalancer\u3001\u955c\u50cf\u52a0\u901f\u4e0e\u5e38\u89c1\u95ee\u9898\u6392\u67e5<\/li>\n<\/ul>\n<p>\u5e0c\u671b\u672c\u6587\u80fd\u5e2e\u52a9\u4f60\u5728\u5b9e\u9645\u4e1a\u52a1\u73af\u5883\u4e2d\u5feb\u901f\u642d\u5efa\u9ad8\u53ef\u7528\u7684\u5bb9\u5668\u5316\u670d\u52a1\u5e73\u53f0\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u4f55\u5728\u9999\u6e2f\u670d\u52a1\u5668\u4e0a\u7528 Ubuntu 22.04 \u6784\u5efa\u751f\u4ea7\u7ea7 Kubernetes \u96c6\u7fa4&#xff0c;\u5e76\u5b89\u88c5 KubeSphere \u63a7\u5236\u53f0\u7528\u4e8e\u53ef\u89c6\u5316\u5bb9\u5668\u5316\u670d\u52a1\u7ba1\u7406\u7684\u5b8c\u6574\u843d\u5730\u65b9\u6848\u3002A5\u6570\u636e\u5168\u7a0b\u6d89\u53ca\u786c\u4ef6\u914d\u7f6e\u5efa\u8bae\u3001\u7f51\u7edc\u65b9\u6848\u5bf9\u6bd4\u3001\u8be6\u7ec6\u4ee3\u7801\u793a\u4f8b\u3001\u914d\u7f6e\u6587\u4ef6\u3001\u7ec4\u4ef6\u7248\u672c\u63a7\u5236\u548c\u5173\u952e\u6280\u672f\u7ec6\u8282\u3002 \u4e00\u3001\u524d\u8a00<br \/>\n\u5728\u8de8\u5883\u670d\u52a1\u573a\u666f\u4e2d&#xff0c;\u9ad8\u53ef\u7528\u3001\u53ef\u89c2\u6d4b\u7684\u5bb9\u5668\u5e73\u53f0\u662f\u73b0\u4ee3\u5fae\u670d\u52a1\u3001CI\/CD \u548c DevOps \u7684\u6838\u5fc3\u57fa\u7840\u8bbe\u65bd\u3002\u6211\u4eec\u9009\u7528 Kubernetes&#xff08;k8s&#xff09;\u4f5c\u4e3a\u5bb9\u5668<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[120,103,43],"topic":[],"class_list":["post-79729","post","type-post","status-publish","format-standard","hentry","category-server","tag-kubernetes","tag-ubuntu","tag-43"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5982\u4f55\u5728\u9999\u6e2f\u670d\u52a1\u5668 Ubuntu 22.04 \u4e0a \u5b89\u88c5 Kubernetes \u96c6\u7fa4 + KubeSphere \u63a7\u5236\u53f0 \u5b9e\u73b0\u5bb9\u5668\u5316\u670d\u52a1\u7ba1\u7406\u6559\u7a0b\uff08\u6df1\u5ea6\u6280\u672f\u65b9\u6848\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/79729.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5982\u4f55\u5728\u9999\u6e2f\u670d\u52a1\u5668 Ubuntu 22.04 \u4e0a \u5b89\u88c5 Kubernetes \u96c6\u7fa4 + KubeSphere \u63a7\u5236\u53f0 \u5b9e\u73b0\u5bb9\u5668\u5316\u670d\u52a1\u7ba1\u7406\u6559\u7a0b\uff08\u6df1\u5ea6\u6280\u672f\u65b9\u6848\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u5982\u4f55\u5728\u9999\u6e2f\u670d\u52a1\u5668\u4e0a\u7528 Ubuntu 22.04 \u6784\u5efa\u751f\u4ea7\u7ea7 Kubernetes \u96c6\u7fa4&#xff0c;\u5e76\u5b89\u88c5 KubeSphere \u63a7\u5236\u53f0\u7528\u4e8e\u53ef\u89c6\u5316\u5bb9\u5668\u5316\u670d\u52a1\u7ba1\u7406\u7684\u5b8c\u6574\u843d\u5730\u65b9\u6848\u3002A5\u6570\u636e\u5168\u7a0b\u6d89\u53ca\u786c\u4ef6\u914d\u7f6e\u5efa\u8bae\u3001\u7f51\u7edc\u65b9\u6848\u5bf9\u6bd4\u3001\u8be6\u7ec6\u4ee3\u7801\u793a\u4f8b\u3001\u914d\u7f6e\u6587\u4ef6\u3001\u7ec4\u4ef6\u7248\u672c\u63a7\u5236\u548c\u5173\u952e\u6280\u672f\u7ec6\u8282\u3002 \u4e00\u3001\u524d\u8a00 \u5728\u8de8\u5883\u670d\u52a1\u573a\u666f\u4e2d&#xff0c;\u9ad8\u53ef\u7528\u3001\u53ef\u89c2\u6d4b\u7684\u5bb9\u5668\u5e73\u53f0\u662f\u73b0\u4ee3\u5fae\u670d\u52a1\u3001CI\/CD \u548c DevOps \u7684\u6838\u5fc3\u57fa\u7840\u8bbe\u65bd\u3002\u6211\u4eec\u9009\u7528 Kubernetes&#xff08;k8s&#xff09;\u4f5c\u4e3a\u5bb9\u5668\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/79729.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-03-02T15:18:47+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/79729.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/79729.html\",\"name\":\"\u5982\u4f55\u5728\u9999\u6e2f\u670d\u52a1\u5668 Ubuntu 22.04 \u4e0a \u5b89\u88c5 Kubernetes \u96c6\u7fa4 + KubeSphere \u63a7\u5236\u53f0 \u5b9e\u73b0\u5bb9\u5668\u5316\u670d\u52a1\u7ba1\u7406\u6559\u7a0b\uff08\u6df1\u5ea6\u6280\u672f\u65b9\u6848\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-03-02T15:18:47+00:00\",\"dateModified\":\"2026-03-02T15:18:47+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/79729.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/79729.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/79729.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5982\u4f55\u5728\u9999\u6e2f\u670d\u52a1\u5668 Ubuntu 22.04 \u4e0a \u5b89\u88c5 Kubernetes \u96c6\u7fa4 + KubeSphere \u63a7\u5236\u53f0 \u5b9e\u73b0\u5bb9\u5668\u5316\u670d\u52a1\u7ba1\u7406\u6559\u7a0b\uff08\u6df1\u5ea6\u6280\u672f\u65b9\u6848\uff09\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u5982\u4f55\u5728\u9999\u6e2f\u670d\u52a1\u5668 Ubuntu 22.04 \u4e0a \u5b89\u88c5 Kubernetes \u96c6\u7fa4 + KubeSphere \u63a7\u5236\u53f0 \u5b9e\u73b0\u5bb9\u5668\u5316\u670d\u52a1\u7ba1\u7406\u6559\u7a0b\uff08\u6df1\u5ea6\u6280\u672f\u65b9\u6848\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/79729.html","og_locale":"zh_CN","og_type":"article","og_title":"\u5982\u4f55\u5728\u9999\u6e2f\u670d\u52a1\u5668 Ubuntu 22.04 \u4e0a \u5b89\u88c5 Kubernetes \u96c6\u7fa4 + KubeSphere \u63a7\u5236\u53f0 \u5b9e\u73b0\u5bb9\u5668\u5316\u670d\u52a1\u7ba1\u7406\u6559\u7a0b\uff08\u6df1\u5ea6\u6280\u672f\u65b9\u6848\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u5982\u4f55\u5728\u9999\u6e2f\u670d\u52a1\u5668\u4e0a\u7528 Ubuntu 22.04 \u6784\u5efa\u751f\u4ea7\u7ea7 Kubernetes \u96c6\u7fa4&#xff0c;\u5e76\u5b89\u88c5 KubeSphere \u63a7\u5236\u53f0\u7528\u4e8e\u53ef\u89c6\u5316\u5bb9\u5668\u5316\u670d\u52a1\u7ba1\u7406\u7684\u5b8c\u6574\u843d\u5730\u65b9\u6848\u3002A5\u6570\u636e\u5168\u7a0b\u6d89\u53ca\u786c\u4ef6\u914d\u7f6e\u5efa\u8bae\u3001\u7f51\u7edc\u65b9\u6848\u5bf9\u6bd4\u3001\u8be6\u7ec6\u4ee3\u7801\u793a\u4f8b\u3001\u914d\u7f6e\u6587\u4ef6\u3001\u7ec4\u4ef6\u7248\u672c\u63a7\u5236\u548c\u5173\u952e\u6280\u672f\u7ec6\u8282\u3002 \u4e00\u3001\u524d\u8a00 \u5728\u8de8\u5883\u670d\u52a1\u573a\u666f\u4e2d&#xff0c;\u9ad8\u53ef\u7528\u3001\u53ef\u89c2\u6d4b\u7684\u5bb9\u5668\u5e73\u53f0\u662f\u73b0\u4ee3\u5fae\u670d\u52a1\u3001CI\/CD \u548c DevOps \u7684\u6838\u5fc3\u57fa\u7840\u8bbe\u65bd\u3002\u6211\u4eec\u9009\u7528 Kubernetes&#xff08;k8s&#xff09;\u4f5c\u4e3a\u5bb9\u5668","og_url":"https:\/\/www.wsisp.com\/helps\/79729.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-03-02T15:18:47+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/79729.html","url":"https:\/\/www.wsisp.com\/helps\/79729.html","name":"\u5982\u4f55\u5728\u9999\u6e2f\u670d\u52a1\u5668 Ubuntu 22.04 \u4e0a \u5b89\u88c5 Kubernetes \u96c6\u7fa4 + KubeSphere \u63a7\u5236\u53f0 \u5b9e\u73b0\u5bb9\u5668\u5316\u670d\u52a1\u7ba1\u7406\u6559\u7a0b\uff08\u6df1\u5ea6\u6280\u672f\u65b9\u6848\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-03-02T15:18:47+00:00","dateModified":"2026-03-02T15:18:47+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/79729.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/79729.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/79729.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u5982\u4f55\u5728\u9999\u6e2f\u670d\u52a1\u5668 Ubuntu 22.04 \u4e0a \u5b89\u88c5 Kubernetes \u96c6\u7fa4 + KubeSphere \u63a7\u5236\u53f0 \u5b9e\u73b0\u5bb9\u5668\u5316\u670d\u52a1\u7ba1\u7406\u6559\u7a0b\uff08\u6df1\u5ea6\u6280\u672f\u65b9\u6848\uff09"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/79729","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=79729"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/79729\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=79729"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=79729"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=79729"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=79729"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}