4.5. Specifying PersistentVolumeClaims as VolumeSource in Workspaces


Workspaces help Tasks share data, and allow you to specify one or more volumes that each Task in the Pipeline requires during execution.

In this section, you will create a PersistentVolumeClaim to provide data storage and bind it to the Workspace. This PersistentVolumeClaim provides the volumes or filesystem required for the Pipeline execution.

Procedure

  1. Copy and save the contents of the following sample PersistentVolumeClaim YAML file:

    apiVersion: v1
    kind: PersistentVolumeClaim
    metadata:
      name: source-pvc
    spec:
      accessModes:
        - ReadWriteOnce
      resources:
        requests:
          storage: 500Mi
  2. Create the PersistentVolumeClaim, specifying the file you just created:

    $ oc create -f <PersistentVolumeClaim-yaml-file-name.yaml>

    Alternatively, you can execute the YAML file directly from the Git repository:

    $ oc create -f https://raw.githubusercontent.com/openshift/pipelines-tutorial/release-tech-preview-2/01_pipeline/03_persistent_volume_claim.yaml
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.