本站基于K3S的网络架构拓扑

一、基础环境

环境基于GCP三个月免费试用搭建!

二、架构拓扑

Website Architecture

Website Architecture

三、搭建过程

3.1 Netmaker搭建-基于docker compose

1、将域名api.jp.t4x.org、dashboard.jp.t4x.org、broker.jp.t4x.org解析到服务器IP #比如本次实验的IP地址:35.213.98.66
2、允许TCP80、443、51821;UDP51821端口出网 #可能需要出网的包括TCP53、8085、1883、8883、8083、18083; UDP53 文 章 源 自 note.t4x.orgByrd's Blog-https://note.t4x.org/project/note-website-architecture/

3.2 netmaker连通性验证

文 章 源 自 note.t4x.orgByrd's Blog-https://note.t4x.org/project/note-website-architecture/

3.3 防火墙设置

文 章 源 自 note.t4x.orgByrd's Blog-https://note.t4x.org/project/note-website-architecture/

3.4 k3s服务搭建

文 章 源 自 note.t4x.orgByrd's Blog-https://note.t4x.org/project/note-website-architecture/

3.4.0 Master

3.4.0为本地测试后加入的,可能和之前的IP不一致,请按需修改

文 章 源 自 note.t4x.orgByrd's Blog-https://note.t4x.org/project/note-website-architecture/
3.4.1 Master01

文 章 源 自 note.t4x.orgByrd's Blog-https://note.t4x.org/project/note-website-architecture/

3.4.2 Master02

文 章 源 自 note.t4x.orgByrd's Blog-https://note.t4x.org/project/note-website-architecture/

3.4.3 Master03

文 章 源 自 note.t4x.orgByrd's Blog-https://note.t4x.org/project/note-website-architecture/

3.4.4 worker节点

3.5 集群状态

3.6 calico配置
3.7 k3s状态

3.8 集群验证

四、服务配置

4.0 MySQL
4.1 MySQL Master

4.2 MySQL slave

4.1 MySQL验证

4.2 监控部署

监控

监控

prometheus监控

prometheus监控

4.3 网站配置

说明:此处通过nodeSelector选择了某节点模拟web的共享目录,通过nginx模拟了LB,没配置ingress。
通过访问http://jp.t4x.org:8080/安装了wordpress,可能存在网站无法写入 wp-config.php 的权限问题,可以通过配置网站目录权限解决。


nginx配置

wordpress 数据库配置

五、服务器资源


六、证书问题

证书脚本:


有效期:

证书:

七、local-path

八、network

九、其他问题


参考文档:
1:https://github.com/percona-lab/percona-docker/
2:https://hub.docker.com/r/percona/percona-xtradb-cluster
3:https://github.com/prometheus-operator/kube-prometheus/
4:https://mp.weixin.qq.com/s/R88DraaaS3bpm3PurzpP9g
5:https://docs.tigera.io/calico/latest/getting-started/kubernetes/k3s/quickstart
6:https://docs.k3s.io/zh/cli/certificate
7:https://docs.rancher.cn/docs/k3s/storage/_index

申明:除非注明Byrd's Blog内容均为原创,未经许可禁止转载!详情请阅读版权申明!

 
Zane
  • by Published onJune 10, 2025
  • 原文链接:https://note.t4x.org/project/note-website-architecture/
匿名

Comment

Anonymous

Slide puzzle verification.