当前位置:网站首页>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:
边栏推荐
- Do you understand the various configurations in the project?
- MySQL-数据类型
- Cows 树状数组
- Interviewer: How to view files containing abc string in /etc directory?
- 封装、继承、多态的联合使用实现不同等级学生分数信息的统计
- 面试官:连 INSERT INTO SET 都不知道怎么用,你这3年都干些什么了?
- js正则表达式提取内容
- JSX使用
- Chinese valentine's day of young people crazy to make money, earn 140000 a week
- 密码设置十准则
猜你喜欢
随机推荐
Escape character is ‘^]’什么意思?怎么使用telnet
《会面》-凯瑟琳曼斯菲尔德(徐志摩译)
“蔚来杯“2022牛客暑期多校训练营5 B、C、F、G、H、K
Interviewer: Tell me the difference between NIO and BIO
双目立体视觉笔记(二)
HDU1580 输出先手能取的方案数
router---路由守卫
RobotFramework二次开发(一)
rpm安装提示error: XXX: not an rpm package (or package manifest):
router---编程式导航
nVisual二次开发——第二章 nVisual API操作指南Swagger使用
荧光磷脂PEG衍生物之一磷脂-聚乙二醇-荧光素,Fluorescein-PEG-DSPE
03 多线程与高并发 - ReentrantLock 源码解析
Niuke.com Brush Question Record || Linked List
双目立体视觉学习笔记(一)
Ultra-QuickSort
Week 7 Latent Variable Models and Expectation Maximization
云原生Devops 的实现方法
牛客网刷题记录 || 链表
秋招攻略秘籍,吃透25个技术栈Offer拿到手软









