Skip to content

Commit 9f2555c

Browse files
committed
ensure secret pulled images
Signed-off-by: Mike Brown <[email protected]>
1 parent 15f9cd4 commit 9f2555c

File tree

1 file changed

+169
-0
lines changed

1 file changed

+169
-0
lines changed
Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
---
2+
title: Ensure Secret Pulled Images
3+
authors:
4+
- "@mikebrow"
5+
owning-sig: sig-node
6+
participating-sigs:
7+
- sig-node
8+
reviewers:
9+
- "@Random-Liu"
10+
- "@yujuhong"
11+
approvers:
12+
- "@dchen1107"
13+
editor: N/A
14+
creation-date: 2020-03-10
15+
last-updated: 2020-03-10
16+
status: provisional|implementable|implemented|deferred|rejected|withdrawn|replaced
17+
see-also:
18+
- N/A
19+
replaces:
20+
- N/A
21+
superseded-by:
22+
- N/A
23+
---
24+
25+
# Ensure Secret Pulled Images
26+
27+
## Table of Contents
28+
29+
<!-- toc -->
30+
- [Release Signoff Checklist](#release-signoff-checklist)
31+
- [Summary](#summary)
32+
- [Motivation](#motivation)
33+
- [Goals](#goals)
34+
- [Non-Goals](#non-goals)
35+
- [Proposal](#proposal)
36+
- [User Stories](#user-stories)
37+
- [Risks and Mitigations](#risks-and-mitigations)
38+
- [Design Details](#design-details)
39+
- [Test Plan](#test-plan)
40+
- [Graduation Criteria](#graduation-criteria)
41+
- [Examples](#examples)
42+
- [Alpha -&gt; Beta Graduation](#alpha---beta-graduation)
43+
- [Beta -&gt; GA Graduation](#beta---ga-graduation)
44+
- [Implementation History](#implementation-history)
45+
- [Drawbacks [optional]](#drawbacks-optional)
46+
- [Alternatives [optional]](#alternatives-optional)
47+
- [Infrastructure Needed [optional]](#infrastructure-needed-optional)
48+
<!-- /toc -->
49+
50+
## Release Signoff Checklist
51+
52+
- [ ] kubernetes/enhancements issue in release milestone, which links to KEP (this should be a link to the KEP location in kubernetes/enhancements, not the initial KEP PR)
53+
- [ ] KEP approvers have set the KEP status to `implementable`
54+
- [ ] Design details are appropriately documented
55+
- [ ] Test plan is in place, giving consideration to SIG Architecture and SIG Testing input
56+
- [ ] Graduation criteria is in place
57+
- [ ] "Implementation History" section is up-to-date for milestone
58+
- [ ] User-facing documentation has been created in [kubernetes/website], for publication to [kubernetes.io]
59+
- [ ] Supporting documentation e.g., additional design documents, links to mailing list discussions/SIG meetings, relevant PRs/issues, release notes
60+
61+
## Summary
62+
63+
We will add support for ensuring images pulled with pod imagePullSecrets are
64+
always authenticated even if cached. We will add a new boolean field
65+
`ensureSecretPulledImages` to the pod spec. The default to false
66+
means that if a first pod results in an image pulled with imagePullSecrets a
67+
second pod would have to be using always pull to ensure rights to use the
68+
previously pulled image. When set to true always pull would not be required,
69+
instead kublet will check if the image was pulled with an image pull secret and
70+
if so would force a pull of the image to ensure the image pulled with the
71+
secret is not used by another pod unless that pod also has the proper auth.
72+
73+
## Motivation
74+
75+
There have been customer requests for improving upon kubernetes ability to
76+
secure images pulled with auth. on a node. Issue
77+
[#18787](https://github.com/kubernetes/kubernetes/issues/18787) has been around
78+
for a while.
79+
80+
To secure images one currently needs to inject `AllwaysPullImages` into pod
81+
specs via an admission plugin. As @liggitt [notes](https://github.com/kubernetes/kubernetes/issues/18787#issuecomment-532280931)
82+
the `pull` does not re-pull already-pulled layers of the image, but simply
83+
resolves/verifies the image manifest has not changed in the registry (which
84+
incidentally requires authenticating to private registries, which enforces the
85+
image access). That means in the normal case (where the image has not changed
86+
since the last pull), the request size is O(kb). However, the `pull` does put
87+
the registry in the critical path of starting a container, since an unavailable
88+
registry will fail the pull image manifest check (with or without proper
89+
authentication.)
90+
91+
92+
### Goals
93+
94+
Add a flag processed by `kubelet` for `ensureSecretPulledImages` (or something
95+
similarly named) that, if true, would force `kubelet` to attempt to pull every
96+
image that was pulled with image pulled secret based authentication, regardless
97+
of the container image's pull policy.
98+
99+
Optimize to only force re-authentication for a pod when the secret used to pull
100+
the container image is not present.
101+
102+
### Non-Goals
103+
104+
Out of scope for this KEP is an image caching policy that would direct container
105+
runtimes through the CRI wrt. how they should treat the caching of images on a
106+
node. Such as store for public use but only if encrypted. Or Store for private
107+
use unencrypted...
108+
109+
## Proposal
110+
111+
When `ensureSecretPulledImages` is set, `kublet` will check keep a list of
112+
container images that required authentication. `kublet` will ensure any image
113+
in the list is always pulled thus enforcing authentication / re-authentication
114+
with the exception of pods with secrets containing an auth that has been
115+
authenticated.
116+
117+
### User Stories
118+
wip
119+
120+
### Risks and Mitigations
121+
122+
With the default being false, devops engineers may not know to set the flag to
123+
true in new/old pod specs that are using secrets for pull authentication with
124+
registries.
125+
126+
A mitigation would be an admission plugin to inject `ensureSecretPulledImages.`
127+
128+
Images authentications with a registry may expire. To mitigate expirations a
129+
a timeout could be used to force re-authentication.
130+
131+
## Design Details
132+
133+
### Test Plan
134+
135+
tbd
136+
137+
### Graduation Criteria
138+
139+
tbd
140+
141+
#### Examples
142+
143+
These are generalized examples to consider, in addition to the aforementioned [maturity levels][maturity-levels].
144+
145+
##### Alpha -> Beta Graduation
146+
147+
tbd
148+
149+
##### Beta -> GA Graduation
150+
151+
tbd
152+
153+
## Implementation History
154+
155+
tbd
156+
157+
## Drawbacks [optional]
158+
159+
Why should this KEP _not_ be implemented. N/A
160+
161+
## Alternatives [optional]
162+
163+
Default the ensure secrets rule to true and don't introduce a new pod spec flag.
164+
Instead of a pod spec flag make the option a kublet configuration switch or
165+
set the flag at some other scope.
166+
167+
## Infrastructure Needed [optional]
168+
169+
tbd

0 commit comments

Comments
 (0)