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

doc: document the project config options #12251

Merged

Conversation

gabrielmougard
Copy link
Contributor

@gabrielmougard gabrielmougard commented Sep 14, 2023

This requires this to be merged first

JIRA task : here

@github-actions github-actions bot added the Documentation Documentation needs updating label Sep 14, 2023
@tomponline
Copy link
Member

@gabrielmougard can you rebase this so tests re-run now youve got the extension merged.

@ru-fu
Copy link
Contributor

ru-fu commented Sep 25, 2023

@gabrielmougard I just reviewed and pushed a commit with doc updates to your branch. Please check and squash as required.
And please make sure to pull the change before you force-push to your branch. ;)

@tomponline
Copy link
Member

@gabrielmougard tests are failing

@tomponline tomponline marked this pull request as draft September 26, 2023 07:36
@gabrielmougard
Copy link
Contributor Author

@ru-fu I integrated your commit

Copy link
Contributor

@ru-fu ru-fu left a comment

Choose a reason for hiding this comment

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

Some small changes to the config option links, and some that I only noticed after seeing the changes in context. :)

@@ -73,7 +73,7 @@ It's possible to restrict a TLS client to one or multiple projects.
In this case, the client will also be prevented from performing global configuration changes or altering the configuration (limits, restrictions) of the projects it's allowed access to.

To restrict access, use [`lxc config trust edit <fingerprint>`](lxc_config_trust_edit.md).
Set the `restricted` key to `true` and specify a list of projects to restrict the client to.
Set the {config:option}`project-restricted:restricted` key to `true` and specify a list of projects to restrict the client to.
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't refer to the restricted option for project, but it's a field in the trust certificate. So no link here.

@@ -40,7 +40,7 @@ To confine access for an existing certificate (either because the access restric

lxc config trust edit <fingerprint>

Make sure that `restricted` is set to `true` and specify the projects that the certificate should give access to under `projects`.
Make sure that {config:option}`project-restricted:restricted` is set to `true` and specify the projects that the certificate should give access to under `projects`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Again, that's the field in the certificate, not the project config option.

In the latter case, the limit usually applies to the {ref}`instance-options-limits` that are configured for each instance (either directly or via a profile), and not to the resources that are actually in use.

For example, if you set the project's `limits.memory` configuration to `50GiB`, the sum of the individual values of all `limits.memory` configuration keys defined on the project's instances will be kept under 50 GiB.
If you try to create an instance that would make the total sum of `limits.memory` configurations exceed 50 GiB, you will get an error.
For example, if you set the project's {config:option}`project-limits:limits.memory` configuration to `50GiB`, the sum of the individual values of all {config:option}`project-limits:limits.memory` configuration keys defined on the project's instances will be kept under 50 GiB.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
For example, if you set the project's {config:option}`project-limits:limits.memory` configuration to `50GiB`, the sum of the individual values of all {config:option}`project-limits:limits.memory` configuration keys defined on the project's instances will be kept under 50 GiB.
For example, if you set the project's {config:option}`project-limits:limits.memory` configuration to `50GiB`, the sum of the individual values of all {config:option}`instance-resource-limits:limits.memory` configuration keys defined on the project's instances will be kept under 50 GiB.


Similarly, setting the project's `limits.cpu` configuration key to `100` means that the sum of individual `limits.cpu` values will be kept below 100.
Similarly, setting the project's {config:option}`project-limits:limits.cpu` configuration key to `100` means that the sum of individual {config:option}`project-limits:limits.cpu` values will be kept below 100.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Similarly, setting the project's {config:option}`project-limits:limits.cpu` configuration key to `100` means that the sum of individual {config:option}`project-limits:limits.cpu` values will be kept below 100.
Similarly, setting the project's {config:option}`project-limits:limits.cpu` configuration key to `100` means that the sum of individual {config:option}`instance-resource-limits:limits.cpu` values will be kept below 100.

`limits.processes` | integer | - | Maximum value for the sum of individual `limits.processes` configurations set on the instances of the project
`limits.virtual-machines` | integer | - | Maximum number of VMs that can be created in the project
- The {config:option}`project-limits:limits.cpu` configuration cannot be used if {ref}`instance-options-limits-cpu` is enabled.
This means that to use {config:option}`project-limits:limits.cpu` on a project, the {config:option}`project-limits:limits.cpu` configuration of each instance in the project must be set to a number of CPUs, not a set or a range of CPUs.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
This means that to use {config:option}`project-limits:limits.cpu` on a project, the {config:option}`project-limits:limits.cpu` configuration of each instance in the project must be set to a number of CPUs, not a set or a range of CPUs.
This means that to use {config:option}`project-limits:limits.cpu` on a project, the {config:option}`instance-resource-limits:limits.cpu` configuration of each instance in the project must be set to a number of CPUs, not a set or a range of CPUs.

// Only CPUs that are specified here can be used in the individual {config:option}`instance-resource-limits:limits.cpu` configurations set on the instances of the project.
// ---
// type: integer
// shortdesc: Which CPUs to use in the project
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// shortdesc: Which CPUs to use in the project
// shortdesc: Maximum number of CPUs to use in the project

// shortdesc: Maximum number of processes within the project
"limits.processes": validate.Optional(validate.IsUint32),
// lxdmeta:generate(entity=project, group=limits, key=limits.cpu)
// Only CPUs that are specified here can be used in the individual {config:option}`instance-resource-limits:limits.cpu` configurations set on the instances of the project.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// Only CPUs that are specified here can be used in the individual {config:option}`instance-resource-limits:limits.cpu` configurations set on the instances of the project.
// This value is the maximum value for the sum of the individual {config:option}`instance-resource-limits:limits.cpu` configurations set on the instances of the project.

// shortdesc: Usage limit for the host's memory for the project
"limits.memory": validate.Optional(validate.IsSize),
// lxdmeta:generate(entity=project, group=limits, key=limits.processes)
// This value is the maximum value for the sum of individual {config:option}`instance-resource-limits:limits.processes` configurations set on the instances of the project.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// This value is the maximum value for the sum of individual {config:option}`instance-resource-limits:limits.processes` configurations set on the instances of the project.
// This value is the maximum value for the sum of the individual {config:option}`instance-resource-limits:limits.processes` configurations set on the instances of the project.

Signed-off-by: Gabriel Mougard <gabriel.mougard@canonical.com>
Signed-off-by: Gabriel Mougard <gabriel.mougard@canonical.com>
Signed-off-by: Gabriel Mougard <gabriel.mougard@canonical.com>
Signed-off-by: Gabriel Mougard <gabriel.mougard@canonical.com>
@gabrielmougard
Copy link
Contributor Author

@ru-fu updated

Copy link
Contributor

@ru-fu ru-fu left a comment

Choose a reason for hiding this comment

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

Thank you!

@tomponline
Copy link
Member

@gabrielmougard when you're ready for this to be reviewed and merge please mark as ready to review

@gabrielmougard gabrielmougard marked this pull request as ready for review September 26, 2023 13:28
@tomponline tomponline merged commit b1f5b41 into canonical:main Sep 26, 2023
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Documentation needs updating
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants