程润科 数据库研发工程师,目前从事 RadonDB Mysql kubernetes 研发,热衷于研究数据库内核、k8s 相关技术。 张莉梅 高级文档工程师,目前负责数据库产品文档开发、维护和管理工作。 本文将演示如何在 KubeS
程润科
数据库研发工程师,目前从事 RadonDB Mysql kubernetes 研发,热衷于研究数据库内核、k8s 相关技术。
张莉梅
高级文档工程师,目前负责数据库产品文档开发、维护和管理工作。
本文将演示如何在 KubeSphere[1] 上部署 RadonDB mysql on Kubernetes 2.1.2,快速实现高可用的 Mysql on K8s。
admin
身份登录控制台,在企业空间 demo
中的 demo-project
项目中进行操作demo
企业空间中,进入应用管理下的应用仓库页面,点击添加,弹出仓库配置对话框。若已在 KubeSphere 部署过历史版本 Operator,可以选择如下方式更新到最新版本。
参考如上步骤,安装最新版本 Operator 。
执行如下命令更新 CRD 版本。如下示例为更新 CRD 到 2.1.2 版。
kubectl apply -f Https://raw.githubusercontent.com/radondb/radondb-mysql-kubernetes/v2.1.2/charts/mysql-operator/crds/mysql.radondb.com_mysqlclusters.yaml
可任选一个 RadonDB MySQL 配置示例[5] 部署,或自定义配置部署。
以 mysql_v1alpha1_mysqlcluster.yaml
模版为例,创建一个 RadonDB MySQL 集群。
kubectl apply -f https://github.com/radondb/radondb-mysql-kubernetes/releases/latest/download/mysql_v1alpha1_mysqlcluster.yaml --namespace=
注意
未指定项目时,集群将被默认安装在 kubesphere-controls-system
项目中。若需指定项目,安装命令需添加 --namespace=
。
预期结果
$ kubectl apply -f https://github.com/radondb/radondb-mysql-kubernetes/releases/latest/download/mysql_v1alpha1_mysqlcluster.yaml --namespace=demo-project
mysqlcluster.mysql.radondb.com/sample created
kubectl get statefulset,svc
预期结果
$ kubectl get statefulset,svc
NAME READY AGE
statefulset.apps/sample-mysql 3/3 10m
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/default-http-backend ClusterIP 10.96.69.202 80/tcp 3h2m
service/sample-follower ClusterIP 10.96.9.162 3306/TCP 10m
service/sample-leader ClusterIP 10.96.255.188 3306/TCP 10m
service/sample-mysql ClusterIP None 3306/TCP 10m
在 demo-project
项目中,查看 RadonDB MySQL 集群状态。
至此,完成在 KubeSphere 中部署 RadonDB MySQL 集群。
[1]:KubeSphere:https://kubesphere.com.cn
[2]:OpenPitrix:https://kubesphere.io/zh/docs/pluggable-components/app-store
[3]:创建操作:https://kubesphere.io/zh/docs/quick-start/create-workspace-and-project
[4]:项目网关:https://kubesphere.io/zh/docs/project-administration/project-gateway
[5]:配置示例:https://github.com/radondb/radondb-mysql-kubernetes/blob/main/config/samples
原文地址:https://www.cnblogs.com/radondb/arcHive/2022/02/25/15935332.html
--结束END--
本文标题: 容器化 | 在 KubeSphere 中部署 MySQL 集群
本文链接: https://www.lsjlt.com/news/9127.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-05-08
2024-05-08
2024-05-08
2024-05-08
2024-05-08
2024-05-08
2024-05-08
2024-05-08
2024-05-08
2024-05-08
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0