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

OLS-1622: Document token quota feature #91500

Open
wants to merge 1 commit into
base: lightspeed-docs-main
Choose a base branch
from

Conversation

rh-tokeefe
Copy link
Contributor

@rh-tokeefe rh-tokeefe commented Apr 2, 2025

Affects:
lightspeed-main

This PR is part of the standalone doc set for the Lightspeed project. Kathryn is aware that this content applies for a product that is part of a Developer Preview release. The project is seeking feedback from early adopters.

PR must be CP'd back to the lightspeed-docs-1.0 branch.

Version(s): 1.0

Issue: https://issues.redhat.com/browse/OLS-1622

Link to docs preview:
https://91500--ocpdocs-pr.netlify.app/openshift-lightspeed/latest/configure/ols-configuring-openshift-lightspeed.html#ols-tokens-and-token-quota-limits_ols-configuring-openshift-lightspeed

QE review:

  • QE has approved this change.

Additional information:

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Apr 2, 2025
@openshift-ci-robot
Copy link

openshift-ci-robot commented Apr 2, 2025

@rh-tokeefe: This pull request references OLS-1622 which is a valid jira issue.

In response to this:

Affects:
lightspeed-main

This PR is part of the standalone doc set for the Lightspeed project. Kathryn is aware that this content applies for a product that is part of a Developer Preview release. The project is seeking feedback from early adopters.

PR must be CP'd back to the lightspeed-docs-1.0 branch.

Version(s): 1.0

Issue:

Link to docs preview:

QE review:

  • QE has approved this change.

Additional information:

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot
Copy link

openshift-ci-robot commented Apr 2, 2025

@rh-tokeefe: This pull request references OLS-1622 which is a valid jira issue.

In response to this:

Affects:
lightspeed-main

This PR is part of the standalone doc set for the Lightspeed project. Kathryn is aware that this content applies for a product that is part of a Developer Preview release. The project is seeking feedback from early adopters.

PR must be CP'd back to the lightspeed-docs-1.0 branch.

Version(s): 1.0

Issue: https://issues.redhat.com/browse/OLS-1622

Link to docs preview:

QE review:

  • QE has approved this change.

Additional information:

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Apr 2, 2025
@ocpdocs-previewbot
Copy link

ocpdocs-previewbot commented Apr 2, 2025

🤖 Fri Apr 04 16:32:01 - Prow CI generated the docs preview:

https://91500--ocpdocs-pr.netlify.app/openshift-lightspeed/latest/configure/ols-configuring-openshift-lightspeed.html

@openshift-ci openshift-ci bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Apr 3, 2025
@openshift-ci-robot
Copy link

openshift-ci-robot commented Apr 3, 2025

@rh-tokeefe: This pull request references OLS-1622 which is a valid jira issue.

In response to this:

Affects:
lightspeed-main

This PR is part of the standalone doc set for the Lightspeed project. Kathryn is aware that this content applies for a product that is part of a Developer Preview release. The project is seeking feedback from early adopters.

PR must be CP'd back to the lightspeed-docs-1.0 branch.

Version(s): 1.0

Issue: https://issues.redhat.com/browse/OLS-1622

Link to docs preview:
https://91500--ocpdocs-pr.netlify.app/openshift-lightspeed/latest/configure/ols-configuring-openshift-lightspeed.html#ols-tokens-and-token-quota-limits_ols-configuring-openshift-lightspeed

QE review:

  • QE has approved this change.

Additional information:

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 openshift-eng/jira-lifecycle-plugin repository.

----
kind: ConfigMap
apiVersion: v1
quota_handlers:

Choose a reason for hiding this comment

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

ConfigMaps uses a data property to hold these contents.
Each entry has a key and a value, it can be either like a property or a file.
Below we define the config as a file. The OLS pod can mount this configmap as a volume and access the file within. The CR OLSConfig can refer to this configmap as quota settings.

apiVersion: v1
kind: ConfigMap
metadata:
  name: quota-limit
  namespace: openshift-lightspeed
data:
  quota_handlers.conf: |
    storage:
      host: <IP_address> <1>
      port: "5432"
      dbname: <database_name>
      user: <user_name>
      password_path: <file_containing_database_password>
      ssl_mode: disable
    limiters:
      - name: user_monthly_limits 
        type: user_limiter
        initial_quota: 100000 <2>
        quota_increase: 10
        period: 30 days
      - name: cluster_monthly_limits 
        type: cluster_limiter
        quota_increase: 1000000 <3>
        period: 30 days
    scheduler:
      period: 300 <4>

Copy link

Choose a reason for hiding this comment

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

this ^ makes sense, thank you @raptorsun

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@raptorsun and @tisnik I've pushed a change to the PR. Please let me know that you think. Thanks!

Copy link

openshift-ci bot commented Apr 4, 2025

@rh-tokeefe: all tests passed!

Full PR test history. Your PR dashboard.

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-sigs/prow repository. I understand the commands that are listed here.

[id="ols-activating-token-quota-limits_{context}"]
= Activating token quota limits

Activate token quota limits for the {ols-long} Service by defining key-value pairs in the `ConfigMap` resource. The {ols-long} pod mounts the `ConfigMap` resource as a volume, enabling access to the file stored within it. The `OLSConfig` Custom Resource (CR) references the `ConfigMap` resource to obtain the quota limit information.
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't we say:
Service by defining key-value pairs in the quota-limit instance of the ConfigMap resource.
?

Or can we not assured it will be named this way?
We're editing the configmap instance, instead of creating it which leads me to believe the configmap is automatically created. If so, we should know what the name is no?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you @JoaoFula. I'll confirm with @tisnik if I should use quota-limit. I'm not sure if it will always be referred to that way, but in this example it could be.

You also bring up a good point about hte ConfigMap. When I wrote this, I was assuming that a ConfigMap already existed. I don't think a ConfigMap is automatically generated, but I'll also have to check with Pavel on that, too.

@tisnik does it make sense to add a step to create the ConfigMap? I believe this is the syntax to do so: oc create configmap <configmap-name> --from-file=<path-to-file>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. 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.

6 participants