Kubernetes/Helm/Helm部署Mysql.md
offends 7a2f41e7d6
All checks were successful
continuous-integration/drone Build is passing
synchronization
2024-08-07 18:54:39 +08:00

53 lines
1.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

> 本文作者:丁辉
# Helm部署Mysql
## 介绍
**MySQL是一个流行的开源关系型数据库管理系统RDBMS由瑞典公司MySQL AB开发现属于Oracle公司的一款产品**。它以高性能、易用性和对多种语言的支持而闻名是构建Web应用和服务的首选数据库之一。
## 开始部署
1. 添加仓库
```bash
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo update
```
2. 编写 values.yaml 文件
```bash
vi mysql-values.yaml
```
内容如下
```yaml
global:
storageClass: "" # 指定存储卷, 不指定则需要集群内存在默认的存储卷
auth:
rootPassword: "Root123456"
defaultAuthenticationPlugin: "mysql_native_password"
# 开启监控
metrics:
enabled: true
serviceMonitor:
enabled: true
```
3. 开始部署
```bash
helm install mysql bitnami/mysql \
--namespace mysql --create-namespace \
-f mysql-values.yaml
```
## 卸载
```bash
helm uninstall mysql -n mysql
```