2023年7月20日发(作者:)
k8s学习笔记k8s学习笔记本⽂是我在k8s学习道路的笔记。环境介绍winver win10 1909 18363.1016VMware® Workstation 15 Pro 15.5.1 build-15018445Ubuntu 20.04.1 LTS * 2kubeadm version: &{Major:"1", Minor:"18", GitVersion:"v1.18.8", GitCommit:"9f2892aab98fe339f3bd70e3c47ace",GitTreeState:"clean", BuildDate:"2020-08-13T16:10:16Z", GoVersion:"go1.13.15", Compiler:"gc", Platform:"linux/amd64"}trojan-qt5 version 0.0.9 Early Accessapt-get 源使⽤清华的Ubuntu镜像进⾏加速, 见其官⽅⽂档-代理设置在win10上安装了⼀个trojan-qt5,打开【设置】-【⾼级设置】,打开【局域⽹共享】在ubuntu上安装privoxy,这是⼀个可以将sock5代理转换为http代理的软件# installsudo apt-get install privoxy# config,注意讲192.168.31.34:1080替换为你的trojan或者sock5代理软件的地址+端⼝,同时后⾯还跟着⼀个点
sudo vim /etc/privoxy/configforward-socks5t / 192.168.31.34:1080 . #添加到最后⾯⼀⾏sudo systemctl restart privoxy # 重启privoxydocker代理安装mkdir -p /etc/systemd/system/ << EOF > /etc/systemd/system/e.d/vironment="HTTP_PROXY=127.0.0.1:8118" "HTTPS_PROXY=127.0.0.1:8118" "NO_PROXY=localhost,127.0.0.1,192.168.31.0/24"EOFsystemctl daemon-reload终端代理设置export PROXY_PORT=8118export PROXY_IP=127.0.0.1export http_proxy=$PROXY_IP:$PROXY_PORTexport HTTP_PROXY=$http_proxyexport https_proxy=$http_proxyexport HTTPS_PROXY=$http_proxyexport no_proxy="localhost,127.0.0.1,localaddress,.,,10.224.0.0/16,192.168.0.0/16"docker安装kubeadmin安装sudo apt-get update && sudo apt-get install -y apt-transport-https curlcurl -s /apt/doc/ | sudo apt-key add -cat < Main PID: 6387 (code=exited, status=255/EXCEPTION)Aug 25 08:32:12 ubuntu systemd[1]: e: Main process exited, code=exited, status=255/EXCEPTIONAug 25 08:32:12 ubuntu systemd[1]: e: Failed with result 'exit-code'.继续查看⽇志aside@ubuntu:~$ journalctl -xeu kubeletAug 25 08:32:32 ubuntu kubelet[6555]: I0825 08:32:32.823225 6555 :417] Version: v1.18.8Aug 25 08:32:32 ubuntu kubelet[6555]: I0825 08:32:32.824147 6555 :100] No cloud provider 25 08:32:32 ubuntu kubelet[6555]: I0825 08:32:32.824187 6555 :838] Client rotation is on, will bootstrap in backgroundAug 25 08:32:32 ubuntu kubelet[6555]: I0825 08:32:32.832697 6555 certificate_:130] Loading cert/key pair from "/var/lib/kubelet/pki/".Aug 25 08:32:32 ubuntu kubelet[6555]: I0825 08:32:32.833623 6555 dynamic_cafile_:167] Starting client-ca-bundle::/etc/kubernetes/pki/ 25 08:32:32 ubuntu kubelet[6555]: I0825 08:32:32.889005 6555 :647] --cgroups-per-qos enabled, but --cgroup-root was not specified. defaulting to /Aug 25 08:32:32 ubuntu kubelet[6555]: F0825 08:32:32.889209 6555 :274] failed to run Kubelet: running with swap on is not supported, please disable swap! or set >Aug 25 08:32:32 ubuntu systemd[1]: e: Main process exited, code=exited, status=255/EXCEPTION-- Subject: Unit process exited-- Defined-By: systemd-- Support: /support--
-- An ExecStart= process belonging to unit e has exited.--
-- The process' exit code is 'exited' and its exit status is 25 08:32:32 ubuntu systemd[1]: e: Failed with result 'exit-code'.-- Subject: Unit failed-- Defined-By: systemd-- Support: /support--
-- The unit e has entered the 'failed' state with result 'exit-code'.~journalctl -xeu kubectl原来是重启后交换分区⼜被开启了sudo swapoff -avim /etc/fstab# /etc/fstab: static file system information.## Use 'blkid' to print the universally unique identifier for a# device; this may be used with UUID= as a more robust way to name devices# that works even if disks are added and removed. See fstab(5).## # / was on /dev/sda5 during installationUUID=56f764cf-f113-4ece-aee8-94dada48c731 / ext4 errors=remount-ro 0 1# /boot/efi was on /dev/sda1 during installationUUID=E021-9DE7 /boot/efi vfat umask=0077 0 1# 请注释下⾯这⾏# /swapfile none swap sw 0 0/dev/fd0 /media/floppy0 auto rw,user,noauto,exec,utf8 0 0kubelet就会重启成功aside@ubuntu:~$ sudo systemctl status kubelet● e - kubelet: The Kubernetes Node Agent Loaded: loaded (/lib/systemd/system/e; enabled; vendor preset: enabled) Drop-In: /etc/systemd/system/e.d └─ Active: active (running) since Tue 2020-08-25 08:35:37 PDT; 1min 47s ago Docs: /docs/home/ Main PID: 8112 (kubelet) Tasks: 19 (limit: 9455) Memory: 55.1M CGroup: //e └─8112 /usr/bin/kubelet --bootstrap-kubeconfig=/etc/kubernetes/ --kubeconfig=/etc/kubernetes/ --config=/var/lib/kubelet/config>Aug 25 08:35:54 ubuntu kubelet[8112]: E0825 08:35:54.882536 8112 remote_:105] RunPodSandbox from runtime service failed: rpc error: code = Unknown desc = failed>Aug 25 08:35:54 ubuntu kubelet[8112]: E0825 08:35:54.882585 8112 kuberuntime_:68] CreatePodSandbox for pod "coredns-66bff467f8-pz4b4_kube-system(19f4af18-5ef1-4>Aug 25 08:35:54 ubuntu kubelet[8112]: E0825 08:35:54.882598 8112 kuberuntime_:727] createPodSandbox for pod "coredns-66bff467f8-pz4b4_kube-system(19f4af18-5ef1->Aug 25 08:35:54 ubuntu kubelet[8112]: E0825 08:35:54.882645 8112 pod_:191] Error syncing pod 19f4af18-5ef1-4920-8c95-b9752debcd8e ("coredns-66bff467f8-pz4b4_kub>Aug 25 08:35:55 ubuntu kubelet[8112]: W0825 08:35:55.206927 8112 docker_:400] failed to read pod IP from plugin/docker: networkPlugin cni failed on the status h>Aug 25 08:35:55 ubuntu kubelet[8112]: W0825 08:35:55.212089 8112 pod_container_:77] Container "7e6e9bede668c8f74e490409ad7ea38a917c8aedbc86dcadac27c782e2caeae8">Aug 25 08:35:55 ubuntu kubelet[8112]: W0825 08:35:55.213647 8112 :331] CNI failed to retrieve network namespace path: cannot find network namespace for the terminat>Aug 25 08:35:55 ubuntu kubelet[8112]: W0825 08:35:55.219142 8112 docker_:400] failed to read pod IP from plugin/docker: networkPlugin cni failed on the status h>Aug 25 08:35:55 ubuntu kubelet[8112]: W0825 08:35:55.225485 8112 pod_container_:77] Container "d6d19f6e622e051432423f91e070bd575aa7bf542a90fce5a6f1244f76c45396">Aug 25 08:35:55 ubuntu kubelet[8112]: W0825 08:35:55.226680 8112 :331] CNI failed to retrieve network namespace path: cannot find network namespace for the terminat>再次验证aside@ubuntu:~$ kubectl get pods --all-namespacesNAMESPACE NAME READY STATUS RESTARTS AGEdefault frontend-797f47d685-pfmbl 1/1 Running 0 3d6hkube-system coredns-66bff467f8-ndxnv 1/1 Running 45 10dkube-system coredns-66bff467f8-pz4b4 1/1 Running 44 10dkube-system etcd-ubuntu 1/1 Running 2 10dkube-system kube-apiserver-ubuntu 1/1 Running 2 10dkube-system kube-controller-manager-ubuntu 1/1 Running 2 10dkube-system kube-flannel-ds-amd64-6mw8b 1/1 Running 2 10dkube-system kube-flannel-ds-amd64-phsh8 1/1 Running 1 10dkube-system kube-proxy-fjqx8 1/1 Running 2 10dkube-system kube-proxy-wt6tp 1/1 Running 0 10dkube-system kube-scheduler-ubuntu 1/1 Running 2 10d
发布者:admin,转转请注明出处:http://www.yc00.com/news/1689814440a288350.html
评论列表(0条)