当前位置:网站首页>K8s deploy MySQL
K8s deploy MySQL
2022-04-22 21:10:00 【LV Haiyang】
Catalog
3、 ... and 、 newly build service
Four 、 For deployment yaml file
One 、 newly build namespace
1、 establish namespace
kubectl create namespace lhynamespace
2、 see namespace
kubectl get namespace
3、 Delete namespace
kubectl delete namespace lhynamespace
Two 、 newly build deployment
1、 Generate yaml file
kubectl create deployment mysql8 --image=mysql:8 --dry-run -o yaml > mysql8_deployment.yaml
2、 modify yaml file
Appoint namespace
metadata:
namespace: lhynamespace
3、 establish deployment
kubectl apply -f mysql8_deployment.yaml
4、 see lhynamespace Under the namespace deployment
kubectl get deployment -n lhynamespace
kubectl get deployment --all-namespaces // View all namespace
5、 Delete lhynamespace Under the namespace mysql8 Of deployment , Delete deployment after pod Automatically delete adopt yaml Created , adopt yaml File deletion
kubectl delete -f mysql8_deployment.yaml
kubectl delete deployment mysql8 -n lhynamespace // Command deletion
3、 ... and 、 newly build service
kubectl expose -f mysql8_deployment.yaml --port=3306 --target-port=3306 --type=NodePort -n lhynamespace -o yaml > mysql8_service.yaml
Cluster internal access port 3306
Physical machine mapping port You can view the generated yaml Of documents nodePort
It can also be based on the generated yaml Modify the configuration and redeploy service
Four 、 For deployment yaml file
deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
labels:
app: mysql8
name: mysql8
namespace: lhynamespace
spec:
replicas: 2
selector:
matchLabels:
app: mysql8
strategy: {}
template:
metadata:
creationTimestamp: null
labels:
app: mysql8
spec:
containers:
- image: mysql:8
name: mysql8
resources: {}
env:
- name: MYSQL_ROOT_PASSWORD
value: "123456"
ports:
- name: mysql-3306
containerPort: 3306
protocol: TCP
status: {}
service.yaml
apiVersion: v1
kind: Service
metadata:
creationTimestamp: "2022-04-22T11:22:53Z"
labels:
app: mysql8
name: mysql8
namespace: lhynamespace
resourceVersion: "11201"
uid: ea56fbb1-4e20-4c4e-8990-c3859e2cb9fc
spec:
clusterIP: 10.105.91.138
clusterIPs:
- 10.105.91.138
externalTrafficPolicy: Cluster
internalTrafficPolicy: Cluster
ipFamilies:
- IPv4
ipFamilyPolicy: SingleStack
ports:
- nodePort: 30001
port: 3306
protocol: TCP
targetPort: 3306
selector:
app: mysql8
sessionAffinity: None
type: NodePort
status:
loadBalancer: {}
版权声明
本文为[LV Haiyang]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204222105459453.html
边栏推荐
- Rong Lianyun joined hands with China Academy of information and communications to start the development of a series of standards for office instant messaging software
- k8s部署mysql
- Children's organization and ideological education in Central China Normal University
- Solution Sudoku [pre DS hash structure + component DFS | pre-hash-1-9 feature -- binary state compression + DFS]
- jmeter整套资料
- (一)UART子系统学习计划
- 2022年G3锅炉水处理国家题库及在线模拟考试
- 基于PAOGD_HW1的弹出的小球-简单建模、插值动画
- beyond compare 强制使用二进制传输,保证文件一样
- BLE---Advertisement data format & service
猜你喜欢

Building a new generation of computing platform, stepvr will open the "door" of metauniverse in 2022

88 r user portrait linear regression logical regression comprehensive practice 1

软件测试知识点 | Jmeter实现接口关联小结

第一章 虚拟现实技术概论

.103Navigator

WampServer 搭建本地服务器及 XSS 基本原理和初步实践(一)

.103Navigator

SDF accelerate trace

Some understanding of sw-msa in swing-t

All paths of 344 leetcode binary tree
随机推荐
QTP11. 5 / UFT including Chinese package
Introduction to dynamic programming of leetcode learning plan day1,2 (4 questions in total)
Qtp11 tutorial
重返天梯-L2-020 功夫传人 (25 分)(bfs or dfs)
Introduction and hardware implementation of sereds deserialization module
QT使用windeployqt.exe打包程序
SEREDS解串模块简介以及硬件实现
MySQL advanced stored procedure storage function -- Introduction to stored procedure, basic syntax of stored procedure, variables (system variables, user-defined variables, local variables), if, param
[radar] point target simulation of simulated synthetic aperture radar (SAR)
MySql指定字段排序、自定义排序位置
软件测试工具最全的抓包工具的综合对比
buuctf-[Flask]SSTI
Leetcode question brushing Diary - Sword finger offer II 070 Sort numbers that appear only once in the array
LeetCode-209-长度最小的子数组
OpenVX 的 立即模式(immediate mode)和图模式(graph mode)和示例讲解
kubernetes_Namespace无法删除的解决方法
[MySQL from introduction to mastery]: a summary of wildcards in common like clauses
博途PLC用户自定义数据类型
毕业五年,如何从月薪5K涨到年薪50W+,需要掌握哪些核心技能?
Time report填写规则