当前位置: 首页 > news >正文

SuperEdge易学易用系列-一键搭建SuperEdge集群

条件说明:

系统 公网IP 内网IP 服务器所在地 K8S版本
Centos7.9 114.116.101.254 192.168.0.245 北京 v1.22.6
Centos7.9 119.8.1.96 192.168.0.83 香港 v1.22.6
Ubuntu22 94.74.108.152 192.168.0.154 纽约 v1.22.6

1. 开始部署

1.1 两条指令从零搭建一个边缘集群

1.1.1 下载安装包

edgeadm 最近两个版本[v0.9.0,v0.8.2]支持的体系结构 arch[amd64, arm64]以及kubernetes 版本[1.22.6, 1.20.6]组合如下,请大家按需下载:CPU arch [amd64, arm64], kubernetes version [1.22.6], version: v0.9.0CPU arch [amd64, arm64], kubernetes version [1.22.6, 1.20.6], version: v0.8.2 注意修改 arch/version/kubernetesVersion 变量参数来下载 tgz 包:
arch=amd64 version=v0.9.0 kubernetesVersion=1.22.6 && rm -rf edgeadm-linux-* && wget https://superedge-1253687700.cos.ap-guangzhou.myqcloud.com/$version/$arch/edgeadm-linux-$arch-$version-k8s-$kubernetesVersion.tgz && tar -xzvf edgeadm-linux-* && cd edgeadm-linux-$arch-$version-k8s-$kubernetesVersion && ./edgeadm
#这里需要根据系统的架构,选择arch=amd64 
[root@cloucore1 ~]# arch=amd64 version=v0.9.0 kubernetesVersion=1.22.6 && rm -rf edgeadm-linux-* && wget https://superedge-1253687700.cos.ap-guangzhou.myqcloud.com/$version/$arch/edgeadm-linux-$arch-$version-k8s-$kubernetesVersion.tgz && tar -xzvf edgeadm-linux-* && cd edgeadm-linux-$arch-$version-k8s-$kubernetesVersion && ./edgeadm
--2023-10-12 20:38:36--  https://superedge-1253687700.cos.ap-guangzhou.myqcloud.com/v0.9.0/amd64/edgeadm-linux-amd64-v0.9.0-k8s-1.22.6.tgz
Resolving superedge-1253687700.cos.ap-guangzhou.myqcloud.com (superedge-1253687700.cos.ap-guangzhou.myqcloud.com)... 159.75.57.36, 159.75.57.69
Connecting to superedge-1253687700.cos.ap-guangzhou.myqcloud.com (superedge-1253687700.cos.ap-guangzhou.myqcloud.com)|159.75.57.36|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 245866753 (234M) [application/octet-stream]
Saving to: ‘edgeadm-linux-amd64-v0.9.0-k8s-1.22.6.tgz’100%[============================================================================================================>] 245,866,753 10.9MB/s   in 21s    2023-10-12 20:38:57 (11.4 MB/s) - ‘edgeadm-linux-amd64-v0.9.0-k8s-1.22.6.tgz’ saved [245866753/245866753]./edgeadm-linux-amd64-v0.9.0-k8s-1.22.6/
./edgeadm-linux-amd64-v0.9.0-k8s-1.22.6/edgeadm
./edgeadm-linux-amd64-v0.9.0-k8s-1.22.6/kube-linux-amd64-v1.22.6.tar.gz
edgeadm use to manage edge kubernetes clusterUsage:edgeadm COMMAND [arg...] [flags]edgeadm [command]Available Commands:addon       Addon apps to Kubernetes clusterchange      Change kubernetes cluster to edge clusterdetach      Detach apps from Kubernetes clusterhelp        Help about any commandinit        Run this command in order to set up the Kubernetes control planejoin        Run this on any machine you wish to join an existing clustermanifests   Output edge cluster manifest yaml filesreset       Performs a best effort revert of changes made to this host by 'edgeadm init' or 'edgeadm join'revert      Revert edge cluster to your original clustertoken       Manage bootstrap tokensversion     Output edgeadm build infoFlags:--add-dir-header                   If true, adds the file directory to the header of the log messages--alsologtostderr                  log to standard error as well as files--enable-edge                      Enable of install edge kubernetes cluster. (default true)-h, --help                             help for edgeadm--kubeconfig string                The path to the kubeconfig file. [necessary] (default "~/.kube/config")--log-backtrace-at traceLocation   when logging hits line file:N, emit a stack trace (default :0)--log-dir string                   If non-empty, write log files in this directory--log-file string                  If non-empty, use this log file--log-file-max-size uint           Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)--logtostderr                      log to standard error instead of files (default true)--one-output                       If true, only write logs to their native severity level (vs also writing to each lower severity level)--skip-headers                     If true, avoid header prefixes in the log messages--skip-log-headers                 If true, avoid headers when opening log files--stderrthreshold severity         logs at or above this threshold go to stderr (default 2)-v, --v Level                          number for the log level verbosity--vmodule moduleSpec               comma-separated list of pattern=N settings for file-filtered logging--worker-path string               Worker path of install edge kubernetes cluster. (default "/tmp/edgeadm-tmp/")Use "edgeadm [command] --help" for more information about a command.
[root@cloucore1 edgeadm-linux-amd64-v0.9.0-k8s-1.22.6]# ll
total 276400
-rwxr-xr-x 1 root root  61731777 Apr 17 19:42 edgeadm
-rw-r--r-- 1 root root 221297932 Apr 17 19:42 kube-linux-amd64-v1.22.6.tar.gz
[root@cloucore1 edgeadm-linux-amd64-v0.9.0-k8s-1.22.6]# 

此静态安装包也可以从 Github Release页面 下载

2. 安装边缘 Kubernetes master 节点

将下载的压缩包解压后,进入目录,执行下面的命令:

#成功执行后的结果需要记住,一会把节点加入到集群中是需要的
./edgeadm init --kubernetes-version=1.22.6 --image-repository superedge.tencentcloudcr.com/superedge --service-cidr=10.244.0.0/16 --pod-network-cidr=10.233.0.0/16 --install-pkg-path ./kube-linux-*.tar.gz --apiserver-cert-extra-sans=114.116.101.254  --apiserver-advertise-address=192.168.0.245 --enable-edge=true --edge-version=0.9.0

–enable-edge=true: 是否部署边缘能力组件,默认 true --enable-edge=false 表示安装原生 Kubernetes 集群,和 kubeadm 搭建的集群完全一样;

–install-pkg-path的值可以为机器上的路径,也可以为网络地址(比如:http://xxx/xxx/kube-linux-arm64/amd64-*.tar.gz, 能免密wget到就可以),注意用和机器体系匹配的Kubernetes静态安装包;

–image-repository:镜像仓库地址

–apiserver-cert-extra-sans=<Master节点外网 IP/域名等>:这里的外网 IP 指的是边缘节点需要接入的云端控制面的公网 IP以及外网域名,apiserver 会签发相应的证书供边缘节点访问

–apiserver-advertise-address=<Master节点内网 IP>:这里的内网 IP 指的是 edgeadm 用于初始化 etcd 和 apiserver 需要绑定的节点内部 IP

–edge-version=0.9.0:如果需要使用最新的 Kins 能力, 这里需要指定最新v0.9.0的版本(仅支持 Kubernetes 1.22.6);如果不需要 Kins 能力,同时又希望能够使用类似 1.20 的低 K8s 版本,可以使用 v0.8.2版本,支持最新的云边隧道能力,支持云端 master、worker 和边缘节点三种类型节点的 7 层协议互通,适配更加完善

[root@cloucore1 edgeadm-linux-amd64-v0.9.0-k8s-1.22.6]# pwd
/root/edgeadm-linux-amd64-v0.9.0-k8s-1.22.6
[root@cloucore1 edgeadm-linux-amd64-v0.9.0-k8s-1.22.6]# ./edgeadm init --kubernetes-version=1.22.6 --image-repository superedge.tencentcloudcr.com/superedge --service-cidr=10.244.0.0/16 --pod-network-cidr=10.233.0.0/16 --install-pkg-path ./kube-linux-*.tar.gz --apiserver-cert-extra-sans=114.116.101.254  --apiserver-advertise-address=192.168.0.245 --enable-edge=true --edge-version=0.9.0
[init] Deploy Kubernetes kubeadm-config: {"BootstrapTokens":[{"token":"qgpl1h.3ttnx38x8oe1oztp","description":"The default bootstrap token generated by 'edgeadm init'.","ttl":"24h0m0s","usages":["signing","authentication"],"groups":["system:bootstrappers:kubeadm:default-node-token"]}],"NodeRegistration":{"Name":"cloucore1","CRISocket":"/run/containerd/containerd.sock","Taints":[{"key":"node-role.kubernetes.io/master","effect":"NoSchedule"}],"KubeletExtraArgs":null,"IgnorePreflightErrors":[],"imagePullPolicy":"IfNotPresent"},"LocalAPIEndpoint":{"AdvertiseAddress":"192.168.0.245","BindPort":6443},"CertificateKey":"","SkipPhases":null,"Patches":null}
I1012 20:44:22.725008    8688 runtime.go:64] Installed container runtime containerd successfully
[preflight] Running pre-flight checks[WARNING FileExisting-socat]: socat not found in system path[WARNING Hostname]: hostname "cloucore1" could not be reached[WARNING Hostname]: hostname "cloucore1": lookup cloucore1 on 100.125.21.250:53: no such host
[preflight] Pulling images required for setting up a Kubernetes cluster
[preflight] This might take a minute or two, depending on the speed of your internet connection
[preflight] You can also perform this action in beforehand using 'kubeadm config images pull'
[certs] Using certificateDir folder "/etc/kubernetes/pki"
[certs] Generating "ca" certificate and key
[certs] Generating "apiserver" certificate and key
[certs] apiserver serving cert is signed for DNS names [cloucore1 kubernetes kubernetes.default kubernetes.default.svc kubernetes.default.svc.cluster.local] and IPs [10.244.0.1 192.168.0.245 114.116.101.254]
[certs] Generating "apiserver-kubelet-client" certificate and key
[certs] Generating "front-proxy-ca" certificate and key
[certs] Generating "front-proxy-client" certificate and key
[certs] Generating "etcd/ca" certificate and key
[certs] Generating "etcd/server" certificate and key
[certs] etcd/server serving cert is signed for DNS names [cloucore1 localhost] and IPs [192.168.0.245 127.0.0.1 ::1]
[certs] Generating "etcd/peer" certificate and key
[certs] etcd/peer serving cert is signed for DNS names [cloucore1 localhost] and IPs [192.168.0.245 127.0.0.1 ::1]
[certs] Generating "etcd/healthcheck-client" certificate and key
[certs] Generating "apiserver-etcd-client" certificate and key
[certs] Generating "sa" key and public key
[certs] Using certificateDir folder "/etc/kubernetes/pki"
[certs] Using existing ca certificate authority
[certs] Generating "tunnel-anp-client" certificate and key
[certs] Using the existing "sa" key
[kubeconfig] Using kubeconfig folder "/etc/kubernetes"
[kubeconfig] Writing "admin.conf" kubeconfig file
[kubeconfig] Writing "kubelet.conf" kubeconfig file
[kubeconfig] Writing "controller-manager.conf" kubeconfig file
[kubeconfig] Writing "scheduler.conf" kubeconfig file
[kubelet-start] Writing kubelet environment file with flags to file "/var/lib/kubelet/kubeadm-flags.env"
[kubelet-start] Writing kubelet configuration to file "/var/lib/kubelet/config.yaml"
[kubelet-start] Starting the kubelet
[certs] Using certificateDir folder "/etc/kubernetes/pki"
[control-plane] Using manifest folder "/etc/kubernetes/manifests"
[control-plane] Creating static Pod manifest for "kube-apiserver"
[patches] Reading patches from path "/etc/kubernetes/patch/"
[patches] Found the following patch files: [kube-apiserver0+merge.yaml]
[patches] Applied patch of type "application/merge-patch+json" to target "kube-apiserver"
[control-plane] Creating static Pod manifest for "kube-controller-manager"
[control-plane] Creating static Pod manifest for "kube-scheduler"
[etcd] Creating static Pod manifest for local etcd in "/etc/kubernetes/manifests"
[wait-control-plane] Waiting for the kubelet to boot up the control plane as static Pods from directory "/etc/kubernetes/manifests". This can take up to 4m0s
[apiclient] All control plane components are healthy after 18.004611 seconds
[upload-config] Storing the configuration used in ConfigMap "kubeadm-config" in the "kube-system" Namespace
[kubelet] Creating a ConfigMap "kubelet-config-1.22" in namespace kube-system with the configuration for the kubelets in the cluster
[upload-certs] Skipping phase. Please see --upload-certs
[mark-control-plane] Marking the node cloucore1 as control-plane by adding the labels: [node-role.kubernetes.io/master(deprecated) node-role.kubernetes.io/control-plane node.kubernetes.io/exclude-from-external-load-balancers]
[mark-control-plane] Marking the node cloucore1 as control-plane by adding the taints [node-role.kubernetes.io/master:NoSchedule]
[bootstrap-token] Using token: qgpl1h.3ttnx38x8oe1oztp
[bootstrap-token] Configuring bootstrap tokens, cluster-info ConfigMap, RBAC Roles
[bootstrap-token] configured RBAC rules to allow Node Bootstrap tokens to get nodes
[bootstrap-token] configured RBAC rules to allow Node Bootstrap tokens to post CSRs in order for nodes to get long term certificate credentials
[bootstrap-token] configured RBAC rules to allow the csrapprover controller automatically approve CSRs from a Node Bootstrap Token
[bootstrap-token] configured RBAC rules to allow certificate rotation for all node client certificates in the cluster
[bootstrap-token] Creating the "cluster-info" ConfigMap in the "kube-public" namespace
[kubelet-finalize] Updating "/etc/kubernetes/kubelet.conf" to point to a rotatable kubelet client certificate and key
[addons] Applied essential addon: CoreDNS
[addons] Applied essential addon: kube-proxy
I1012 20:45:49.600288    8688 cni_addon.go:91] Deploy kube-flannel.yaml success!
I1012 20:45:50.386959    8688 edge_app.go:281] Deploy service-group success!
Create tunnel-cloud.yaml success!
I1012 20:45:52.599666    8688 edge_app.go:197] Deploy tunnel-cloud.yaml success!
I1012 20:45:52.999891    8688 deploy_tunnel.go:123] Deploy tunnel-edge.yaml success!
I1012 20:45:52.999910    8688 edge_app.go:216] Deploy tunnel-edge.yaml success!
I1012 20:45:54.408108    8688 deploy_edge_health.go:66] Create edge-health.yaml success!
I1012 20:45:54.578420    8688 deploy_edge_health.go:66] Create edge-health-admission.yaml success!
I1012 20:45:54.587455    8688 deploy_edge_health.go:66] Create edge-health-webhook.yaml success!
I1012 20:45:55.415176    8688 deploy_site_manager.go:40] Deploy site-manager.yaml success!
I1012 20:45:56.210365    8688 deploy_edge_coredns.go:55] Deploy edge-coredns.yaml success!
I1012 20:45:57.571537    8688 edge_app.go:390] Prepare Config Join Node configMap success
W1012 20:45:58.974177    8688 warnings.go:70] discovery.k8s.io/v1beta1 EndpointSlice is deprecated in v1.21+, unavailable in v1.25+; use discovery.k8s.io/v1 EndpointSlice
W1012 20:45:58.981270    8688 warnings.go:70] discovery.k8s.io/v1beta1 EndpointSlice is deprecated in v1.21+, unavailable in v1.25+; use discovery.k8s.io/v1 EndpointSlice
I1012 20:45:59.570894    8688 edge_app.go:364] Update Kubernetes cluster config support marginal autonomy successYour Kubernetes control-plane has initialized successfully!To start using your cluster, you need to run the following as a regular user:mkdir -p $HOME/.kubesudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/configsudo chown $(id -u):$(id -g) $HOME/.kube/configYou should now deploy a pod network to the cluster.
Run "kubectl apply -f [podnetwork].yaml" with one of the options listed at:https://kubernetes.io/docs/concepts/cluster-administration/addons/Then you can join any number of worker nodes by running the following on each as root:edgeadm join 114.116.101.254:6443 --token qgpl1h.3ttnx38x8oe1oztp \--discovery-token-ca-cert-hash sha256:a093916ca55608f318b608617821a976c012c271ba40081d097a977922f1640a  \--install-pkg-path <Path of edgeadm kube-* install package>[root@cloucore1 edgeadm-linux-amd64-v0.9.0-k8s-1.22.6]# 
#执行这3句在边缘master 节点mkdir -p $HOME/.kubesudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/configsudo chown $(id -u):$(id -g) $HOME/.kube/config
# [root@edge-node1 ~]在所有节点上执行
arch=amd64 version=v0.9.0 kubernetesVersion=1.22.6 && rm -rf edgeadm-linux-* && wget https://superedge-1253687700.cos.ap-guangzhou.myqcloud.com/$version/$arch/edgeadm-linux-$arch-$version-k8s-$kubernetesVersion.tgz && tar -xzvf edgeadm-linux-* && cd edgeadm-linux-$arch-$version-k8s-$kubernetesVersion && ./edgeadm
#这里需要根据系统的架构,选择arch=amd64 
# [root@edge-node1 ~]在所有节点上执行
./edgeadm  join 114.116.101.254:6443 --token qgpl1h.3ttnx38x8oe1oztp --discovery-token-ca-cert-hash sha256:a093916ca55608f318b608617821a976c012c271ba40081d097a977922f1640a   --install-pkg-path  ./kube-linux-amd64-v1.22.6.tar.gz
[root@edge-node1 ~]# ll
total 276408
-rwxr-xr-x 1 root root  61731777 Oct 12 20:54 edgeadm
-rw-r--r-- 1 root root 221297932 Oct 12 20:56 kube-linux-amd64-v1.22.6.tar.gz
[root@edge-node1 ~]# ./edgeadm  join 114.116.101.254:6443 --token qgpl1h.3ttnx38x8oe1oztp \
> --discovery-token-ca-cert-hash sha256:a093916ca55608f318b608617821a976c012c271ba40081d097a977922f1640a  \
>     --install-pkg-path ./kube-linux-amd64-v1.22.6.tar.gz 
[preflight] Reading configuration from the cluster...
[preflight] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -o yaml'
W1012 20:58:50.152755    8170 join_master.go:168] Get cluster-info configMap node-delay-domain value nil
W1012 20:58:50.152811    8170 join_master.go:186] Get cluster-info configMap host-config value nil
W1012 20:58:50.157688    8170 join_master.go:197] Get cluster-info configMap insecure-registries value nil
I1012 20:58:54.215269    8170 runtime.go:64] Installed container runtime containerd successfully
W1012 20:58:54.223056    8170 runcmd.go:52] Wait command: systemctl status lite-apiserver.service exec finish error: exit status 4
W1012 20:58:54.223082    8170 lite_apiserver_init.go:108] Running linux command: systemctl status lite-apiserver.service error: exit status 4
I1012 20:58:54.587444    8170 lite_apiserver_init.go:170] Deploy lite-apiserver success!
[preflight] Running pre-flight checks[WARNING FileExisting-socat]: socat not found in system path[WARNING Hostname]: hostname "edge-node1" could not be reached[WARNING Hostname]: hostname "edge-node1": lookup edge-node1 on 100.125.1.22:53: no such host
[kubelet-start] Writing kubelet configuration to file "/var/lib/kubelet/config.yaml"
[kubelet-start] Writing kubelet environment file with flags to file "/var/lib/kubelet/kubeadm-flags.env"
[kubelet-start] Starting the kubelet
[kubelet-start] Waiting for the kubelet to perform the TLS Bootstrap...This node has joined the cluster:
* Certificate signing request was sent to apiserver and a response was received.
* The Kubelet was informed of the new secure connection details.Run 'kubectl get nodes' on the control-plane to see this node join the cluster.[root@edge-node1 ~]# 看到输入这里的结果说明安装成功了

同理如果有其他的节点,也需要第2步的操作

3. 检查集群是否正常

 kubectl get nodeskubectl get pods -n kube-systemkubectl get pods -Akubectl get svc -A
[root@cloucore1 ~]# kubectl get nodes
NAME         STATUS   ROLES                  AGE     VERSION
cloucore1    Ready    control-plane,master   41m     v1.22.6
edge-node1   Ready    <none>                 28m     v1.22.6
edge-node2   Ready    <none>                 2m27s   v1.22.6
[root@cloucore1 ~]#
[root@cloucore1 ~]# kubectl get pods -n kube-system -o wide
NAME                                READY   STATUS    RESTARTS       AGE   IP              NODE         NOMINATED NODE   READINESS GATES
coredns-5b686c9994-g6nh2            1/1     Running   0              42m   10.233.0.2      cloucore1    <none>           <none>
coredns-5b686c9994-pz7t2            1/1     Running   0              42m   10.233.0.7      cloucore1    <none>           <none>
etcd-cloucore1                      1/1     Running   0              43m   192.168.0.245   cloucore1    <none>           <none>
kube-apiserver-cloucore1            1/1     Running   0              43m   192.168.0.245   cloucore1    <none>           <none>
kube-controller-manager-cloucore1   1/1     Running   0              43m   192.168.0.245   cloucore1    <none>           <none>
kube-flannel-ds-76j2x               1/1     Running   0              42m   192.168.0.245   cloucore1    <none>           <none>
kube-flannel-ds-dclmr               1/1     Running   0              29m   192.168.0.83    edge-node1   <none>           <none>
kube-flannel-ds-hv726               1/1     Running   1 (102s ago)   4m    192.168.0.154   edge-node2   <none>           <none>
kube-proxy-fbj2g                    1/1     Running   0              42m   192.168.0.245   cloucore1    <none>           <none>
kube-scheduler-cloucore1            1/1     Running   0              43m   192.168.0.245   cloucore1    <none>           <none>[root@cloucore1 ~]# kubectl get pods -A -o wide
NAMESPACE     NAME                                           READY   STATUS             RESTARTS       AGE     IP              NODE         NOMINATED NODE   READINESS GATES
default       nginx-7cf7d6dbc8-r87hl                         1/1     Running            0              22m     10.233.1.3      edge-node1   <none>           <none>
edge-system   application-grid-controller-5f89c65b48-tbhsn   1/1     Running            0              43m     10.233.0.3      cloucore1    <none>           <none>
edge-system   application-grid-wrapper-node-7cmck            1/1     Running            2 (41s ago)    4m36s   192.168.0.154   edge-node2   <none>           <none>
edge-system   application-grid-wrapper-node-j9wrx            1/1     Running            0              30m     192.168.0.83    edge-node1   <none>           <none>
edge-system   edge-coredns-pjm27                             1/1     Running            2 (116s ago)   3m46s   192.168.0.154   edge-node2   <none>           <none>
edge-system   edge-coredns-t4s9r                             1/1     Running            0              29m     192.168.0.83    edge-node1   <none>           <none>
edge-system   edge-health-admission-8579779db9-td5fw         1/1     Running            0              43m     10.233.0.6      cloucore1    <none>           <none>
edge-system   edge-health-mj24g                              1/1     Running            0              29m     10.233.1.2      edge-node1   <none>           <none>
edge-system   edge-health-p9rks                              1/1     Running            1 (63s ago)    3m46s   10.233.2.2      edge-node2   <none>           <none>
edge-system   edge-kube-proxy-5j7xs                          1/1     Running            4 (45s ago)    4m36s   192.168.0.154   edge-node2   <none>           <none>
edge-system   edge-kube-proxy-zjvk6                          1/1     Running            0              30m     192.168.0.83    edge-node1   <none>           <none>
edge-system   site-manager-7c884d6f98-l5sp2                  1/1     Running            0              43m     10.233.0.5      cloucore1    <none>           <none>
edge-system   tunnel-cloud-6d4d79dc94-4zzrz                  1/1     Running            0              43m     10.233.0.4      cloucore1    <none>           <none>
edge-system   tunnel-edge-b9phq                              1/1     Running            0              29m     192.168.0.83    edge-node1   <none>           <none>
edge-system   tunnel-edge-n5t78                              1/1     Running            1 (6s ago)     3m46s   192.168.0.154   edge-node2   <none>           <none>
kube-system   coredns-5b686c9994-g6nh2                       1/1     Running            0              43m     10.233.0.2      cloucore1    <none>           <none>
kube-system   coredns-5b686c9994-pz7t2                       1/1     Running            0              43m     10.233.0.7      cloucore1    <none>           <none>
kube-system   etcd-cloucore1                                 1/1     Running            0              43m     192.168.0.245   cloucore1    <none>           <none>
kube-system   kube-apiserver-cloucore1                       1/1     Running            0              43m     192.168.0.245   cloucore1    <none>           <none>
kube-system   kube-controller-manager-cloucore1              1/1     Running            0              43m     192.168.0.245   cloucore1    <none>           <none>
kube-system   kube-flannel-ds-76j2x                          1/1     Running            0              43m     192.168.0.245   cloucore1    <none>           <none>
kube-system   kube-flannel-ds-dclmr                          1/1     Running            0              30m     192.168.0.83    edge-node1   <none>           <none>
kube-system   kube-flannel-ds-hv726                          1/1     Running            2 (34s ago)    4m36s   192.168.0.154   edge-node2   <none>           <none>
kube-system   kube-proxy-fbj2g                               1/1     Running            0              43m     192.168.0.245   cloucore1    <none>           <none>
kube-system   kube-scheduler-cloucore1                       1/1     Running            0              43m     192.168.0.245   cloucore1    <none>           <none>

