@@ -12,11 +12,12 @@ reviewers:
12
12
- "@otaviof "
13
13
- "@HeavyWombat "
14
14
- "@imjasonh "
15
+ - "@alicerum "
15
16
approvers:
16
17
- "@sbose78 "
17
18
- "@SaschaSchwarze0 "
18
19
creation-date: 2021-08-18
19
- last-updated: 2021-10-19
20
+ last-updated: 2022-04-07
20
21
status: implementable
21
22
see-also: [ ]
22
23
replaces: [ ]
@@ -100,7 +101,7 @@ If a `BuildRun` references a volume that does not exist (either directly or in i
100
101
#### Deprecate Implicit emptyDir Volumes
101
102
102
103
Shipwright 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.
104
105
Implicit emptyDir volumes can then be removed when this feature is released.
105
106
106
107
#### Strategy Volumes API
@@ -114,7 +115,7 @@ spec:
114
115
buildSteps :
115
116
- name : build
116
117
image : quay.io/my-org/my-builder:latest
117
- volumeMounts :
118
+ volumeMounts : # Existing k8s container volume mounts
118
119
- name : build-metadata
119
120
mountPath : /home/build/metadata
120
121
- name : image-cache
@@ -123,23 +124,19 @@ spec:
123
124
mountPath : /path/for/artifact/credentials.xml
124
125
readOnly : true
125
126
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
131
130
emptyDir : {}
132
131
- 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
134
134
volumeSource :
135
- overridable : true # indicates the volume source can be different in a Build or BuildRun
136
- type : EmptyDir
137
135
emptyDir : {}
138
136
- name : artifact-creds
139
137
description : " Private artifact repository credentials"
138
+ overridable : true
140
139
volumeSource :
141
- overridable : true
142
- type : EmptyDir
143
140
emptyDir : {}
144
141
` ` `
145
142
@@ -154,12 +151,10 @@ spec:
154
151
volumes:
155
152
- name: image-cache
156
153
volumeSource:
157
- type: PersistentVolumeClaim # When overriding, the type can be changed
158
154
persistentVolumeClaim:
159
155
name: pvc-image-cache
160
156
- name: artifact-creds
161
157
volumeSource:
162
- type: Secret
163
158
secret:
164
159
secretName: artifact-creds # Inherited from Kubernetes VolumeSource API
165
160
` ` `
@@ -202,9 +197,8 @@ spec:
202
197
...
203
198
volumes:
204
199
- name: var-lib-containers
200
+ overridable: true
205
201
volumeSource:
206
- overridable: true
207
- type: EmptyDir
208
202
emtpyDir: {}
209
203
` ` `
210
204
@@ -224,7 +218,6 @@ spec:
224
218
volumes:
225
219
- name: var-lib-containers
226
220
volumeSource:
227
- type: PersistentVolumeClaim
228
221
persistentVolumeClaim:
229
222
name: shipwright-build-cache
230
223
` ` `
@@ -238,7 +231,7 @@ Testing will ensure that basic scenarios are covered:
238
231
239
232
1. Volume mounting Secrets and ConfigMaps
240
233
2. 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.
242
235
243
236
# ## Release Criteria
244
237
@@ -257,6 +250,10 @@ Security is a concern with volumes, especially if arbitrary `HostPath` volume mo
257
250
The [Pod Security Admission plugin](https://kubernetes.io/docs/concepts/security/pod-security-admission/)
258
251
is a means to mitigate this issue, as it allows risky volume mounts to be blocked per namespace.
259
252
Shipwright 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.
260
257
261
258
# # Drawbacks
262
259
@@ -302,3 +299,4 @@ No new infrastructure.
302
299
303
300
2021-08-18 : Provisional SHIP proposal
304
301
2021-10-19 : Updated to implementable
302
+ 2022-04-07 : Remove the `optional` and `type` fields in the API
0 commit comments