aws EKS EFS storageclass PV PVC Pod
storageclass
[root@localhost specs]# cat storageclass.yaml
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: efs-sc
provisioner: efs.csi.aws.com
PV
[root@localhost specs]# cat pv.yaml
apiVersion: v1
kind: PersistentVolume
metadata:
name: efs-pv
spec:
capacity:
storage: 5Gi
volumeMode: Filesystem
accessModes:
- ReadWriteMany
persistentVolumeReclaimPolicy: Retain
storageClassName: efs-sc
csi:
driver: efs.csi.aws.com
volumeHandle: fs-b92aae74
PVC
[root@localhost specs]# cat claim.yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: efs-claim
spec:
accessModes:
- ReadWriteMany
storageClassName: efs-sc
resources:
requests:
storage: 5Gi
Pod
[root@localhost specs]# cat pod1.yaml
apiVersion: v1
kind: Pod
metadata:
name: app1
spec:
containers:
- name: app1
image: busybox
command: ["/bin/sh"]
args: ["-c", "while true; do echo $(date -u) >> /data/out1.txt; sleep 5; done"]
volumeMounts:
- name: persistent-storage
mountPath: /data
volumes:
- name: persistent-storage
persistentVolumeClaim:
claimName: efs-claim
在有多个PV的情况下,在PV中添加labels,之后在PVC中通过matchLabels来强力绑定
如
PV 中
metadata:
name: efs-nginx-pv
labels:
app: nginx
PVC中
selector:
matchLabels:
app: nginx
aws EKS EFS storageclass PV PVC Pod的更多相关文章
- aws EKS EFS 上安装mysql Operation notpermitted
在AWS EKS k8s.EFS nfs.mysql.changing ownership of '/var/lib/mysql/': Operation notpermitted 在aws eks ...
- aws eks ebs StorageClass PersistentVolume PersistentVolumeClaim
aws EBS 提供存储资源 Amazon EBS CSI 驱动程序的安装,请参考https://docs.aws.amazon.com/zh_cn/eks/latest/userguide/ebs- ...
- [Kubernetes]PV,PVC,StorageClass之间的关系详解
在Kubernetes中,容器化一个应用比较麻烦的地方莫过于对其"状态"的管理,而最常见的"状态",莫过于存储状态. 在[Kubernetes]深入理解Stat ...
- k8s存储 pv pvc ,storageclass
1. pv pvc 现在测试 glusterfs nfs 可读可写, 多个pod绑定到同一个pvc上,可读可写. 2. storageclass 分成两种 (1) 建立pvc, 相当于多个 ...
- Kubernetes Pv & Pvc
Kubernetes PV & pvc 介绍 PersistentVolume(pv)和PersistentVolumeClaim(pvc)是k8s提供的两种API资源,用于抽象存储细节.管理 ...
- k8s的持久化存储PV&&PVC
1.PV和PVC的引入 Volume 提供了非常好的数据持久化方案,不过在可管理性上还有不足. 拿前面 AWS EBS 的例子来说,要使用 Volume,Pod 必须事先知道如下信息: 当前 Volu ...
- kubernetes Value:将磁盘挂载到容器,PV,PVC
6.1.介绍卷 6.1.1.卷的类型 emptyDir-用于存储临时数据的简单空目录 hostPath-用于将目录从工作节点的文件系统挂载到pod nfs-挂载到pod中的NFS共享卷. 还有其他的如 ...
- Kubernetes 存储卷管理 PV&PVC(十)
目录 一.emptyDir 二.hostPath 三.PV & PVC 1.NFS PersistentVolume 2.创建 PVC 3.创建 Pod 进行挂载 为了持久化保存容器的数据,可 ...
- K8S系列第九篇(持久化存储,emptyDir、hostPath、PV/PVC)
更多k8s内容,请关注威信公众好:新猿技术生态圈 一.数据持久化 Pod是由容器组成的,而容器宕机或停止之后,数据就随之丢了,那么这也就意味着我们在做Kubernetes集群的时候就不得不考虑存储的问 ...
随机推荐
- 微信小程序:小程序中使用Less
配置: 首选项 -> 设置 -> 用户 -> 扩展 (找到EasyLess插件,编辑setting.json文件进行配置) 点击vscode左下角的à设置à点击右上角的à添加以上代码 ...
- Python分类模型构建
分离训练集测试集 from sklearn.model_selection import train_test_split eg: X_train, X_test, y_train, y_test = ...
- cocos2dx创建工程
p.p1 { margin: 0; font: 17px "Helvetica Neue"; color: rgba(69, 69, 69, 1) } 官网镇楼: http://w ...
- 1.3.1 apache的配置(上)
Apache是比较常用的web服务器软件,用来解析HTTP网页.这里需注意,apache本身并不能解析php页面,它是用来配置解析http页面的.当然,作为一款最流行的web服务器软件,apache支 ...
- 力扣896. 单调数列-C语言实现-简单题
题目 传送门 文本 如果数组是单调递增或单调递减的,那么它是单调的. 如果对于所有 i <= j,A[i] <= A[j],那么数组 A 是单调递增的. 如果对于所有 i <= j, ...
- Rocket broker启动失败?
安装 Rocket 时, 执行 nohup sh bin/mqbroker -n localhost:9876 & 启动 broker 失败 更改其内存试试 在下面目录下 : cd distr ...
- 后端程序员之路 57、go json
go自带json处理库,位于encoding/json,里面的test很具参考意义,特别是example_test.go json - The Go Programming Languagehttps ...
- Layui 源码浅读(模块加载原理)
经典开场 // Layui ;! function (win) { var Lay = function () { this.v = '2.5.5'; }; win.layui = new Lay() ...
- springboot的4种属性注入
1.Autowired注入 2.构造方法注入 3.@Bean方法形参注入 4.直接在@Bean方法上使用注解@ConfigurationProperties(prefix="jdbc&quo ...
- java 给时间增加时间得到一个新的时间(日期)
SimpleDateFormat df=new SimpleDateFormat("yyyy-MM-dd") LocalDate expirationDate String exp ...