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

[WIP] [RFE] Adding affinity for clusters #104

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

agonzalezrh
Copy link
Contributor

@agonzalezrh agonzalezrh commented Jan 17, 2025

This approach uses two new parameters in the request:

  • affinity_label to assign a label for a sandbox, to be used as a reference

  • affinity_type with two possible options:

    • sandbox_cluster: it will use the sandbox with same label but without affinity_type to decide which cluster to be used
    • affinity_cluster: it will use affinity cluster from the sandbox with same label

    Example:

    "service_uuid": "c1aaf117-c5ac-4bc3-bcd7-b4d4de16e9fe",
    "resources": [
      {
        "kind": "OcpSandbox",
        "count": 1,
        "affinity_label": "main",
        "cloud_selector": {
           "cloud": "cnv",
           "virt": "yes",
           "purpose": "dev",
           "hcp": "no"
        }
      },
      {
        "kind": "OcpSandbox",
        "count": 1,
        "affinity_label": "main",
        "affinity_type": "affinity_cluster",
        "cloud_selector": {
           "cloud": "cnv",
           "purpose": "dev"
        }
      }
    ],
    "annotations": {
      "guid": "13012025",
      "env_type": "ocp4-cluster",
      "namespace_suffix": "ocp4-cluster"
    }
    }
    
    

If the first sanndbox is hosted on ocpvdev01, the second sandbox it will search in the database a cluster with affinity to ocpvdev01 (ocpvdev01-hcp01, ocpvdev01-hcp02)..

Replacing affinity_cluster with sandbox_cluster, both sandbox will be in the same cluster

@agonzalezrh agonzalezrh requested a review from fridim January 17, 2025 00:58
@agonzalezrh agonzalezrh changed the title [WIP] [RFE} Adding affinity for clusters [WIP] [RFE] Adding affinity for clusters Jan 17, 2025
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.

1 participant