当前位置:网站首页>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:
边栏推荐
猜你喜欢
Haproxy搭建web群集
Do you understand the various configurations in the project?
Interviewer: Tell me the difference between NIO and BIO
持续交付(四)Jenkins多线程任务执行
[Niu Ke brush questions-SQL big factory interview questions] NO5. Analysis of a treasure store (e-commerce model)
持续交付(三)Jenkinsfile语法使用介绍
智能电视可以打开小程序应用,再也不用头痛内存了
"Lonely Walking on the Moon" is a powerful medicine, it can't cure the internal friction of happy twist
判断密码是否包含键盘连续字母
RobotFramework二次开发(一)
随机推荐
面试官:说一下NIO和BIO的区别
Systemui qsSetting添加新图标
《社会企业开展应聘文职人员培训规范》团体标准在新华书店上架
判断密码是否包含键盘连续字母
基于双层共识控制的直流微电网优化调度(Matlab代码实现)
干货丨数学规划视角下的分货优化解题思路
c#学习_第二弹
"Social Enterprises Conducting Civilian Personnel Training Specifications" group standard on the shelves of Xinhua Bookstore
Utility function---string processing
odoo13笔记点
烂大街的缓存穿透、缓存击穿和缓存雪崩,你真的懂了?
面试官:如何查看/etc目录下包含abc字符串的文件?
LeetCode 1403 Minimum subsequence in non-increasing order [greedy] HERODING's LeetCode road
Opencv学习之ORB特征提取和匹配
绩效考核带给员工的不能只是压力
Why don't young people like to buy Mengniu and Yili?
Is the code more messy?That's because you don't use Chain of Responsibility!
【水一个徽章】
【毕设选题推荐】机器人工程专业毕设选题推荐
【Game Of AutoTest】1、再度启程,重识游戏自动化测试