Skip to content
This repository has been archived by the owner on Jun 4, 2021. It is now read-only.

Kafka source image policy #303

Merged
merged 14 commits into from
Apr 10, 2019

Conversation

aslom
Copy link
Member

@aslom aslom commented Mar 27, 2019

Solves #299

@googlebot googlebot added the cla: yes Indicates the PR's author has signed the CLA. label Mar 27, 2019
@knative-prow-robot knative-prow-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Mar 27, 2019
@knative-prow-robot knative-prow-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Mar 27, 2019
@aslom
Copy link
Member Author

aslom commented Mar 27, 2019

/assign @dubee

@knative-prow-robot
Copy link
Contributor

@aslom: GitHub didn't allow me to assign the following users: dubee.

Note that only knative members and repo collaborators can be assigned.
For more information please see the contributor guide

In response to this:

/assign @dubee

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.

@aslom
Copy link
Member Author

aslom commented Mar 27, 2019

/assign @matzew

…_policy

# Conflicts:
#	contrib/kafka/pkg/reconciler/kafkasource.go
@bbrowning
Copy link
Contributor

bbrowning commented Mar 27, 2019

When would we ever want the policy to be Always instead of IfNotPresent?

@bbrowning
Copy link
Contributor

Copied from #299 since the comment is really about the implementation here that exposes a config option:

Why make this an option instead of just changing it from Always to IfNotPresent? Won't this reference an image reference be an image digest once we cut a release, and thus IfNotPresent sufficient?

@aslom
Copy link
Member Author

aslom commented Mar 27, 2019

@bbrowning you may want different policies depending on your k8s policies, for example how you do upgrades?

@bbrowning
Copy link
Contributor

If you look at our generated release.yaml files, you'll see image references like:

gcr.io/knative-releases/github.com/knative/eventing-sources/cmd/github_receive_adapter@sha256:175407a69f62339e56e077ac87f508db4fb873653a68b03eab6b7cb3eea8e507

Those are image digests, and thus unique. IfNotPresent seems like the sensible default and I can't see why you'd ever want to change that to Always?

@aslom
Copy link
Member Author

aslom commented Mar 27, 2019

BTW: wit this PR default is for imagePullPolicy is IfNotPresent and you can override not only to Always but also to Never

@matzew
Copy link
Member

matzew commented Mar 27, 2019 via email

@aslom
Copy link
Member Author

aslom commented Mar 28, 2019

@matzew @dubee I changed default form Always to IfNotPresent both for adapter and for controller. I tested with minikube and standalone k8s and worked in both.

@lionelvillard
Copy link
Member

the default value for imagePullPolicy is IfNotPresent when the image tag is not latest. Maybe imagePullPolicy shouldn't be specified to allow k8s to do the right thing when the image tag latest (which is Always)?

Copy link
Contributor

@dubee dubee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bbrowning, I was using an image pull policy of always for development purposes. After updating the event source locally and publishing it to my container registry, my cluster didn't always seem to pull down the updated image when I deployed a new event source to test my changes.

@dubee
Copy link
Contributor

dubee commented Mar 28, 2019

the default value for imagePullPolicy is IfNotPresent when the image tag is not latest. Maybe imagePullPolicy shouldn't be specified to allow k8s to do the right thing when the image tag latest (which is Always)?

Perhaps this solves the problem. 👍

@@ -32,10 +32,12 @@ spec:
containers:
- name: manager
image: github.com/knative/eventing-sources/contrib/kafka/cmd/controller
imagePullPolicy: Always
imagePullPolicy: IfNotPresent
Copy link
Member Author

@aslom aslom Mar 28, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could remove it instead of making IfNotPresent as I think k8s default policy is Always - do you want it to be removed? @matzew @dubee @lionelvillard

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will break integration tests

env:
- name: KAFKA_RA_IMAGE
value: github.com/knative/eventing-sources/contrib/kafka/cmd/receive_adapter
- name: KAFKA_RA_IMAGE_PULL_POLLICY
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If that KAFKA_RA_IMAGE_PULL_POLLICY env variable is not present then IfNotPresent is used - I think ability to configure image pull policy for receive adapter is good? @dubee @matzew

@aslom
Copy link
Member Author

aslom commented Mar 28, 2019

@dubee @matzew @lionelvillard @bbrowning I have added comments to lines of code above showing changes about image policy - please comment what you think is missing/need changing.

@aslom
Copy link
Member Author

aslom commented Mar 28, 2019

Here is what I found in k8s docs - the default pull policy is IfNotPresent for non latest tagged images:
https://kubernetes.io/docs/concepts/containers/images/

Considering how complex it is making receiver adapter image pull policy configurable is good? 5 separate cases:
https://kubernetes.io/docs/concepts/configuration/overview/#container-images

@bbrowning
Copy link
Contributor

@bbrowning, I was using an image pull policy of always for development purposes. After updating the event source locally and publishing it to my container registry, my cluster didn't always seem to pull down the updated image when I deployed a new event source to test my changes.

Perhaps you were using tags and not digests to reference your image? Knative releases specifically use digests for all image references to avoid this issue.

@knative-prow-robot knative-prow-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 3, 2019
@aslom
Copy link
Member Author

aslom commented Apr 3, 2019

@bbrowning @dubee I made the changes - image pull policy setting is now removed form kafka source

Copy link
Contributor

@dubee dubee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@knative-prow-robot
Copy link
Contributor

@dubee: changing LGTM is restricted to assignees, and only knative/eventing-sources repo collaborators may be assigned issues.

In response to this:

/lgtm

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.

PASS
ok  	github.com/knative/eventing-sources/contrib/kafka/pkg/reconciler
0.049s
@knative-prow-robot knative-prow-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Apr 9, 2019
@aslom
Copy link
Member Author

aslom commented Apr 9, 2019

@matzew @lberk fixed missing unit test

PASS
ok  	github.com/knative/eventing-sources/contrib/kafka/pkg/reconciler	0.049s

@matzew
Copy link
Member

matzew commented Apr 9, 2019

/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 9, 2019
@matzew
Copy link
Member

matzew commented Apr 9, 2019

/ok-to-test

@knative-prow-robot knative-prow-robot removed the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Apr 9, 2019
@matzew
Copy link
Member

matzew commented Apr 9, 2019

/test pull-knative-eventing-sources-integration-tests

2 similar comments
@aslom
Copy link
Member Author

aslom commented Apr 9, 2019

/test pull-knative-eventing-sources-integration-tests

@aslom
Copy link
Member Author

aslom commented Apr 9, 2019

/test pull-knative-eventing-sources-integration-tests

@aslom
Copy link
Member Author

aslom commented Apr 9, 2019

/ok-to-test

@matzew
Copy link
Member

matzew commented Apr 10, 2019

/approve

@matzew
Copy link
Member

matzew commented Apr 10, 2019

@n3wscott mind doing an approve ?

@n3wscott
Copy link
Contributor

/approve

@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aslom, dubee, matzew, n3wscott

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 10, 2019
@knative-prow-robot knative-prow-robot merged commit 7396a3e into knative:master Apr 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants