knative / client

Knative developer experience, docs, reference Knative CLI implementation
Apache License 2.0
354 stars 261 forks source link

[48h Knative] Annotation and Label profiles #1890

Closed rhuss closed 11 months ago

rhuss commented 1 year ago

πŸ‘‹ Hello awesome contributor!

Are you excited about Knative and open-source development? You're in the right place! This is a mini-project for the upcoming 48h Knative eventβ€”a 48-hour hackathon designed to boost contributions to the Knative Client project. For more details, check out Issue #1842.

🎯 Project Description

This story is about creating profiles for annotation and labels. A "profile" is a named collection of such meta-data that can be selected when creating or updating Knative services.

There can be built in profiles like "istio" which select a set of predefined labels, but profiles should be also able to be configured in the kn configuration file.

For example, assume that a profile istio is defined that would set the annotations:

sidecar.istio.io/inject: "true"
sidecar.istio.io/rewriteAppHTTPProbers: "true"
serving.knative.openshift.io/enablePassthrough: "true"

then when running kn service create myservice --image .... --profile=istio those annotation would be applied.

For non-builtin profiles, the configuration that goes to ~/.config/kn/config.yml should look like:

profiles:
  istio:
     annotations:
         sidecar.istio.io/inject: "true"
         sidecar.istio.io/rewriteAppHTTPProbers: "true"
         serving.knative.openshift.io/enablePassthrough: "true"

🌟 Benefits

Having profiles makes it much easier for integration with other Kubernetes add-ons that require a set of annotation and/or labels for triggering a certain behavior. The Istio annotations above are a good example for such an integration.

πŸ›  Difficulty Level

Challenging

πŸ‘₯ Recommended Team Size

1-3

πŸŽ‰ Expected Outcome

It would be great to get the foundation for this features within the 2 days of hackathon. Having hard-coded profiles for the beginning would be great, having the option to configure it via the configuration file would be the icing on the cake.

🀝 Mentor

πŸ“ Additional Information

🌐 Entrypoints


πŸ“‹ Organizer Checklist

sharmaansh21 commented 1 year ago

/assign