1.腾讯轻服务器K3S系统安装

前端时间买了三年腾讯轻服务器,现在准备学习下K8S,但是服务器资源少,退而求其次的使用腾讯轻服务器默认的K3S系统。

1.获取按照提示,获取token ,

2.防火墙开启9090端口, 输入url:http://公网IP:9090登录;

3.开启SSH远程连接:创建密钥,默认下载文件,windows本地重命名增加后缀.pub,CRT通过公钥进行SSH登录。

2.Kubernetes-dashboard

输入url:http://公网IP:9090,可以看到相关菜单

点击右上角“+”,可以创建yaml文件进行服务部署

3.后台查看K3S相关信息

[root@VM-16-5-centos ~]# hostnamectlStatic hostname: VM-16-5-centosIcon name: computer-vmChassis: vmMachine ID: e811d69a833e41beaa003c0e69319e90Boot ID: 5816742493464737aa77fb84af907b88Virtualization: kvmOperating System: CentOS Linux 8 (Core)CPE OS Name: cpe:/o:centos:centos:8Kernel: Linux 4.18.0-305.3.1.el8.x86_64Architecture: x86-64
[root@VM-16-5-centos ~]# cat /etc/redhat-release
CentOS Linux release 8.2.2004 (Core)
[root@VM-16-5-centos ~]# uname -a
Linux VM-16-5-centos 4.18.0-305.3.1.el8.x86_64 #1 SMP Tue Jun 1 16:14:33 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
[root@VM-16-5-centos ~]# kubectl cluster-info
Kubernetes control plane is running at https://127.0.0.1:6443
CoreDNS is running at https://127.0.0.1:6443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
Metrics-server is running at https://127.0.0.1:6443/api/v1/namespaces/kube-system/services/https:metrics-server:/proxyTo further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
[root@VM-16-5-centos ~]# kubectl get nodes -o wide
NAME             STATUS   ROLES                  AGE   VERSION        INTERNAL-IP   EXTERNAL-IP   OS-IMAGE                KERNEL-VERSION              CONTAINER-RUNTIME
vm-16-5-centos   Ready    control-plane,master   69m   v1.20.7+k3s1   10.0.16.5     <none>        CentOS Linux 8 (Core)   4.18.0-305.3.1.el8.x86_64   containerd://1.4.4-k3s1
[root@VM-16-5-centos ~]# kubectl describe node
Name:               vm-16-5-centos
Roles:              control-plane,master
Labels:             beta.kubernetes.io/arch=amd64beta.kubernetes.io/instance-type=k3sbeta.kubernetes.io/os=linuxk3s.io/hostname=vm-16-5-centosk3s.io/internal-ip=10.0.16.5kubernetes.io/arch=amd64kubernetes.io/hostname=vm-16-5-centoskubernetes.io/os=linuxnode-role.kubernetes.io/control-plane=truenode-role.kubernetes.io/master=truenode.kubernetes.io/instance-type=k3s
Annotations:        flannel.alpha.coreos.com/backend-data: {"VtepMAC":"22:6c:c1:03:83:80"}flannel.alpha.coreos.com/backend-type: vxlanflannel.alpha.coreos.com/kube-subnet-manager: trueflannel.alpha.coreos.com/public-ip: 10.0.16.5k3s.io/node-args: ["server","--write-kubeconfig-mode","644"]k3s.io/node-config-hash: XAEWDMOLOUU74BDTBD2U3FVK7PQCFJ4XWLHQCWRAJLPPNWOIBJEA====k3s.io/node-env: {"K3S_DATA_DIR":"/var/lib/rancher/k3s/data/474b7b031f3885345db99df7da66f11d537c75180eb6961b6cf2ec25b92efe65"}node.alpha.kubernetes.io/ttl: 0volumes.kubernetes.io/controller-managed-attach-detach: true
CreationTimestamp:  Fri, 06 May 2022 14:41:53 +0800
Taints:             <none>
Unschedulable:      false
Lease:HolderIdentity:  vm-16-5-centosAcquireTime:     <unset>RenewTime:       Fri, 06 May 2022 15:51:21 +0800
Conditions:Type                 Status  LastHeartbeatTime                 LastTransitionTime                Reason                       Message----                 ------  -----------------                 ------------------                ------                       -------NetworkUnavailable   False   Fri, 06 May 2022 15:04:23 +0800   Fri, 06 May 2022 15:04:23 +0800   FlannelIsUp                  Flannel is running on this nodeMemoryPressure       False   Fri, 06 May 2022 15:49:41 +0800   Fri, 06 May 2022 14:41:53 +0800   KubeletHasSufficientMemory   kubelet has sufficient memory availableDiskPressure         False   Fri, 06 May 2022 15:49:41 +0800   Fri, 06 May 2022 14:41:53 +0800   KubeletHasNoDiskPressure     kubelet has no disk pressurePIDPressure          False   Fri, 06 May 2022 15:49:41 +0800   Fri, 06 May 2022 14:41:53 +0800   KubeletHasSufficientPID      kubelet has sufficient PID availableReady                True    Fri, 06 May 2022 15:49:41 +0800   Fri, 06 May 2022 15:04:27 +0800   KubeletReady                 kubelet is posting ready status
Addresses:InternalIP:  10.0.16.5Hostname:    vm-16-5-centos
Capacity:cpu:                2ephemeral-storage:  82503044Kihugepages-1Gi:      0hugepages-2Mi:      0memory:             3826344Kipods:               110
Allocatable:cpu:                2ephemeral-storage:  80258961141hugepages-1Gi:      0hugepages-2Mi:      0memory:             3826344Kipods:               110
System Info:Machine ID:                 e811d69a833e41beaa003c0e69319e90System UUID:                66cd78fa-04cf-4ed0-8d34-e142131d09b7Boot ID:                    58167424-9346-4737-aa77-fb84af907b88Kernel Version:             4.18.0-305.3.1.el8.x86_64OS Image:                   CentOS Linux 8 (Core)Operating System:           linuxArchitecture:               amd64Container Runtime Version:  containerd://1.4.4-k3s1Kubelet Version:            v1.20.7+k3s1Kube-Proxy Version:         v1.20.7+k3s1
PodCIDR:                      10.42.0.0/24
PodCIDRs:                     10.42.0.0/24
ProviderID:                   k3s://vm-16-5-centos
Non-terminated Pods:          (5 in total)Namespace                   Name                                       CPU Requests  CPU Limits  Memory Requests  Memory Limits  AGE---------                   ----                                       ------------  ----------  ---------------  -------------  ---kube-system                 svclb-traefik-szvsd                        0 (0%)        0 (0%)      0 (0%)           0 (0%)         68mkube-system                 metrics-server-86cbb8457f-scttb            0 (0%)        0 (0%)      0 (0%)           0 (0%)         69mkube-system                 local-path-provisioner-5ff76fc89d-4v6z9    0 (0%)        0 (0%)      0 (0%)           0 (0%)         69mkube-system                 coredns-854c77959c-xhn6w                   100m (5%)     0 (0%)      70Mi (1%)        170Mi (4%)     69mkube-system                 traefik-6f9cbd9bd4-pcq5g                   0 (0%)        0 (0%)      0 (0%)           0 (0%)         68m
Allocated resources:(Total limits may be over 100 percent, i.e., overcommitted.)Resource           Requests   Limits--------           --------   ------cpu                100m (5%)  0 (0%)memory             70Mi (1%)  170Mi (4%)ephemeral-storage  0 (0%)     0 (0%)hugepages-1Gi      0 (0%)     0 (0%)hugepages-2Mi      0 (0%)     0 (0%)
Events:Type     Reason                   Age   From        Message----     ------                   ----  ----        -------Normal   Starting                 69m   kubelet     Starting kubelet.Warning  InvalidDiskCapacity      69m   kubelet     invalid capacity 0 on image filesystemNormal   NodeHasSufficientMemory  69m   kubelet     Node vm-16-5-centos status is now: NodeHasSufficientMemoryNormal   NodeHasNoDiskPressure    69m   kubelet     Node vm-16-5-centos status is now: NodeHasNoDiskPressureNormal   NodeHasSufficientPID     69m   kubelet     Node vm-16-5-centos status is now: NodeHasSufficientPIDNormal   NodeAllocatableEnforced  69m   kubelet     Updated Node Allocatable limit across podsNormal   Starting                 69m   kube-proxy  Starting kube-proxy.Normal   NodeReady                69m   kubelet     Node vm-16-5-centos status is now: NodeReadyNormal   Starting                 47m   kube-proxy  Starting kube-proxy.Normal   Starting                 47m   kubelet     Starting kubelet.Warning  InvalidDiskCapacity      47m   kubelet     invalid capacity 0 on image filesystemNormal   NodeHasSufficientMemory  47m   kubelet     Node vm-16-5-centos status is now: NodeHasSufficientMemoryNormal   NodeHasNoDiskPressure    47m   kubelet     Node vm-16-5-centos status is now: NodeHasNoDiskPressureNormal   NodeHasSufficientPID     47m   kubelet     Node vm-16-5-centos status is now: NodeHasSufficientPIDWarning  Rebooted                 47m   kubelet     Node vm-16-5-centos has been rebooted, boot id: 58167424-9346-4737-aa77-fb84af907b88Normal   NodeNotReady             47m   kubelet     Node vm-16-5-centos status is now: NodeNotReadyNormal   NodeAllocatableEnforced  47m   kubelet     Updated Node Allocatable limit across podsNormal   NodeReady                47m   kubelet     Node vm-16-5-centos status is now: NodeReady
[root@VM-16-5-centos ~]# ctr
NAME:ctr - _______/ /______/ ___/ __/ ___/
/ /__/ /_/ /
\___/\__/_/containerd CLIUSAGE:ctr [global options] command [command options] [arguments...]VERSION:v1.4.4-k3s1DESCRIPTION:ctr is an unsupported debug and administrative client for interacting
with the containerd daemon. Because it is unsupported, the commands,
options, and operations are not guaranteed to be backward compatible or
stable from release to release of the containerd project.COMMANDS:plugins, plugin            provides information about containerd pluginsversion                    print the client and server versionscontainers, c, container   manage containerscontent                    manage contentevents, event              display containerd eventsimages, image, i           manage imagesleases                     manage leasesnamespaces, namespace, ns  manage namespacespprof                      provide golang pprof outputs for containerdrun                        run a containersnapshots, snapshot        manage snapshotstasks, t, task             manage tasksinstall                    install a new packageoci                        OCI toolsshim                       interact with a shim directlyhelp, h                    Shows a list of commands or help for one commandGLOBAL OPTIONS:--debug                      enable debug output in logs--address value, -a value    address for containerd's GRPC server (default: "/run/k3s/containerd/containerd.sock") [$CONTAINERD_ADDRESS]--timeout value              total timeout for ctr commands (default: 0s)--connect-timeout value      timeout for connecting to containerd (default: 0s)--namespace value, -n value  namespace to use with commands (default: "k8s.io") [$CONTAINERD_NAMESPACE]--help, -h                   show help--version, -v                print the version
[root@VM-16-5-centos ~]# ctr plugins ls
TYPE                            ID                       PLATFORMS      STATUS
io.containerd.snapshotter.v1    overlayfs                linux/amd64    ok
io.containerd.service.v1        introspection-service    -              ok
io.containerd.content.v1        content                  -              ok
io.containerd.snapshotter.v1    fuse-overlayfs           linux/amd64    ok
io.containerd.snapshotter.v1    native                   linux/amd64    ok
io.containerd.metadata.v1       bolt                     -              ok
io.containerd.differ.v1         walking                  linux/amd64    ok
io.containerd.gc.v1             scheduler                -              ok
io.containerd.service.v1        containers-service       -              ok
io.containerd.service.v1        content-service          -              ok
io.containerd.service.v1        diff-service             -              ok
io.containerd.service.v1        images-service           -              ok
io.containerd.service.v1        leases-service           -              ok
io.containerd.service.v1        namespaces-service       -              ok
io.containerd.service.v1        snapshots-service        -              ok
io.containerd.runtime.v1        linux                    linux/amd64    ok
io.containerd.runtime.v2        task                     linux/amd64    ok
io.containerd.monitor.v1        cgroups                  linux/amd64    ok
io.containerd.service.v1        tasks-service            -              ok
io.containerd.internal.v1       restart                  -              ok
io.containerd.grpc.v1           containers               -              ok
io.containerd.grpc.v1           content                  -              ok
io.containerd.grpc.v1           diff                     -              ok
io.containerd.grpc.v1           events                   -              ok
io.containerd.grpc.v1           healthcheck              -              ok
io.containerd.grpc.v1           images                   -              ok
io.containerd.grpc.v1           leases                   -              ok
io.containerd.grpc.v1           namespaces               -              ok
io.containerd.internal.v1       opt                      -              ok
io.containerd.grpc.v1           snapshots                -              ok
io.containerd.grpc.v1           tasks                    -              ok
io.containerd.grpc.v1           version                  -              ok
io.containerd.grpc.v1           cri                      linux/amd64    ok
[root@VM-16-5-centos ~]# crictl
NAME:crictl - client for CRIUSAGE:crictl [global options] command [command options] [arguments...]VERSION:v1.20.0-k3s1COMMANDS:attach              Attach to a running containercreate              Create a new containerexec                Run a command in a running containerversion             Display runtime version informationimages, image, img  List imagesinspect             Display the status of one or more containersinspecti            Return the status of one or more imagesimagefsinfo         Return image filesystem infoinspectp            Display the status of one or more podslogs                Fetch the logs of a containerport-forward        Forward local port to a podps                  List containerspull                Pull an image from a registryrun                 Run a new container inside a sandboxrunp                Run a new podrm                  Remove one or more containersrmi                 Remove one or more imagesrmp                 Remove one or more podspods                List podsstart               Start one or more created containersinfo                Display information of the container runtimestop                Stop one or more running containersstopp               Stop one or more running podsupdate              Update one or more running containersconfig              Get and set crictl client configuration optionsstats               List container(s) resource usage statisticscompletion          Output shell completion codehelp, h             Shows a list of commands or help for one commandGLOBAL OPTIONS:--config value, -c value            Location of the client config file. If not specified and the default does not exist, the program's directory is searched as well (default: "/var/lib/rancher/k3s/agent/etc/crictl.yaml") [$CRI_CONFIG_FILE]--debug, -D                         Enable debug mode (default: false)--image-endpoint value, -i value    Endpoint of CRI image manager service (default: uses 'runtime-endpoint' setting) [$IMAGE_SERVICE_ENDPOINT]--runtime-endpoint value, -r value  Endpoint of CRI container runtime service (default: uses in order the first successful one of [unix:///run/k3s/containerd/containerd.sock unix:///var/run/dockershim.sock unix:///run/containerd/containerd.sock unix:///run/crio/crio.sock]). Default is now deprecated and the endpoint should be set instead. [$CONTAINER_RUNTIME_ENDPOINT]--timeout value, -t value           Timeout of connecting to the server in seconds (e.g. 2s, 20s.). 0 or less is set to default (default: 2s)--help, -h                          show help (default: false)--version, -v                       print the version (default: false)[root@VM-16-5-centos ~]# nerdctl
-bash: nerdctl: command not found
[root@VM-16-5-centos ~]# kubectl get pods --all-namespaces
NAMESPACE     NAME                                      READY   STATUS      RESTARTS   AGE
kube-system   helm-install-traefik-5vl8b                0/1     Completed   0          73m
kube-system   svclb-traefik-szvsd                       2/2     Running     2          73m
kube-system   metrics-server-86cbb8457f-scttb           1/1     Running     1          73m
kube-system   local-path-provisioner-5ff76fc89d-4v6z9   1/1     Running     1          73m
kube-system   coredns-854c77959c-xhn6w                  1/1     Running     1          73m
kube-system   traefik-6f9cbd9bd4-pcq5g                  1/1     Running     1          73m
[root@VM-16-5-centos ~]# kubectl get ns
NAME              STATUS   AGE
default           Active   74m
kube-system       Active   74m
kube-public       Active   74m
kube-node-lease   Active   74m
[root@VM-16-5-centos ~]# kubectl get svc
NAME         TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE
kubernetes   ClusterIP   10.43.0.1    <none>        443/TCP   75m

4.nerdctl安装

https://github.com/containerd/nerdctl/releases

[root@VM-16-5-centos ~]# wget https://github.91chi.fun//https://github.com//containerd/nerdctl/releases/download/v0.19.0/nerdctl-0.19.0-linux-amd64.tar.gz[root@VM-16-5-centos ~]# mkdir -p /usr/local/containerd/bin  && tar -zxvf nerdctl-0.19.0-linux-amd64.tar.gz nerdctl && mv nerdctl /usr/local/containerd/bin[root@VM-16-5-centos ~]# ln -s /usr/local/containerd/bin/nerdctl /usr/bin/nerdctl

nerdctl运行时路径待解决

安装部署后,使用默认的runtime路径,不是K3s的/run/k3s/containerd/containerd.sock;需要修改路径,按照路径进行修改,未成功,待解决

https://github.com/containerd/nerdctl/blob/master/docs/faq.md#how-to-change-the-runtime

1.腾讯轻服务器K3S环境配置相关推荐

  1. 腾讯云服务器的环境配置与使用

    一.腾讯云linux云服务器配置LNMP环境 1.登录腾讯云服务器 首先我在腾讯云的官网申请了一个学生版的服务器,操作系统为CentOS 6.3 64位.接下去下载并安装Xshell(一个远程管理li ...

  2. 腾讯云服务器评测:配置 8核 16G 18M 带宽

    这是腾讯云服务器评测:配置 8核 16G 18M 带宽.腾讯云轻量应用服务器8核 16G 18M配置,8M公网带宽下载速度峰值可达2304KB/秒,折合2.25M/s,系统盘为270GB SSD盘,3 ...

  3. 腾讯云服务器放行端口--配置安全组

    原文链接:https://www.cnblogs.com/subsea/p/13897931.html 腾讯云服务器放行端口--配置安全组 云服务器在使用中网络通信是第一要素.要做好网络通信的管理,首 ...

  4. 服务器pytorch环境配置

    服务器pytorch环境配置 一.安装 Anaconda 可以用 wget 命令下载: wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/archi ...

  5. 腾讯云服务器如何安装应用软件,腾讯云服务器Ubuntu环境下通过Apt-get安装软件...

    腾讯云服务器Ubuntu环境下通过Apt-get安装软件?腾讯云提供了Apt-get下载源.操作系统为Ubuntu12.04的云服务器,用户可通过Apt-get快速安装软件.对于apt-get下载源, ...

  6. 从零开始搭建深度学习服务器: 基础环境配置(Ubuntu + GTX 1080 TI + CUDA + cuDNN)

    从零开始搭建深度学习服务器: 基础环境配置(Ubuntu + GTX 1080 TI + CUDA + cuDNN) 首先先声明一下 这篇是转载来自  : 从零开始搭建深度学习服务器: 基础环境配置( ...

  7. 从零开始搭建一台深度学习服务器及环境配置

    从零开始搭建一台深度学习服务器及环境配置 服务器硬件 2019.12.12 系统安装 环境配置--现有最新版本 服务器硬件 2019.12.12 实验室需求,我找的配置,反正不用我花钱独享一台服务器 ...

  8. tomcat 外网访问不了_免费云服务器/jdk环境配置/Tomcat简单配置

    关于本文:     最近准备做一期jdk环境配置教程,准备做一个实机演示,于是想到用云服务器来为大家演示,顺路写上如何申领一个月免费服务器,以及如何让外网访问自己的云服务器,这这里我依旧使用Tomca ...

  9. 腾讯云服务器nginx安装配置

    开始配置前,需要购买一个服务器 腾讯云官网,购买过后还需要你先去备案,从提交备案到管理局通过正常大概一个星期,下面是我的备案操作记录,被腾讯云客服打电话驳回一次,因为填写的备用电话打不通,需要注意:提 ...

最新文章

  1. linux 命令博客,Linux 命令
  2. Elasticsearch - cluster_block_exception [FORBIDDEN/12/index read-only / allow delete (api)]
  3. ustc小道消息20211215
  4. 完成一个休闲网络游戏需要学习的知识
  5. 通过OAuth 2.0和Okta使用安全的服务器到服务器通信构建Spring Boot应用
  6. 怎么将翼型导入catia_CATIA导入翼型出现了问题,翼型是在网上找的。说是样条线运算有问题 - 机械 - 小木虫 - 学术 科研 互动社区...
  7. vue data变量之间相互赋值或进行数据联动
  8. 目标追踪-背景差算法
  9. A - Cube Stacking(带权并查集)
  10. .NET : 在定义项目模板的时候使用占位符
  11. 对比了一下Hyper-v和Vmware,有发现.
  12. java scala中传递变长参数
  13. [物理学与PDEs]第2章习题3 Laplace 方程的 Neumann 问题
  14. 深度学习笔记(一)——M-P模型(神经元模型)
  15. 一个exe可执行程序的生与死
  16. 案例分析默写题1__立项管理_可行性研究的内容_可行性研究报告的内容
  17. 微信运动服务器刷新,微信运动多久更新一次步数(微信运动刷新时间表)
  18. 3900x做服务器性能怎么样,AMD Ryzen 9 3900X评测:向消费级性能王者宝座进发
  19. 借助磁盘修理工具解决Boot Camp助理的分区问题
  20. Oracle VM VirtualBox 新建虚拟电脑

热门文章

  1. 2022亚太数学杯数学建模竞赛C题(思路、程序......)
  2. Refused to apply style from ‘http://localhost:8080/iconfont.css‘ because its MIME type (‘text/html‘
  3. LPF: A Language-Prior Feedback Objective Function for De-biased Visual Question Answering 论文笔记
  4. 做设计用什么笔记本电脑好?
  5. UnityEditor查找引用和批量替换资源工具
  6. ypora中的图片传入到CSDN中显示错误
  7. BERT embedding 降维--BERT whitening
  8. 计算机毕业设计ssm社区生鲜电商平台dq96z系统+程序+源码+lw+远程部署
  9. python 中运行 pip 或者 easy_install 时出现 error: unable to find vcvarsall.bat 的解决办法
  10. Poco c ++ 库安装