当前位置: 首页 > news >正文

K8S deployment挂载

挂载到emptyDir

挂载在如下目录,此目录是pod所在的node节点主机的目录,此目录下的data即对应容器里的/usr/share/nginx/html,实现目录挂载;图1红框里的号对应docker 的name中的编号,如下俩个图

 


apiVersion: apps/v1
kind: Deployment
metadata:annotations:deployment.kubernetes.io/revision: "1"kubectl.kubernetes.io/last-applied-configuration: |{"apiVersion":"apps/v1","kind":"Deployment","metadata":{"annotations":{"deployment.kubernetes.io/revision":"1"},"creationTimestamp":"2023-05-08T13:55:49Z","generation":1,"labels":{"app":"web"},"name":"web","namespace":"dalong-test-1","resourceVersion":"228450","uid":"359f54a6-cb5f-4168-82b2-fc0266c56e52"},"spec":{"progressDeadlineSeconds":600,"replicas":1,"revisionHistoryLimit":10,"selector":{"matchLabels":{"app":"web"}},"strategy":{"rollingUpdate":{"maxSurge":"25%","maxUnavailable":"25%"},"type":"RollingUpdate"},"template":{"metadata":{"creationTimestamp":null,"labels":{"app":"web"}},"spec":{"containers":[{"image":"nginx:1.17","imagePullPolicy":"Always","name":"nginx","resources":{},"terminationMessagePath":"/dev/termination-log","terminationMessagePolicy":"File"}],"dnsPolicy":"ClusterFirst","restartPolicy":"Always","schedulerName":"default-scheduler","securityContext":{},"terminationGracePeriodSeconds":30}}},"status":{"availableReplicas":1,"conditions":[{"lastTransitionTime":"2023-05-08T13:56:03Z","lastUpdateTime":"2023-05-08T13:56:03Z","message":"Deployment has minimum availability.","reason":"MinimumReplicasAvailable","status":"True","type":"Available"},{"lastTransitionTime":"2023-05-08T13:55:49Z","lastUpdateTime":"2023-05-08T13:56:03Z","message":"ReplicaSet \"web-96d5df5c8\" has successfully progressed.","reason":"NewReplicaSetAvailable","status":"True","type":"Progressing"}],"observedGeneration":1,"readyReplicas":1,"replicas":1,"updatedReplicas":1}}creationTimestamp: "2023-08-12T07:23:41Z"generation: 1labels:app: webname: webnamespace: dalong-test-1resourceVersion: "816863"uid: 75552def-ddb5-4f97-81fb-d06cb5128432
spec:progressDeadlineSeconds: 600replicas: 1revisionHistoryLimit: 10selector:matchLabels:app: webstrategy:rollingUpdate:maxSurge: 25%maxUnavailable: 25%type: RollingUpdatetemplate:metadata:creationTimestamp: nulllabels:app: webspec:containers:- image: nginx:1.17imagePullPolicy: Alwaysname: nginxresources: {}terminationMessagePath: /dev/termination-logterminationMessagePolicy: FilevolumeMounts:- name: datamountPath: /usr/share/nginx/htmldnsPolicy: ClusterFirstrestartPolicy: AlwaysschedulerName: default-schedulersecurityContext: {}terminationGracePeriodSeconds: 30volumes:- name: dataemptyDir: {}
status:availableReplicas: 1conditions:- lastTransitionTime: "2023-08-12T07:51:46Z"lastUpdateTime: "2023-08-12T07:51:46Z"message: ReplicaSet "web-7675fc7857" has successfully progressed.reason: NewReplicaSetAvailablestatus: "True"type: Progressing- lastTransitionTime: "2023-08-19T06:04:37Z"lastUpdateTime: "2023-08-19T06:04:37Z"message: Deployment has minimum availability.reason: MinimumReplicasAvailablestatus: "True"type: AvailableobservedGeneration: 1readyReplicas: 1replicas: 1updatedReplicas: 1

http://www.lryc.cn/news/131094.html

相关文章:

  • 类之间的比较
  • 设计模式之备忘录模式(Memento)的C++实现
  • 学习笔记230804---restful风格的接口,delete的传参方式问题
  • STM32使用IIC通信的引脚配置问题
  • 题解 | #K.First Last# 2023牛客暑期多校10
  • Python 程序设计入门(025)—— 使用 os 模块操作文件与目录
  • excel逻辑函数篇1
  • 前端基础(Vue的模块化开发)
  • SystemVerilog interface使用说明
  • 机器人制作开源方案 | 送餐机器人
  • Gradio部署应用到服务器不能正常访问
  • 数据暴涨时代,该如何数据治理?_光点科技
  • 2021年03月 C/C++(三级)真题解析#中国电子学会#全国青少年软件编程等级考试
  • GPT-5出世?OpenAI GPT-5商标已注册
  • 优雅的使用 Dockerfile 定制镜像
  • limit的用法mysql
  • clickhouse Checksum doesn‘t match: 问题修复
  • 企业如何开展个人信息安全影响评估(PIA)二
  • android TextView 超出长度使用省略号
  • c++ | 字节转换 | 字长 | 机器位数
  • 7-4 交换最小值和最大值
  • 解决Pycharm的Settings中Project不见了也无法选择Python Interpreter的方法
  • AWS EKS 集群自动扩容 Cluster Autoscaler
  • excel中有哪些通配符、excel配置问题,数学函数篇1之sum系列
  • 工控行业需要熟悉的工业级通信协议
  • 力扣题解(1030. 距离顺序排列矩阵单元格),带注释
  • 每天一道leetcode:剑指 Offer 34. 二叉树中和为某一值的路径(中等图论深度优先遍历递归)
  • 利用POM完成脚本分离实现企业级自动化(POM设计模式+页面的框架封装+测试报告截图)
  • 嵌入式设计中对于只有两种状态的变量存储设计,如何高效的对循迹小车进行偏差量化
  • day53 第九章 动态规划part14● 1143.最长公共子序列 ● 1035.不相交的线 ● 53. 最大子序和 动态规划