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

feat: added min/max cpu and memory for kubernetes via starlark #689

Merged
merged 7 commits into from Jun 13, 2023

Conversation

Peeeekay
Copy link
Contributor

@Peeeekay Peeeekay commented Jun 8, 2023

Here is the doc PR with relevant description: #708

@Peeeekay Peeeekay force-pushed the pk/add_min_resource_kubernetes branch from 067a36a to b8c9a5f Compare June 8, 2023 05:01
Base automatically changed from pk/add_min_resource_kubernetes to main June 8, 2023 05:27
@Peeeekay Peeeekay force-pushed the pk/propagate_min_to_starlark branch from 315694e to b9bedec Compare June 8, 2023 05:32
@Peeeekay Peeeekay changed the title Pk/propagate min to starlark feat: added min/max cpu and memory for kubernetes via starlark Jun 8, 2023
@Peeeekay Peeeekay force-pushed the pk/propagate_min_to_starlark branch from 3b17a8e to 081bf56 Compare June 8, 2023 16:32
@Peeeekay Peeeekay marked this pull request as ready for review June 9, 2023 00:29
@Peeeekay Peeeekay force-pushed the pk/propagate_min_to_starlark branch from 9cfae4d to 7b5271f Compare June 9, 2023 01:34
@Peeeekay
Copy link
Contributor Author

Peeeekay commented Jun 9, 2023

Sample Starlark
If new fields and old fields are set, ignore the old fields:-

    postgres = plan.add_service(
        name = "postgres",
        config = ServiceConfig(
            image = "postgres:15.2-alpine",
            ports = {
                POSTGRES_PORT_ID: PortSpec(5432, application_protocol = "postgresql"),
            },
            env_vars = {
                "POSTGRES_DB": POSTGRES_DB,
                "POSTGRES_USER": POSTGRES_USER,
                "POSTGRES_PASSWORD": POSTGRES_PASSWORD,
            },
            files = {
                SEED_DATA_DIRPATH: data_package_module_result.files_artifact,
            },
            max_cpu=1200,
            cpu_allocation=1000,
            max_memory=2048,
            min_cpu=100,
            min_memory=1024,
        ),
    )

Result:

 resources:
        limits:
          cpu: 1200m
          memory: 2048M
        requests:
          cpu: 100m
          memory: 1024M

@Peeeekay
Copy link
Contributor Author

Peeeekay commented Jun 9, 2023

Sample Starlark:

 postgres = plan.add_service(
        name = "postgres",
        config = ServiceConfig(
            image = "postgres:15.2-alpine",
            ports = {
                POSTGRES_PORT_ID: PortSpec(5432, application_protocol = "postgresql"),
            },
            env_vars = {
                "POSTGRES_DB": POSTGRES_DB,
                "POSTGRES_USER": POSTGRES_USER,
                "POSTGRES_PASSWORD": POSTGRES_PASSWORD,
            },
            files = {
                SEED_DATA_DIRPATH: data_package_module_result.files_artifact,
            },
            max_cpu=1200,
            min_cpu=100,
            max_memory=2048,
            min_memory=1024,
        ),
    )
resources:
        limits:
          cpu: 1200m
          memory: 2048M
        requests:
          cpu: 100m
          memory: 1024M

@Peeeekay Peeeekay force-pushed the pk/propagate_min_to_starlark branch from e35706c to 9d4569a Compare June 12, 2023 00:05
@laurentluce laurentluce self-requested a review June 12, 2023 02:35
@Peeeekay Peeeekay force-pushed the pk/propagate_min_to_starlark branch from 9127473 to 074d6da Compare June 12, 2023 19:01
@Peeeekay Peeeekay force-pushed the pk/propagate_min_to_starlark branch 2 times, most recently from 3aa9e54 to 655cf52 Compare June 13, 2023 05:55
@Peeeekay Peeeekay force-pushed the pk/propagate_min_to_starlark branch from 655cf52 to 711b09b Compare June 13, 2023 06:01
@Peeeekay Peeeekay merged commit faffc07 into main Jun 13, 2023
29 checks passed
@Peeeekay Peeeekay deleted the pk/propagate_min_to_starlark branch June 13, 2023 06:34
adschwartz pushed a commit that referenced this pull request Jun 13, 2023
🤖 I have created a release *beep* *boop*
---


##
[0.78.1](0.78.0...0.78.1)
(2023-06-13)


### Features

* added min/max cpu and memory for kubernetes via starlark
([#689](#689))
([faffc07](faffc07))
* use kurtosis service name as the kubernetes service name
([#713](#713))
([b0d6b8e](b0d6b8e))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: kurtosisbot <kurtosisbot@users.noreply.github.com>
@h4ck3rk3y
Copy link
Contributor

neat stuff :) Will use!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants