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

独立网站建设步骤产品网络推广方案

独立网站建设步骤,产品网络推广方案,高中文凭能学做网站吗,青海wap网站建设kubernetes资源——pv/pvc持久卷 一、volume数据卷1、hostPath2、挂载nfs实现持久化 二、pv/pvc 持久卷/持久卷声明1、pv/pvc介绍2、pv/pvc的使用流程2.1 创建pv2.2 创建pvc2.3 创建pod,使用pv做持久化 一、volume数据卷 用于pod中的数据的持久化存储 支持很多的卷…

kubernetes资源——pv/pvc持久卷

  • 一、volume数据卷
    • 1、hostPath
    • 2、挂载nfs实现持久化
  • 二、pv/pvc 持久卷/持久卷声明
    • 1、pv/pvc介绍
    • 2、pv/pvc的使用流程
      • 2.1 创建pv
      • 2.2 创建pvc
      • 2.3 创建pod,使用pv做持久化

一、volume数据卷

用于pod中的数据的持久化存储
支持很多的卷类型, 例如EmptyDir、hostPath、NAS、SAN、CEPH

1、hostPath

挂载物理机上的目录做持久化

apiVersion: apps/v1
kind: Deployment
metadata:name: test1-hostpath
spec:replicas: 1selector:matchLabels:app: hostpathtemplate:metadata:labels:app: hostpathspec:containers:- name: test1-hostpathimage: centos:7imagePullPolicy: IfNotPresentcommand:- sleep- "3600"volumeMounts:													// 挂载卷- name: test1-volumemountPath: /test1volumes:																	// 创建卷,名称为test1-volume, 类型为hostpath- name: test1-volumehostPath:path: /test/data
[root@k8s-master ~]# kubectl get pod -o wide
NAME                              READY   STATUS    RESTARTS   AGE    IP              NODE                   NOMINATED NODE   READINESS GATES
test1-hostpath-584f599fcf-wzt2q   1/1     Running   0          117s   10.88.201.193   k8s-node01.linux.com   <none>           <none>
[root@k8s-master ~]# 
[root@k8s-master ~]# kubectl exec -ti test1-hostpath-584f599fcf-wzt2q bash
kubectl exec [POD] [COMMAND] is DEPRECATED and will be removed in a future version. Use kubectl exec [POD] -- [COMMAND] instead.
[root@test1-hostpath-584f599fcf-wzt2q /]# 
[root@test1-hostpath-584f599fcf-wzt2q /]# touch /test1/{1..10}
[root@test1-hostpath-584f599fcf-wzt2q /]# ls /test1/
1  10  2  3  4  5  6  7  8  9
[root@test1-hostpath-584f599fcf-wzt2q /]# 
[root@test1-hostpath-584f599fcf-wzt2q /]# exit
exit

2、挂载nfs实现持久化

apiVersion: apps/v1
kind: Deployment
metadata:name: test2-pod-nfs
spec:replicas: 1selector:matchLabels:app: nfstemplate:metadata:labels:app: nfsspec:containers:- name: test2-pod-nfsimage: centos:7imagePullPolicy: IfNotPresentcommand:- sleep- "3600"volumeMounts:- name: test2-nfs-volumemountPath: /test2volumes:- name: test2-nfs-volumenfs:server: "192.168.140.13"path: "/test2"

二、pv/pvc 持久卷/持久卷声明

1、pv/pvc介绍

pv, 持久卷,后端真实存储空间的映射
pvc, 持久卷声明,使用存储的申请

使用流程:
1、创建pv,描述后端真实的存储空间
2、创建pvc,描述使用存储的申请
3、创建pod,挂载pvc使用存储

2、pv/pvc的使用流程

2.1 创建pv

apiVersion: v1
kind: PersistentVolume
metadata:name: pv-2g
spec:capacity:storage: 2GaccessModes:- ReadWriteManypersistentVolumeReclaimPolicy: Recyclenfs:server: "192.168.140.13"path: "/test6"
apiVersion: v1
kind: PersistentVolume
metadata:name: pv-3g
spec:capacity:storage: 3GaccessModes:- ReadWriteOncepersistentVolumeReclaimPolicy: Recyclenfs:server: "192.168.140.13"path: "/test7"

accessModes:用于指定PV的访问模式,共有四种

  • ReadWriteOnce
    被单个节点以读写模式挂载

  • ReadWriteMany
    被多个节点以读写模式挂载

  • ReadOnlyMany
    被多个节点以只读模式挂载

  • ReadOnlyOnce, k8s 1.29
    被单节点以只读模式挂载

persistentVolumeReclaimPolicy:
指定回收模式是自动回收,当空间被释放时,K8S自动清理,然后可以继续绑定使用

[root@k8s-master pvTest]# kubectl get pv
NAME    CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS      CLAIM   STORAGECLASS   VOLUMEATTRIBUTESCLASS   REASON   AGE
pv-2g   2G         RWX            Recycle          Available                          <unset>                          2m26s
pv-3g   3G         RWO            Recycle          Available                          <unset>                          46s

2.2 创建pvc

apiVersion: v1
kind: PersistentVolumeClaim
metadata:name: pvc-1g
spec:accessModes:- ReadWriteManyresources:requests:storage: 1G
[root@k8s-master pvTest]# kubectl get pvc
NAME     STATUS   VOLUME   CAPACITY   ACCESS MODES   STORAGECLASS   VOLUMEATTRIBUTESCLASS   AGE
pvc-1g   Bound    pv-2g    2G         RWX                           <unset>                 10s```bash
[root@k8s-master pvTest]# kubectl get pv
NAME    CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS      CLAIM            STORAGECLASS   VOLUMEATTRIBUTESCLASS   REASON   AGE
pv-2g   2G         RWX            Recycle          Bound       default/pvc-1g                  <unset>                          10m
pv-3g   3G         RWO            Recycle          Available                                   <unset>                          8m34s

2.3 创建pod,使用pv做持久化

apiVersion: apps/v1
kind: Deployment
metadata:name: test1-pod
spec:replicas: 1selector:matchLabels:app: pvtemplate:metadata:labels:app: pvspec:containers:- name: test1-podimage: centos:7imagePullPolicy: IfNotPresentcommand:- sleep- "3600"volumeMounts:- name: test1-pod-pv-volumemountPath: /test1volumes:- name: test1-pod-pv-volumepersistentVolumeClaim:														// 通过关联pvc创建数据卷claimName: pvc-1g
http://www.hkea.cn/news/872801/

相关文章:

  • 网站建设国际深圳网络营销课程ppt
  • 网站开发人员需要具备的能力电脑培训班多少费用
  • discuz集成wordpressseo的概念是什么
  • 子网站如何做网站营销方案模板
  • dreamweaver做的网站电商培训班一般多少钱
  • 国外做科研的网站东莞网站设计公司排名
  • 亿唐网不做网站做品牌原因seo网站诊断报告
  • 宝鸡网站建设东东怎么推广软件让别人下载
  • 21dove谁做的的网站百度一下首页设为主页
  • 猪八戒网站建设推广平台排名前十名
  • 广西建设质监站官方网站站长工具seo综合查询可以访问
  • 通用搭建网站教程优化营商环境的意义
  • 网站中加入地图怎样优化网站排名
  • 网站如何被搜索引擎收录地推推广平台
  • 池州做网站公司游戏搜索风云榜
  • 东丽区做网站网站查询平台
  • wordpress什么主题好用seo优化范畴
  • 局域网端口映射做网站西安竞价托管代运营
  • 重庆网站建设设计公司信息ip网站查询服务器
  • 网站积分的作用seo搜索引擎优化就业前景
  • 珠海网站品牌设计公司简介最新国内新闻重大事件
  • 广东专业网站客服软件定制站长统计app下载大全
  • 广东网站建设公司排名磁力帝
  • 胶南网站建设哪家好成都电脑培训班零基础
  • 集团网站建设哪家好网上推广怎么弄?
  • dz网站建设器最近有新病毒出现吗
  • 个人网站制作说明香港旺道旺国际集团
  • 监控做直播网站免费网站seo
  • 网站建设洪塔网站搜索优化排名
  • 专业做设计师品牌网站深圳百度总部