Repository navigation
Description
In what area(s)?
/kind spec
/kind proposal
Current problem
Knative resolves image tag to digest, but the revision has the image digest in status field, not spec. Because of that, if the image is updated and revision is reconciled, the image digest in revision is also updated. Hence, the deployment (application code) is not always immutable against the revision. Because of that, if the image is updated and revision is restored from the backup, the image digest in revision is also updated. Hence, the deployment (application code) is not always immutable against the revision
Scenario of current problem
1. Build&Push the image
docker push gcr.io/foo/helloworld
2. Deploy KSvc with the image
(in the revision)
spec:
containers:
- image: gcr.io/foo/helloworld-go
status:
imageDigest: gcr.io/foo/helloworld-go@sha256:5ea96ba4b872685ff4ddb5cd8d1a97ec18c18fae79ee8df0d29f446c5efe5f50
(in the deployment)
image: gcr.io/foo/helloworld-go@sha256:5ea96ba4b872685ff4ddb5cd8d1a97ec18c18fae79ee8df0d29f446c5efe5f50
3. Update the application e.g (PORT env value is mandatory now)
port, found := os.LookupEnv("PORT")
if !found {
panic("You did not set PORT env")
}
4. push the image (to same tag)
docker push gcr.io/foo/helloworld
5. Let revision be reconciled
kubectl delete rev --all
6. imageDigest in revisions is updated
(in the revision)
spec:
containers:
- image: gcr.io/foo/helloworld-go
status:
imageDigest: gcr.io/foo/helloworld-go@sha256:277edb551883591edf75385788449886eb0addb5246a60082802c42faaab3847
(in the deployment)
image: gcr.io/foo/helloworld-go@sha256:277edb551883591edf75385788449886eb0addb5246a60082802c42faaab3847
Now, the revisions is spoiled due to missing env value.
Describe the feature/expectation
- We expect the revisions use the application code when created.
- According to the specification docs, the revision is
snapshot-in-time of application code
The Knative Revision represents a stateless, autoscaling snapshot-in-time of application code and configuration.
- Note, if the revision is not reconciled, it still uses old image digest as expected. (But it is fragile.)
Proposal
The image digest should be set in Revision's spec field instead of status.
Activity
knative-prow-robot commentedon Oct 17, 2019
@nak3: The label(s)
kind/proposalcannot be applied. These labels are supported: ``Details
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
knative-prow-robot commentedon Oct 17, 2019
@nak3: The label(s)
kind/proposalcannot be applied. These labels are supported: ``Details
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
savitaashture commentedon Oct 18, 2019
/assign
vagababov commentedon Oct 18, 2019
@savitaashture I think this might require a pass/talk at the WG meeting first.
/cc @dgerd
savitaashture commentedon Nov 11, 2019
@dgerd can we discuss about this in the coming WG meeting?
markusthoemmes commentedon Nov 11, 2019
I'm not quite parsing the issue here. You're removing the revision and thus all information about the digest we picked at that point in time. Our code will generate a new revision. You're proposing that creating that new revision should have the same contents as the revision you just deleted?
As you mentioned, revisions are an immutable snapshot. If you're removing that snapshot though, I don't see how we'd easily regenerate the state you lost by deleting it in the first place. Can you elaborate on that?
nak3 commentedon Nov 11, 2019
Yes, you are correct. My steps-5 above
It actually re-generated the revision. So, my report was asking like
creating that new revision should have the same contents as the revision you just deletedwhich is not possible for immutable revision.With said, I still wanted to know if the image digest in status field is appropriate or not as I originally proposed:
For example, if we wanted to take the backup of Knative Service, we need the backup including Revision's status field. Is that something users need to care? (I think that some users stripped out with the status information when taking the backup.)
markusthoemmes commentedon Nov 11, 2019
@nak3 yeah I suppose we could stick the digest into the container of the spec directly. Not sure why we're not doing this currently 🤔
knative-housekeeping-robot commentedon Feb 9, 2020
Issues go stale after 90 days of inactivity.
Mark the issue as fresh by adding the comment
/remove-lifecycle stale.Stale issues rot after an additional 30 days of inactivity and eventually close.
If this issue is safe to close now please do so by adding the comment
/close.Send feedback to Knative Productivity Slack channel or file an issue in knative/test-infra.
/lifecycle stale
knative-housekeeping-robot commentedon Mar 11, 2020
Stale issues rot after 30 days of inactivity.
Mark the issue as fresh by adding the comment
/remove-lifecycle rotten.Rotten issues close after an additional 30 days of inactivity.
If this issue is safe to close now please do so by adding the comment
/close.Send feedback to Knative Productivity Slack channel or file an issue in knative/test-infra.
/lifecycle rotten
knative-housekeeping-robot commentedon Apr 10, 2020
Rotten issues close after 30 days of inactivity.
Reopen the issue with
/reopen.Mark the issue as fresh by adding the comment
/remove-lifecycle rotten.Send feedback to Knative Productivity Slack channel or file an issue in knative/test-infra.
/close
knative-prow-robot commentedon Apr 10, 2020
@knative-housekeeping-robot: Closing this issue.
Details
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.