4.部署一个服务测试集群

cat > nginx.yaml << EOF
apiVersion: apps/v1
kind: Deployment
metadata:labels:app: nginxname: nginx
spec:replicas: 1selector:matchLabels:app: nginxtemplate:metadata:labels:app: nginxspec:containers:- image: nginxname: nginximagePullPolicy: IfNotPresent
---
apiVersion: v1
kind: Service
metadata:labels:app: nginxname: nginx
spec:type: NodePortports:- port: 80protocol: TCPtargetPort: 80selector:app: nginx
EOF
kubectl apply -f nginx.yaml 
kubectl get pods,svc
[root@ecs-f30f edgeadm-linux-amd64-v0.9.0-k8s-1.22.6]# crictl images ls
IMAGE                                                                TAG                 IMAGE ID            SIZE
ccr.ccs.tencentyun.com/library/pause                                 latest              80d28bedfe5de       299kB
superedge.tencentcloudcr.com/superedge/application-grid-controller   v0.9.0              9244dd60a6669       23.6MB
superedge.tencentcloudcr.com/superedge/coredns                       v1.8.4              8d147537fb7d1       13.7MB
superedge.tencentcloudcr.com/superedge/edge-health-admission         v0.9.0              782c112a5560b       21MB
superedge.tencentcloudcr.com/superedge/etcd                          3.5.0-0             0048118155842       99.9MB
superedge.tencentcloudcr.com/superedge/flannel                       v0.12.0-edge-2.0    6eedad6577f88       17.6MB
superedge.tencentcloudcr.com/superedge/init-cni-plugins              v0.8.3-edge-1.2     f06424df9aa39       40.2MB
superedge.tencentcloudcr.com/superedge/kube-apiserver                v1.22.6             d35b182b4200a       31.3MB
superedge.tencentcloudcr.com/superedge/kube-controller-manager       v1.22.6             3618e4ab750f2       29.8MB
superedge.tencentcloudcr.com/superedge/kube-proxy                    v1.22.6             63f3f385dcfed       35.9MB
superedge.tencentcloudcr.com/superedge/kube-scheduler                v1.22.6             9fe44a6192d1e       15MB
superedge.tencentcloudcr.com/superedge/pause                         3.5                 ed210e3e4a5ba       301kB
superedge.tencentcloudcr.com/superedge/site-manager                  v0.9.0              bad8dad27fa67       23.8MB
superedge.tencentcloudcr.com/superedge/tunnel                        v0.9.0              1a4fc5d77191c       46.9MB
[root@ecs-f30f edgeadm-linux-amd64-v0.9.0-k8s-1.22.6]# crictl ps -a
CONTAINER ID        IMAGE               CREATED             STATE               NAME                          ATTEMPT             POD ID
06a71a6b83464       9244dd60a6669       21 minutes ago      Running             application-grid-controller   0                   184f58d0995d1
612c083922fec       782c112a5560b       21 minutes ago      Running             edge-health-admission         0                   0071a4eab2b04
33ea12e71d24b       1a4fc5d77191c       21 minutes ago      Running             tunnel-cloud                  0                   1fd7a92548043
6f448dfd6ae80       bad8dad27fa67       21 minutes ago      Running             site-manager                  0                   ebbcbef4b797e
577cc60f62b28       8d147537fb7d1       22 minutes ago      Running             coredns                       0                   3af22e5ab4685
5befc10cbbe0e       8d147537fb7d1       22 minutes ago      Running             coredns                       0                   87cf88f687731
79c2b3532aaf4       6eedad6577f88       22 minutes ago      Running             kube-flannel                  0                   884ff8a94a504
cea40f8759924       6eedad6577f88       22 minutes ago      Exited              install-cni                   0                   884ff8a94a504
770cd29fb6080       f06424df9aa39       22 minutes ago      Exited              install-cni-plugins           0                   884ff8a94a504
ffdcb0ab5c500       63f3f385dcfed       22 minutes ago      Running             kube-proxy                    0                   58c6df602d3bb
50ba204c45bd7       0048118155842       22 minutes ago      Running             etcd                          0                   d506abd4d442c
8d106db7ae961       9fe44a6192d1e       22 minutes ago      Running             kube-scheduler                0                   0f45cd27528fb
b2a8c8d79f96c       d35b182b4200a       22 minutes ago      Running             kube-apiserver                0                   d9de8eb9a4d0f
445e6586ac892       3618e4ab750f2       22 minutes ago      Running             kube-controller-manager       0                   dc30b07e7e07e
[root@ecs-f30f edgeadm-linux-amd64-v0.9.0-k8s-1.22.6]# 

注意:这里是用腾讯公司推出的edgeadm 一键安装的K8S边缘集群。

网络组件时flannel,容器用的是containerd容器。

参考地址:https://github.com/superedge/edgeadm

相关文章:

SuperEdge易学易用系列-一键搭建SuperEdge集群

条件说明&#xff1a; 系统 公网IP 内网IP 服务器所在地 K8S版本 Centos7.9 114.116.101.254 192.168.0.245 北京 v1.22.6 Centos7.9 119.8.1.96 192.168.0.83 香港 v1.22.6 Ubuntu22 94.74.108.152 192.168.0.154 纽约 v1.22.6 1. 开始部署 1.1 两条指令从零搭建一个边缘集…...

农场养殖农产品商城小程序搭建

鸡鸭羊牛鱼养殖用户不少&#xff0c;其规模也有大有小&#xff0c;尤其对一些生态养殖企业&#xff0c;其产品需求度更高&#xff0c;同时他们也有实际的销售需求。 由于具备较为稳定的货源&#xff0c;因此大规模多规格销售属性很足。 通过【雨科】平台搭建农场养殖商城&…...

大语言模型之十七-QA-LoRA

由于基座模型通常需要海量的数据和算力内存&#xff0c;这一巨大的成本往往只有巨头公司会投入&#xff0c;所以一些优秀的大语言模型要么是大公司开源的&#xff0c;要么是背后有大公司身影公司开源的&#xff0c;如何从优秀的开源基座模型针对特定场景fine-tune模型具有广大的…...

UML组件图综合指南:设计清晰、可维护的软件系统

介绍&#xff1a; UML&#xff08;Unified Modeling Language&#xff09;组件图是软件系统设计中的重要工具&#xff0c;用于描绘系统的物理结构和组件之间的关系。在软件工程中&#xff0c;通过创建清晰的组件图&#xff0c;团队能够更好地理解系统的模块化结构和组织关系&a…...

深入浅出ThreadPoolExecutor(一)

文章目录 线程池简诉ThreadPoolExecutor详解ThreadPoolExecutor参数详解创建线程池的工具类Executors 线程池简诉 针对各种池子,比如 连接池:用于管理和重复使用数据库连接&#xff0c;避免频繁创建和销毁数据库连接带来的性能开销。对象池&#xff1a;用于管理和重复使用对象…...

网站的常见攻击与防护方法

在互联网时代&#xff0c;几乎每个网站都存在着潜在的安全威胁。这些威胁可能来自人为失误&#xff0c;也可能源自网络犯罪团伙所发起的复杂攻击。无论攻击的本质如何&#xff0c;网络攻击者的主要动机通常是谋求经济利益。这意味着无论您经营的是电子商务项目还是小型商业网站…...

网络工程师知识点3

41、各个路由协议&#xff0c;在华为设备中的优先级&#xff1f; 直连路由 0 OSPF 10 静态 60 42、OSPF&#xff1a;开放式最短路径优先路由协议&#xff0c;使用SPF算法发现和计算路由 OSPF的优点&#xff1a; 1、收敛速度快&#xff0c;无路由自环&#xff0c;适用于大型网络…...

