当前位置:网站首页>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-dev
Create 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 utf8
Create PV and PVC persistence:
# Create a directory on k8s-03mkdir -p /data/k8s/mysql-dev/mysql-data/
pv.yml:
边栏推荐
- 03 多线程与高并发 - ReentrantLock 源码解析
- Systemui qsSetting添加新图标
- Billboard
- 高手,云集在于REST、gRPC 和 GraphQL之间!
- 【WeChat Mini Program】Social Internship Production Project for Information Management and Information System Major--Trash Fingerprint
- 用过Apifox这个API接口工具后,确实感觉postman有点鸡肋......
- sqlplus报错ORA-12547: TNS:lost contact解决
- Interviewer: Tell me the difference between NIO and BIO
- js正则表达式提取内容
- Motion Rule (16)-Union Check Basic Questions-Grid Game
猜你喜欢
封装、继承、多态的联合使用实现不同等级学生分数信息的统计
Programmer Qixi Gift - How to quickly build an exclusive chat room for your girlfriend in 30 minutes
[UML] Summary of Information System Analysis and Design Knowledge Points
LeetCode 1403 Minimum subsequence in non-increasing order [greedy] HERODING's LeetCode road
做项目管理有且有必要了解并学习的重要知识--PMP项目管理
【毕设选题推荐】机器人工程专业毕设选题推荐
谁说 Mysql 单表最大 2000 W ?我硬要塞它 1 个亿
CReFF缓解长尾数据联邦学习(IJCAI 2022)
【PHP实现微信公众平台开发—基础篇】第1章 课程介绍
Valentine's Day Romantic 3D Photo Wall [with source code]
随机推荐
sqlserver删除重复数据
MySQL-数据类型
Cows 树状数组
Diffusion Models:生成扩散模型
《社会企业开展应聘文职人员培训规范》团体标准在新华书店上架
Django框架MySQL数据库到models模型的映射关系
Niuke.com Brush Question Record || Linked List
【VSCode】一文详解vscode下安装vim后无法使用Ctrl+CV复制粘贴 使用Vim插件的配置记录
一文梳理NLP主要模型发展脉络
项目里的各种配置,你都了解吗?
LeetCode 1403 Minimum subsequence in non-increasing order [greedy] HERODING's LeetCode road
云原生Devops 的实现方法
21天学习挑战赛--第二天打卡(setSystemUiVisibility、导航栏、状态栏)
router---动态路由匹配
Escape character is ‘^]’什么意思?怎么使用telnet
Django使用腾讯云发送短信并存入redis
LeetCode_424_替换后的最长重复字符
Ultra-QuickSort
router---路由守卫
荧光磷脂PEG衍生物之一磷脂-聚乙二醇-荧光素,Fluorescein-PEG-DSPE