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

k8s里pv pvc configmap

通过storageClassName 将PV 和PVC 关联起来。

[root@k8-master home]# cat /home/npm-pvc.yaml 
kind: PersistentVolumeClaim
apiVersion: v1
metadata:name: npm-repository-pvcnamespace: jenkins
spec:accessModes:- ReadWriteManyresources:requests:storage: 50GistorageClassName: npm-repository-pv
[root@k8-master yaml]# cat  /home/npm-pv.yaml 
apiVersion: v1
kind: PersistentVolume
metadata:name: npm-repository-pv
spec:capacity:storage: 50GiaccessModes:- ReadWriteManystorageClassName: "npm-repository-pv"nfs:server: 192.168.10.128path: /data/repository/npm
[root@k8-master yaml]# cat nginx-pv.yaml 
apiVersion: v1
kind: PersistentVolume
metadata:name: nginx-k8s-pv
spec:capacity:storage: 10GiaccessModes:- ReadWriteManystorageClassName: "nginx-k8s-pv"nfs:server: 192.168.10.128path: /data/volumes
[root@k8-master yaml]# cat nginx-pvc.yaml 
kind: PersistentVolumeClaim
apiVersion: v1
metadata:name: nginx-k8s-pvcnamespace: test
spec:resources:requests:storage: 10GiaccessModes:- ReadWriteManystorageClassName: "nginx-k8s-pv"
[root@k8-master yaml]# cat nginx.yaml 
apiVersion: apps/v1
kind: Deployment
metadata:name: nginx-deploynamespace: test
spec:selector:                                    matchLabels:                                app: nginx                                replicas: 1                                  template:                                    metadata:                                   labels:                                   app : nginx                          spec:                                     containers:- image: nginx:1.21name: nginxports: - containerPort: 80 protocol: TCP volumeMounts: - name: nfs-volumes mountPath: /usr/share/nginx/html- name: nginx-configmountPath: /etc/nginx/nginx.confsubPath: nginx.confvolumes: - name: nfs-volumespersistentVolumeClaim:claimName: nginx-k8s-pvc - name: nginx-config configMap:name: nginx-configitems:- key: nginx.confpath: nginx.conf       
http://www.lryc.cn/news/151774.html

相关文章:

  • 【Atcoder】 [ARC144D] AND OR Equation
  • python使用字典暴力解析wifi密码
  • java八股文面试[多线程]——synchronized锁升级详细流程
  • ui网页设计实训心得
  • 论文阅读_扩散模型_DDPM
  • 菜鸟教程《Python 3 教程》笔记(15):数据结构
  • CH05_介绍重构名录
  • 1、Nginx 简介
  • C++之——宏
  • 代码随想录打卡—day56—【编辑距离】— 9.2 编辑距离系列
  • uni-app app端.m3u8类型流的播放
  • 使用proxy_pool来为爬虫程序自动更换代理IP | 开源IP代理
  • 【易售小程序项目】修改“我的”界面前端实现;查看、重新编辑、下架自己发布的商品【后端基于若依管理系统开发】
  • Centos7 + Apache Ranger 2.4.0 部署
  • 硬件SPI口扩展
  • 【jsthree.js】全景vr看房进阶版
  • 实战:基于卷积的MNIST手写体分类
  • Ubuntu开启生成Core Dump的方法
  • git视频教程Jenkins持续集成视频教程Git Gitlab Sonar教程
  • 机器学习:Xgboost
  • 《Kubernetes部署篇:Ubuntu20.04基于二进制安装安装cri-containerd-cni》
  • [CISCN 2019初赛]Love Math
  • 运行命令出现错误 /bin/bash^M: bad interpreter: No such file or directory
  • 码农重装系统后需要安装的软件
  • Kotlin return 和 loop jump
  • 计算一组数据中的低中位数即如果一组数据中有两个中位数则较小的那个为低中位数statistics.median_low()
  • ChatGPT是否能够协助人们提高公共服务和社区建设能力?
  • 机器人中的数值优化(七)——修正阻尼牛顿法
  • 程序员自由创业周记#3:No1.作品
  • 固定资产制度怎么完善管理?