当前位置:网站首页>Install mysql on k8s
Install mysql on k8s
2022-08-04 13:07:00 【The young marshal (Young marshal)】
Foreword
The middleware and database in the production environment are deployed outside the container. In the experimental environment, the persistent storage can use a distributed storage system or tag nodes for local storage.
Installation
Set the PV on the k8s-03 node, and label the node with app=mysql-car. In the deploy, nodeSelector selects the node and schedules it on this node.
##kubectl label node k8s-03 app=mysql-car##kubectl get nodes --show-labels |grep mysql## Create ns dedicated databasekubectl create ns mysql-devCreate cm:
kind: ConfigMapapiVersion: v1metadata:name: my.cnfnamespace: mysql-devdata:my.cnf: |[client]default-character-set=utf8port=3306[mysqld]socket=/var/run/mysqld/mysqld.sockpid-file = /var/run/mysqld/cpep.piddatadir = /var/lib/mysqlcharacter-set-server=utf8init_connect=SET NAMES utf8Create PV and PVC persistence:
# Create a directory on k8s-03mkdir -p /data/k8s/mysql-dev/mysql-data/pv.yml:
边栏推荐
- LeetCode_643_子数组的最大平均数Ⅰ
- 【WeChat Mini Program】Social Internship Production Project for Information Management and Information System Major--Trash Fingerprint
- 持续交付(三)Jenkinsfile语法使用介绍
- postgre 支持 newsql 特性可行性有多大?
- Matlab记录
- 持续交付(四)Jenkins多线程任务执行
- 永磁同步电机FOC驱动代码讲解
- “蔚来杯“2022牛客暑期多校训练营5 B、C、F、G、H、K
- LeetCode 1403 非递增顺序的最小子序列[贪心] HERODING的LeetCode之路
- 持续交付(二)PipeLine基本使用
猜你喜欢

Why is Luo Zhenyu's A-share dream so difficult to fulfill?

代码越写越乱?那是因为你没用责任链!

Arduino框架下I2S控制ADC采样以及PWM输出示例解析

使用SQLServer复制数据库

做项目管理有且有必要了解并学习的重要知识--PMP项目管理

“蔚来杯“2022牛客暑期多校训练营4 N

5 cloud security management strategies enterprises should implement

未来已来,只是尚未流行

【VSCode】一文详解vscode下安装vim后无法使用Ctrl+CV复制粘贴 使用Vim插件的配置记录

Programmer Qixi Gift - How to quickly build an exclusive chat room for your girlfriend in 30 minutes
随机推荐
Systemui qsSetting添加新图标
“蔚来杯“2022牛客暑期多校训练营2 G、J、K
k8s上安装mysql
基于双层共识控制的直流微电网优化调度(Matlab代码实现)
手搓一个“七夕限定”,用3D Engine 5分钟实现烟花绽放效果
使用COLMAP初步三维重建
【解决方案 三十一】Navicat数据库结构同步
内存定位利器-ASAN使用小结
Niuke.com Brush Question Record || Linked List
小程序对接企业微信客服
LeetCode 1403 非递增顺序的最小子序列[贪心] HERODING的LeetCode之路
【自动微分实现】反向OO实现自动微分(Pytroch核心机制)
Cows 树状数组
持续交付(三)Jenkinsfile语法使用介绍
持续交付(二)PipeLine基本使用
技术分享| 小程序实现音视频通话
nVisual二次开发——第二章 nVisual API操作指南Swagger使用
yum 查看已经安装过的包并卸载
LeetCode_424_替换后的最长重复字符
做项目管理有且有必要了解并学习的重要知识--PMP项目管理