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

add: custom annotations on service and deployment #2030

Merged
merged 1 commit into from
Apr 24, 2024

Conversation

tozastation
Copy link
Contributor

@tozastation tozastation commented Apr 22, 2024

What type of PR is this?

/kind feature

What this PR does / why we need it:

I have changed to be able to set Custom Annotations on Service resources and Deployment's Pod resources via Helm Chart.

Which issue(s) this PR fixes:

Fixes #1619

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Helm: Allow configuration of custom annotations on Service and Deployment's Pod

Signed-off-by: tozastation <tozastation@gmail.com>
@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. labels Apr 22, 2024
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Apr 22, 2024
@k8s-ci-robot
Copy link
Contributor

Welcome @tozastation!

It looks like this is your first PR to kubernetes-sigs/kueue 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/kueue has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Apr 22, 2024
@k8s-ci-robot
Copy link
Contributor

Hi @tozastation. Thanks for your PR.

I'm waiting for a kubernetes-sigs 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.

@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Apr 22, 2024
Copy link

netlify bot commented Apr 22, 2024

Deploy Preview for kubernetes-sigs-kueue ready!

Name Link
🔨 Latest commit cdaebed
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-kueue/deploys/662665708800ae0008b60690
😎 Deploy Preview https://deploy-preview-2030--kubernetes-sigs-kueue.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@tenzen-y
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Apr 22, 2024
@tozastation
Copy link
Contributor Author

/assign @denkensk
/assign @trasc

Copy link
Contributor

@trasc trasc left a comment

Choose a reason for hiding this comment

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

Overall LGTM.

@tozastation do you have a specific use-case for this? Maybe we can document it.

@tozastation
Copy link
Contributor Author

tozastation commented Apr 24, 2024

@trasc
thanks for reviewing!

In Prometheus, we can use Relabel Config to define the scraping target without using the Service Monitor (Prometheus Operator CRD).
For this configuration, we can use the metadata.annotations of the Service or Pod.

The following annotations are available by default in Prometheus' Helm Chart.
https://github.com/prometheus-community/helm-charts/blob/main/charts/prometheus/values.yaml#L918

prometheus.io/path: /metrics
prometheus.io/port: '8080'
prometheus.io/scrape: 'true'
etc...

Implementing this with the proposed changes will result in the following

example (values.yaml): Pod Annotations

controllerManager:
  manager:
    podAnnotations:
      prometheus.io/path: /metrics
      prometheus.io/port: '8080'
      prometheus.io/scrape: 'true'

example (values.yaml): Service Annotations

metricsService:
  annotations:
    prometheus.io/path: /metrics
    prometheus.io/port: '8443'
    prometheus.io/scrape: 'true'
    prometheus.io/scheme: https

※ Service Scaraping requires the following additions to the Prometheus configuration.
Follows the Service Monitor configuration: https://github.com/kubernetes-sigs/kueue/blob/main/charts/kueue/templates/prometheus/monitor.yaml

scrape_configs:
  - tls_config:
        insecure_skip_verify: true
    authorization:
        credentials_file: /var/run/secrets/kubernetes.io/serviceaccount/token

@trasc
Copy link
Contributor

trasc commented Apr 24, 2024

Thanks,

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 24, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: c660d9fe8776db46159f37c7a89ce2b89ee8d47e

@tozastation
Copy link
Contributor Author

/assign @tenzen-y

Copy link
Member

@tenzen-y tenzen-y left a comment

Choose a reason for hiding this comment

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

I'm wondering if we need to update https://github.com/kubernetes-sigs/kueue/blob/a0290b3f67770b34b6169bcd10e74e07ad831945/hack/update-helm.sh as well.

@tozastation What happens if you perform make update-helm?

@tozastation
Copy link
Contributor Author

@tenzen-y

thanks

The following is the result of the execution.
I checked that there are no git diffs or newly generated files.

❯ make update-helm
/Users/tozastation/ghq/github.com/tozastation/kueue/bin/controller-gen \
                crd:generateEmbeddedObjectMeta=true output:crd:artifacts:config=config/components/crd/bases\
                paths="./apis/..."
/Users/tozastation/ghq/github.com/tozastation/kueue/bin/controller-gen \
                rbac:roleName=manager-role output:rbac:artifacts:config=config/components/rbac\
                webhook output:webhook:artifacts:config=config/components/webhook\
                paths="./pkg/controller/...;./pkg/webhooks/...;./pkg/util/cert/...;./pkg/visibility/..."
go: downloading github.com/mikefarah/yq/v4 v4.34.1
go: downloading gopkg.in/op/go-logging.v1 v1.0.0-20160211212156-b2cb9fa56473
go: downloading github.com/elliotchance/orderedmap v1.5.0
go: downloading github.com/a8m/envsubst v1.4.2
go: downloading github.com/alecthomas/participle/v2 v2.0.0
go: downloading github.com/goccy/go-yaml v1.11.0
go: downloading github.com/pelletier/go-toml/v2 v2.0.7
SED=/opt/homebrew/opt/gnu-sed/libexec/gnubin/sed ./hack/update-helm.sh

@tenzen-y
Copy link
Member

@tenzen-y

thanks

The following is the result of the execution.

I checked that there are no git diffs or newly generated files.

❯ make update-helm

/Users/tozastation/ghq/github.com/tozastation/kueue/bin/controller-gen \

                crd:generateEmbeddedObjectMeta=true output:crd:artifacts:config=config/components/crd/bases\

                paths="./apis/..."

/Users/tozastation/ghq/github.com/tozastation/kueue/bin/controller-gen \

                rbac:roleName=manager-role output:rbac:artifacts:config=config/components/rbac\

                webhook output:webhook:artifacts:config=config/components/webhook\

                paths="./pkg/controller/...;./pkg/webhooks/...;./pkg/util/cert/...;./pkg/visibility/..."

go: downloading github.com/mikefarah/yq/v4 v4.34.1

go: downloading gopkg.in/op/go-logging.v1 v1.0.0-20160211212156-b2cb9fa56473

go: downloading github.com/elliotchance/orderedmap v1.5.0

go: downloading github.com/a8m/envsubst v1.4.2

go: downloading github.com/alecthomas/participle/v2 v2.0.0

go: downloading github.com/goccy/go-yaml v1.11.0

go: downloading github.com/pelletier/go-toml/v2 v2.0.7

SED=/opt/homebrew/opt/gnu-sed/libexec/gnubin/sed ./hack/update-helm.sh

Oh, I see. Thank you for checking!
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: tenzen-y, tozastation

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 24, 2024
@k8s-ci-robot k8s-ci-robot merged commit ae3e551 into kubernetes-sigs:main Apr 24, 2024
15 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v0.7 milestone Apr 24, 2024
@alculquicondor
Copy link
Contributor

/release-note-edit

Helm: Allow configuration of custom annotations on Service and Deployment's Pod

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add the possibility to add custom annotations to manager pods via helm chart
6 participants