@@ -12,11 +12,12 @@ reviewers:
1212 - "@otaviof "
1313 - "@HeavyWombat "
1414 - "@imjasonh "
15+ - "@alicerum "
1516approvers:
1617 - "@sbose78 "
1718 - "@SaschaSchwarze0 "
1819creation-date: 2021-08-18
19- last-updated: 2021-10-19
20+ last-updated: 2022-04-07
2021status: implementable
2122see-also: [ ]
2223replaces: [ ]
@@ -100,7 +101,7 @@ If a `BuildRun` references a volume that does not exist (either directly or in i
100101#### Deprecate Implicit emptyDir Volumes
101102
102103Shipwright currently creates an implicit ` emtpyDir ` volume if one or more build steps declare a volume mount.
103- This behavior should be deprecated as a prerequsite to releasing this feature.
104+ This behavior should be deprecated as a prerequisite to releasing this feature.
104105Implicit emptyDir volumes can then be removed when this feature is released.
105106
106107#### Strategy Volumes API
@@ -114,7 +115,7 @@ spec:
114115 buildSteps :
115116 - name : build
116117 image : quay.io/my-org/my-builder:latest
117- volumeMounts :
118+ volumeMounts : # Existing k8s container volume mounts
118119 - name : build-metadata
119120 mountPath : /home/build/metadata
120121 - name : image-cache
@@ -123,23 +124,19 @@ spec:
123124 mountPath : /path/for/artifact/credentials.xml
124125 readOnly : true
125126 volumes :
126- - name : build-metadata
127- description : " Build metadata"
128- optional : true
129- volumeSource :
130- type : EmptyDir # Type discriminator, this wil let us support new volume sources over time.
127+ - name : build-metadata # Name of the volume. Required, must be unique
128+ description : " Build metadata" # Description of the volume. Optional
129+ volumeSource : # Volume source specification - inherited from k8s VolumeSource API
131130 emptyDir : {}
132131 - name : image-cache
133- description : " Container image cache"
132+ description : " Container image cache"
133+ overridable : true # If true, the volume source can be changed in a Build or BuildRun. Optional
134134 volumeSource :
135- overridable : true # indicates the volume source can be different in a Build or BuildRun
136- type : EmptyDir
137135 emptyDir : {}
138136 - name : artifact-creds
139137 description : " Private artifact repository credentials"
138+ overridable : true
140139 volumeSource :
141- overridable : true
142- type : EmptyDir
143140 emptyDir : {}
144141` ` `
145142
@@ -154,12 +151,10 @@ spec:
154151 volumes:
155152 - name: image-cache
156153 volumeSource:
157- type: PersistentVolumeClaim # When overriding, the type can be changed
158154 persistentVolumeClaim:
159155 name: pvc-image-cache
160156 - name: artifact-creds
161157 volumeSource:
162- type: Secret
163158 secret:
164159 secretName: artifact-creds # Inherited from Kubernetes VolumeSource API
165160` ` `
@@ -202,9 +197,8 @@ spec:
202197 ...
203198 volumes:
204199 - name: var-lib-containers
200+ overridable: true
205201 volumeSource:
206- overridable: true
207- type: EmptyDir
208202 emtpyDir: {}
209203` ` `
210204
@@ -224,7 +218,6 @@ spec:
224218 volumes:
225219 - name: var-lib-containers
226220 volumeSource:
227- type: PersistentVolumeClaim
228221 persistentVolumeClaim:
229222 name: shipwright-build-cache
230223` ` `
@@ -238,7 +231,7 @@ Testing will ensure that basic scenarios are covered:
238231
2392321. Volume mounting Secrets and ConfigMaps
2402332. Volume mounting Persistent Volumes
241- 3. Verifying BuildRuns succeed or fail of the `overridible ` attribute is set to true/false.
234+ 3. Verifying BuildRuns succeed or fail of the `overridable ` attribute is set to true/false.
242235
243236# ## Release Criteria
244237
@@ -257,6 +250,10 @@ Security is a concern with volumes, especially if arbitrary `HostPath` volume mo
257250The [Pod Security Admission plugin](https://kubernetes.io/docs/concepts/security/pod-security-admission/)
258251is a means to mitigate this issue, as it allows risky volume mounts to be blocked per namespace.
259252Shipwright builds should document how this admission plugin and the volumes feature interact.
253+ This plugin graduated to beta in Kubernetes 1.23 (enabled by default).
254+
255+ If a TaskRun cannot create a Pod because the volume mount is denied, the `BuildRun` should report
256+ the failure reason in its status.
260257
261258# # Drawbacks
262259
@@ -302,3 +299,4 @@ No new infrastructure.
302299
3033002021-08-18 : Provisional SHIP proposal
3043012021-10-19 : Updated to implementable
302+ 2022-04-07 : Remove the `optional` and `type` fields in the API
0 commit comments