Skip to content

feat: Add option to specify the assignment rules for scaling policy#505

Merged
mszostok merged 5 commits intomasterfrom
woop-651/assignment-rules
Jun 18, 2025
Merged

feat: Add option to specify the assignment rules for scaling policy#505
mszostok merged 5 commits intomasterfrom
woop-651/assignment-rules

Conversation

@mszostok
Copy link
Copy Markdown
Member

@mszostok mszostok commented Jun 15, 2025

Description

  1. Should we nest as in assignment_rules, or keep the “duplicate” style like in labels_expressions?
    assignment_rules {
    	rules {
    		namespace {
    			names = ["default", "kube-system"]
    		}
    	}
    	rules {
    		workloads {
    			labels_expressions {
    				key      = "foo"
    				operator = "NotIn"
    				values   = ["a", "b"]
    			}
    			labels_expressions {
    				key      = "test"
    				operator = "Exists"
    			}
    		}
    	}
    }
    IMO the grouping in assignment_rules is more readable, subjects in our module are done this way too.
  2. Should we map operators to Kubernetes label selector terms or keep the current ones?
    • e.g. KUBERNETES_LABEL_SELECTOR_OP_IN -> In, KUBERNETES_LABEL_SELECTOR_OP_NOT_IN -> NotIn, KUBERNETES_LABEL_SELECTOR_OP_EXISTS -> Exists, KUBERNETES_LABEL_SELECTOR_OP_DOES_NOT_EXIST -> DoesNotExist
      I know that we wanted to have it as close as possible to the API syntax, but who uses API directly? Maybe we can make it more user-friendly for the end users who will use the Terraform provider?
      With our great grcp->rest translation, is hard to have such naming.

@mszostok mszostok requested a review from a team as a code owner June 15, 2025 19:05
@mszostok mszostok force-pushed the woop-651/assignment-rules branch from 8b38828 to 06c954c Compare June 18, 2025 08:18
@mszostok mszostok merged commit 2d19db4 into master Jun 18, 2025
10 of 13 checks passed
@mszostok mszostok deleted the woop-651/assignment-rules branch June 18, 2025 11:44
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.

3 participants