2024 CKA 题库 | 10、创建 PV

不等更新题库

10、创建 PV

题目:

设置配置环境:
[candidate@node-1] $ kubectl config use-context hk8s

Task
创建名为 app-config 的 persistent volume,容量为 1Gi,访问模式为  ReadWriteMany。 volume 类型为  hostPath,位于 /srv/app-config

考点:

hostPath 类型的 pv

参考链接:

依次点击 Tasks → Configure Pods and Containers → Configure a Pod to Use a PersistentVolume for Storage (看不懂英文的,可右上角翻译成中文)
https://kubernetes.io/zh-cn/docs/tasks/configure-pod-container/configure-persistent-volume-storage/

解答:

更换 context
$ kubectl config use-context hk8s
创建 pv yaml
# 复制官网模版, 修改
$ cat 10.pv.yaml
apiVersion: v1
kind: PersistentVolume
metadata:
  name: app-config  # 名
  labels:
    type: local
spec:
  # storageClassName: manual  题目没指定
  capacity:
    storage: 1Gi  # 容量
  accessModes:
    - ReadWriteMany  # 读写权限
  hostPath:
    path: "/srv/app-config"  # 题目有指定
创建 pv
$ kubectl create -f 10.pv.yaml

检查

$ kubectl describe pv app-config

相关推荐

  1. 2024 CKA 题库 | 10创建 PV

    2024-01-16 15:20:02       55 阅读
  2. 2024 CKA 题库 | 15、备份还原 etcd

    2024-01-16 15:20:02       66 阅读
  3. 2024年最新 CKA 试题题库及答案详解 导航页

    2024-01-16 15:20:02       35 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-01-16 15:20:02       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-01-16 15:20:02       100 阅读
  3. 在Django里面运行非项目文件

    2024-01-16 15:20:02       82 阅读
  4. Python语言-面向对象

    2024-01-16 15:20:02       91 阅读

热门阅读

  1. Linux篇之Centos中将系统时间设置为本地时间

    2024-01-16 15:20:02       56 阅读
  2. 嵌入式工程师必须掌握的几种系统架构

    2024-01-16 15:20:02       51 阅读
  3. 【数据库原理】(29)数据库设计-需求分析阶段

    2024-01-16 15:20:02       57 阅读
  4. Golang 通道输入输出学习(同刚上手的小新手)

    2024-01-16 15:20:02       60 阅读
  5. 33、病隙随笔——浅聊脑机接口BCI

    2024-01-16 15:20:02       51 阅读
  6. 指针及其用法

    2024-01-16 15:20:02       53 阅读
  7. ffmpeg 实用命令 -- 截取视频

    2024-01-16 15:20:02       43 阅读