-
Notifications
You must be signed in to change notification settings - Fork 20
Overlaysync controller and inputmirror CRD #547
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?
Conversation
CreateOrUpdate only persists spec changes, not status changes. Status must be updated separately via the status subresource.
api/v1/inputmirror.go
Outdated
| Items []InputMirror `json:"items"` | ||
| } | ||
|
|
||
| // InputMirror stores a copy of a resource from an overlay cluster. |
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.
Let's redact any concept of overlay since that's an internal concept and this is OSS
|
|
||
| // getOrCreateOverlayClient gets a cached overlay client or creates a new one. | ||
| // Security: Credentials are never logged, client has timeouts, cache invalidates on rotation. | ||
| func (c *Controller) getOrCreateOverlayClient(ctx context.Context, symphony *apiv1.Symphony) (client.Client, error) { |
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.
If this controller ran in the eno-reconciler process, it would already have both clients available. I'm not sure if that would make sense overall but I suspect it's worth investigating
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.
Was thinking to migrate to have controller run with watches / informers rather than relying on polling, will see what this looks like in the eno-reconciler
api/v1/symphony.go
Outdated
| // When set, the OverlaySyncController will use these credentials to sync | ||
| // resources specified in OverlayResourceRefs. | ||
| // +optional | ||
| OverlayCredentials *OverlayCredentials `json:"overlayCredentials,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.
See my other comment on the controller. It would be nice to remove this for simplicity
| // +kubebuilder:printcolumn:name="Source",type=string,JSONPath=`.spec.sourceResource.name` | ||
| // +kubebuilder:printcolumn:name="Synced",type=string,JSONPath=`.status.conditions[?(@.type=="Synced")].status` | ||
| // +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp` | ||
| type InputMirror struct { |
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.
How often do you think these values will change? I'm wondering if we could keep the API simple by configuring a static list of mirrors per eno-reconciler process in a static config file.
controller for syncing resources from another cluster, and a CRD for sync-able resources.
Design for a representative synth leveraging this is here, implementation is in /ci/ama-metrics-ccp:
https://msazure.visualstudio.com/CloudNativeCompute/_git/aks-operator/pullrequest/14226045?_a=files&path=/ci/ama-metrics-ccp/design/overlay-input-sync.md