Skip to content

Commit

Permalink
Allow configuration of PVC size from ConfigMap
Browse files Browse the repository at this point in the history
PVCs are hardcoded to 5Gi and that should be configurable.
For instance Alibaba Container Service does not allow volumes smaller than 20Gi

Add a `config-artifact-pvc` ConfigMap that can be used to store such configuration

Signed-off-by: Carlos Sanchez <[email protected]>
  • Loading branch information
carlossg committed May 20, 2019
1 parent c7c7385 commit bc90267
Show file tree
Hide file tree
Showing 6 changed files with 206 additions and 85 deletions.
23 changes: 23 additions & 0 deletions config/config-artifact-pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2018 The Knative Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: v1
kind: ConfigMap
metadata:
name: config-artifact-pvc
namespace: tekton-pipelines
data:
# size of the PVC volume
# size: 5Gi

9 changes: 7 additions & 2 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,13 @@ Pipelines need a way to share resources between tasks. The alternatives are a
[Persistent volume](https://kubernetes.io/docs/concepts/storage/persistent-volumes/)
or a [GCS storage bucket](https://cloud.google.com/storage/)
The PVC option does not require any configuration, but the GCS storage bucket
can be configured using a ConfigMap with the name `config-artifact-bucket` with
The PVC option can be configured using a ConfigMap with the name
`config-artifact-pvc` and the following attributes:
- size: the size of the volume (5Gi by default)
The GCS storage bucket can be configured
using a ConfigMap with the name `config-artifact-bucket` with
the following attributes:
- location: the address of the bucket (for example gs://mybucket)
Expand Down
3 changes: 2 additions & 1 deletion pkg/apis/pipeline/v1alpha1/artifact_pvc.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ var (
// ArtifactPVC represents the pvc created by the pipelinerun
// for artifacts temporary storage
type ArtifactPVC struct {
Name string
Name string
PersistentVolumeClaim *corev1.PersistentVolumeClaim
}

// GetType returns the type of the artifact storage
Expand Down
39 changes: 24 additions & 15 deletions pkg/apis/pipeline/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit bc90267

Please sign in to comment.