-
Notifications
You must be signed in to change notification settings - Fork 43
Add proposal for cluster set level override in MWRS #155
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
base: main
Are you sure you want to change the base?
Add proposal for cluster set level override in MWRS #155
Conversation
Signed-off-by: ncr38 <[email protected]>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: ncr38 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
| CascadeDeletionPolicy CascadeDeletionPolicy `json:"cascadeDeletionPolicy,omitempty"` | ||
|
|
||
| // New field for clusterSet-level overrides | ||
| ClusterSetOverrides []ClusterSetManifestOverride `json:"clusterSetOverrides,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would name it as Override, and user can choose to override by clusterset, or placement or per cluster. Try to make it extensible enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good. In that case , We'll need to have this logic to iterate from Coarse Grained selector to Fine Grained selector while creating manifest works as same resource can be selected by two selectors.
Placement Override -> ClusterSet Override -> Cluster Override
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe only separate by type, e.g.
overrides:
overrideStrategy: clustersets
clustersets:
- name: clusterset1
patch: .....
- name: clusterset2
and we can also choose placements
overrides:
overrideStrategy: placements
clustersets:
- name: aws-placement
patch: .....
- name: gke-placement
|
|
||
| type ResourceIdentifier struct { | ||
| APIVersion string `json:"apiVersion,omitempty"` | ||
| Kind string `json:"kind,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
APIGroup/Version/Resource is preferred. We can reuse the existing resourceIdentifier
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, will use the existing resource identifier.
|
|
||
| type OverrideSpec struct { | ||
| // Metadata overrides (name, namespace, labels, annotations) | ||
| MetadataOverride *MetadataOverride `json:"metadataOverride,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this for, why it cannot be part of general override?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initially thought of allowing template based override in metadataOverride like labels.cluster : {{clusterName}}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think we need to treat spec and metadata differently.
| MetadataOverride *MetadataOverride `json:"metadataOverride,omitempty"` | ||
|
|
||
| // JSON patch operations for spec modifications | ||
| SpecOverride []JSONPatch `json:"specOverride,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would make it more extensible, someone might want to use json merge patch also.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, I will introduce Replace , StrategicMerge as two possible strategies for patching things.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
StrategicMerge will be tricky...we can start with JSONPatch/JSONMerge/Replace
| value: 500m | ||
| - op: replace | ||
| path: /spec/template/spec/containers/0/resources/requests/memory | ||
| value: 512Mi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what the type of the value it should be? number or string?
| metadataOverride: | ||
| labels: | ||
| environment: production | ||
| tier: high-performance |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this part a merge or replace operation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replace
| - **Multi-environment deployments**: Deploy the same application with environment-specific configurations (prod clusterSet: 5 replicas, staging clusterSet: 1 replica) | ||
| - **ClusterSet capacity optimization**: Adjust resource requests/limits based on clusterSet capacity profiles | ||
| - **Compliance requirements**: Apply different security contexts or labels based on clusterSet compliance levels | ||
| - **Regional customizations**: Use different images or configurations for different geographical clusterSets |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another use case would be different configurations in different cloud providers.
No description provided.