mongoDB 性能优化

文章目录 前言mongoDB 性能优化1. explain方法来查看查询的执行计划2. 查看mongoDB 集合的索引3. mongoDB 怎么添加索引4. 升序索引与降序索引是什么意思 前言 如果您觉得有用的话&#xff0c;记得给博主点个赞&#xff0c;评论&#xff0c;收藏一键三连啊&#xff0c;写作不易…...

10月13日,每日信息差

今天是2023年10月13日&#xff0c;以下是为您准备的13条信息差 第一、欧盟投资4.5亿欧元在法国建设电池超级工厂。欧洲投资银行是欧盟的贷款机构&#xff0c;也是世界上最大的跨国银行之一 ​第二、北京银行推出数字人民币智能合约平台 数字人民币预付资金管理产品在商超场景…...

Spring Boot 中的 Redis 数据操作配置和使用

Spring Boot 中的 Redis 数据操作配置和使用 Redis&#xff08;Remote Dictionary Server&#xff09;是一种高性能的开源内存数据库&#xff0c;用于缓存、消息队列、会话管理和数据存储。在Spring Boot应用程序中&#xff0c;Redis被广泛用于各种用例&#xff0c;包括缓存、…...

rust宏

宏看起来和函数很像&#xff0c;只不过名称末尾有一个感叹号 ! 。 宏并不产生函数调用&#xff0c;而是展开成源码&#xff0c;并和程序的其余部分一起被编译。 Rust宏和C不同&#xff0c;Rust的宏会展开为抽象语法树&#xff08;AST&#xff0c;abstract syntax tree&#xff…...

性能测试之性能测试指标详解

前言 刚开始&#xff0c;以为做性能测试&#xff0c;就是做些脚本、参数化、关联&#xff0c;压起来之后&#xff0c;再扔出一个结果。 但实际上不止这些内容&#xff0c;还要加上性能分析&#xff0c;关注调优之后响应时间有多大的提升&#xff0c;TPS 有多大的提高&#xf…...

CustomNavBar 自定义导航栏视图

1. 创建偏好设置键 CustomNavBarTitlePreferenceKey.swift import Foundation import SwiftUI//State private var showBackButton: Bool true //State private var title: String "Title" //"" //State private var subtitle: String? "SubTitl…...

canal rocketmq

上篇文章canal 消费进度说到直接使用ClusterCanalConnector并发消费是有问题的&#xff0c;可以先用单点将canal事件发送到mq中&#xff0c;再由mq并发处理&#xff0c;另外mq还可以做到削峰的作用&#xff0c;让canal数据不至于阻塞。 使用队列&#xff0c;可以自己起一个单实…...

【数据库系统概论】第九章关系查询处理何查询优化

9.1查询处理 一&#xff1a;查询处理步骤 关系数据库管理系统查询处理可以分为4个阶段&#xff1a; 查询分析查询检查查询优化查询执行 &#xff08;1&#xff09;查询分析 任务&#xff1a;对查询语句进行扫描&#xff0c;分析词法、语法是否符合SQL语法规则 如果没有语…...

bp盐丘模型波场数值模拟matlab

波场数值模拟是地震勘探和地震学研究中常用的工具&#xff0c;而BP&#xff08;Backpropagation&#xff09;盐丘模型是一种用于地下介质成像的方法。如果您想在MATLAB中进行波场数值模拟&#xff0c;并结合BP盐丘模型进行地下成像&#xff0c;可以按照以下步骤进行&#xff1a…...

结构体对齐规则

1.第一个成员在结构体变量偏移量为0的地址处。 2.其他成员变量对齐到某个数字(对齐数)的整数倍的地址处。(对齐数编译器默认的一个对齐数与该成员大小的较小值&#xff09;注意&#xff1a;目前有且只有VS编译器有默认为8. 3.结构体总大小为最大对齐数的整数倍。 4.如果嵌套…...

css 如何让元素内部文本和外部文本 一块显示省略号

实际上还是有这样的需求的 <div class"container"><span>啊啊啊啊啊啊啊啊</span>你好啊撒撒啊撒撒撒撒啊撒撒撒撒撒说</div>还是有这样的需求的哦。 div.container {width: 200px;white-space: nowrap;text-overflow: ellipsis;overflow:…...

SQL语句-中级

一、Mysql软件使用 1.启动/停止Mysql服务器 任务管理器 cmd命令&#xff1a;以管理员的身份打开cmd命令行 net start mysql80//开启net stop mysql80//停止 2.连接与断开Mysql服务器 注意要在bin目录下执行:-u用户名root&#xff0c;-p密码 mysql -u root -p 可能出现的…...

巧用h2-database.jar连接数据库

文章目录 一 、概述二、实践三、解决办法 一 、概述 H2 Database是一个开源的嵌入式数据库引擎&#xff0c;采用java语言编写&#xff0c;不受平台的限制&#xff0c;同时H2 Database提供了一个十分方便的web控制台用于操作和管理数据库内容。H2 Database还提供兼容模式&#…...

136.只出现一次的数字

136. 只出现一次的数字 - 力扣&#xff08;LeetCode&#xff09; 给你一个 非空 整数数组 nums &#xff0c;除了某个元素只出现一次以外&#xff0c;其余每个元素均出现两次。找出那个只出现了一次的元素。 你必须设计并实现线性时间复杂度的算法来解决此问题&#xff0c;且…...

mysql中遇到查询字段的别名与函数冲突问题

比如以下哎&#xff0c;我查询城市行业数量排名 select City, DENSE_RANK() over(ORDER BY COUNT(Id) DESC) rank, COUNT(Id) num,IndustrySubGroupName from base_companyinfo WHERE IndustrySubGroupName工业机器人 GROUP BY City 上面使用 DENSE_RANK() 函数来计算排名&am…...

直播获奖

题目描述 NOI2130 即将举行。为了增加观赏性&#xff0c; CCF 决定逐一评出每个选手的成 绩&#xff0c;并直播即时的获奖分数线。本次竞赛的获奖率为 &#x1d464;% &#xff0c;即当前排名前 &#x1d464;% 的选手的最低成绩就是即时的分数线。 更具体地&#xff0c…...

选择适合自身业务的HTTP代理有哪些因素决定?

相信对很多爬虫工作者和数据采集的企业来说&#xff0c;如何选购适合自己业务的HTTP代理是一个特别特别困扰的选题&#xff0c;市面上那么多HTTP代理厂商&#xff0c;好像这家有这些缺点&#xff0c;转头又看到另外一家的缺点&#xff0c;要找一家心仪的仿佛大海捞针。今天我们…...

1.3 do...while实现1+...100 for实现1+...100

思路&#xff1a;两个变量&#xff0c;一个变量存储数据之和&#xff0c;一个变量实现自增就行 do...while int i, s;i 1;s 0;do{s 1;i;} while (i < 100);cout << s << endl; for int i, j0;for (i 1; i < 100; i){j 1;}cout << j << …...

react数据管理之setState与Props

react数据管理之setState与Props setState调用原理 setState 是 React 中用于更新组件状态&#xff08;state&#xff09;的方法。它的调用原理可以分为以下几个步骤&#xff1a; 状态的改变&#xff1a;当调用 setState 时&#xff0c;React 会将新的状态对象与当前状态对象…...

如何保护我们的网络安全

保护网络安全是至关重要的&#xff0c;尤其是在今天的数字化时代。以下是一些保护网络安全的基本步骤&#xff1a; 1、使用强密码&#xff1a;使用包含字母、数字和特殊字符的复杂密码。不要在多个网站上重复使用相同的密码。定期更改密码。 2、启用双因素认证 (2FA)&#xff…...

springboot 制造装备物联及生产管理ERP系统

springboot 制造装备物联及生产管理ERP系统 liu1113625581...

Google zxing 生成带logo的二维码图片

环境准备 开发环境 JDK 1.8SpringBoot2.2.1Maven 3.2 开发工具 IntelliJ IDEAsmartGitNavicat15 添加maven配置 <dependency><groupId>com.google.zxing</groupId><artifactId>core</artifactId><version>3.4.0</version> </…...

使用Python计算平面多边形间最短距离

要计算平面多边形间的最短距离&#xff0c;首先需要导入Excel表格中的多边形数据&#xff0c;然后使用GJK&#xff08;Gilbert-Johnson-Keerthi&#xff09;算法来判断两个多边形是否重叠。如果两个多边形不重叠&#xff0c;可以计算它们之间的最短距离。 以下是一个基本的Pyt…...