Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature to serve the version using /version endpoint #948

Closed
wants to merge 1 commit into from

Conversation

waveywaves
Copy link

Using this feature it should be possible for knative products
to be able to leverage this featureto serve the curent version
of product in use. This would help in debugging based on the
version as well as facilitate checking cli + controller
compatibility.

Related to
tektoncd/pipeline#1650
tektoncd/cli#503

cc @vdemeester

Signed-off-by: Vibhav Bobade [email protected]

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

Hi @waveywaves. Thanks for your PR.

I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: waveywaves
To complete the pull request process, please assign vaikas
You can assign the PR to them by writing /assign @vaikas in a comment when ready.

The full list of commands accepted by this bot can be found 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

@waveywaves
Copy link
Author

Basically, I need to be able to serve the release version of the controller in use in tektoncd/pipline so that it can be consumed by the cli for showing the version.


type versionRequestHandler struct {
version string
}
Copy link
Member

Choose a reason for hiding this comment

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

This type is impossible to create, and the function below is impossible to call 🤔

We have a convention where we have resources labeled with serving.knative.dev/release: devel and rewrite devel to a version when we ./hack/release.sh. Perhaps we should have this projected into an EnvVar or volume that this serves?

Copy link
Author

Choose a reason for hiding this comment

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

My bad, the StartVersionSrv is supposed to be public so that it can be called from tektoncd/pipeline. As pkg is used there as well for serving metrics. I have taken inspiration from there wrt serving the version.

Copy link
Author

Choose a reason for hiding this comment

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

If the version is reflected in the endpoints it would be easier for cli to query it for the release version.

Copy link
Author

Choose a reason for hiding this comment

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

The type is only consumed by StartVersionSrv, so it should be alright I suppose.

Copy link
Member

Choose a reason for hiding this comment

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

Hmm, not unless there's a publicly exposed network endpoint. Perhaps it could key off of the label I gave above on a fixed resource (e.g. the tekton namespace)?

Copy link
Author

Choose a reason for hiding this comment

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

@mattmoor To clarify, you are suggesting that the tekton release be given by a label on a namespace or as a volume correct ? If that is so, should I make changes here or open a PR on tektoncd for this ?

Copy link
Author

Choose a reason for hiding this comment

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

Okay @mattmoor It makes more sense to do this directly in tekton then in terms of the label on the resource.
https://github.com/knative/serving/blob/916ab9f5ac54c9cd041ad7c502e02b3bc8f6ea17/config/500-webhook-configuration.yaml#L20

Copy link
Member

Choose a reason for hiding this comment

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

I could see value in having /version that keyed off of a label like what our convention is, but I doubt that is adequate for your use case since unless there's an externally accessible endpoint you can't hit it without tunneling into the cluster (unless you are running on-cluster).

If the CLI just looked at labels in a fixed place (e.g. on the Tekton namespace of CR defintion) then you could piggyback on the API server as your endpoint.

Copy link
Author

Choose a reason for hiding this comment

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

Was planning to have the release show up on the pods running the controller and the webhook. In that case I would be able to use the cli to pick the labels up from there.

Copy link
Author

Choose a reason for hiding this comment

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

@mattmoor I have opened up a PR directly in tektoncd/pipeline for setting annotation on the controller pod for the release. If I am not wrong it should work with CLI for querying the annotation off of the pod for getting the version.

Using this feature it should be possible for knative products
to be able to leverage this featureto serve the curent version
of product in use. This would help in debugging based on the
version as well as facilitate checking cli + controller
compatibility.

Signed-off-by: Vibhav Bobade <[email protected]>
@waveywaves
Copy link
Author

/close

@waveywaves waveywaves closed this Dec 20, 2019
@knative-prow-robot
Copy link
Contributor

@waveywaves: Closed this PR.

In response to this:

/close

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.

@waveywaves waveywaves deleted the feature/serve-version branch December 20, 2019 06:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Indicates the PR's author has signed the CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants