-
Notifications
You must be signed in to change notification settings - Fork 40
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
[test] Add additional test helpers for pod and NAD #588
Merged
+77
−0
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CreatePod creates a new Pod resource with the provided annotations and spec. Example usage: ~~~ annotations := map[string]string{}{"key": "value"} spec := map[string]interface{}{"key": "value"} p := th.CreatePod(types.NamespacedName{Namespace: "default", Name: "example"}, annotations, spec) ~~~ Signed-off-by: Martin Schuppert <[email protected]>
stuggi
added a commit
to stuggi/infra-operator
that referenced
this pull request
Dec 11, 2024
Secondary network interfaces on pods need be announced in a BGP environment. This can be done by creating FRRConfiguration, per default in the metallb namespace. This PR introduce a new CRD which, if an instance got created, the controller watches pods * which have the NAD annotation on it * the NAD has an IPAM configured For each of them a FRRConfiguration gets created. The metallbs k8s service FRRConfiguration of that worker node is taken as the base to create this configuration. Known issue: Since there are then two FRRConfiguration, which hold same configs, like timeouts. It is not possible to update thise. The FRRConfiguration webhook will block those. A possible way to change it, would be stop the infra-operator controller-manager, delete the pod FRRConfigurations, do the change that it gets reflected in the metallb LB FRRConfiguration, then enable the controller that the pod FRRConfiguration get re-created. Depends-On: openstack-k8s-operators/lib-common#588 Jira: OSPRH-12384 Signed-off-by: Martin Schuppert <[email protected]>
GetNAD - retrieves a NetworkAttachmentDefinition resource. Example usage: ~~~ th.GetNAD(types.NamespacedName{Name: "test-nad", Namespace: "test-namespace"}) ~~~ CreateNAD creates a new NetworkAttachmentDefinition resource with the provided spec. Example usage: ~~~ spec := map[string]interface{}{"key": "value"} p := th.CreateNAD(types.NamespacedName{Namespace: "default", Name: "example"}, spec) ~~~ Signed-off-by: Martin Schuppert <[email protected]>
abays
approved these changes
Dec 12, 2024
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.
/lgtm
stuggi
added a commit
to stuggi/infra-operator
that referenced
this pull request
Dec 12, 2024
Secondary network interfaces on pods need be announced in a BGP environment. This can be done by creating FRRConfiguration, per default in the metallb namespace. This PR introduce a new CRD which, if an instance got created, the controller watches pods * which have the NAD annotation on it * the NAD has an IPAM configured For each of them a FRRConfiguration gets created. The metallbs k8s service FRRConfiguration of that worker node is taken as the base to create this configuration. Known issue: Since there are then two FRRConfiguration, which hold same configs, like timeouts. It is not possible to update thise. The FRRConfiguration webhook will block those. A possible way to change it, would be stop the infra-operator controller-manager, delete the pod FRRConfigurations, do the change that it gets reflected in the metallb LB FRRConfiguration, then enable the controller that the pod FRRConfiguration get re-created. Depends-On: openstack-k8s-operators/lib-common#588 Jira: OSPRH-12384 Signed-off-by: Martin Schuppert <[email protected]>
stuggi
added a commit
to stuggi/infra-operator
that referenced
this pull request
Dec 12, 2024
Secondary network interfaces on pods need be announced in a BGP environment. This can be done by creating FRRConfiguration, per default in the metallb namespace. This PR introduce a new CRD which, if an instance got created, the controller watches pods * which have the NAD annotation on it * the NAD has an IPAM configured For each of them a FRRConfiguration gets created. The metallbs k8s service FRRConfiguration of that worker node is taken as the base to create this configuration. Known issue: Since there are then two FRRConfiguration, which hold same configs, like timeouts. It is not possible to update thise. The FRRConfiguration webhook will block those. A possible way to change it, would be stop the infra-operator controller-manager, delete the pod FRRConfigurations, do the change that it gets reflected in the metallb LB FRRConfiguration, then enable the controller that the pod FRRConfiguration get re-created. Depends-On: openstack-k8s-operators/lib-common#588 Jira: OSPRH-12384 Signed-off-by: Martin Schuppert <[email protected]>
stuggi
added a commit
to stuggi/infra-operator
that referenced
this pull request
Dec 12, 2024
Secondary network interfaces on pods need be announced in a BGP environment. This can be done by creating FRRConfiguration, per default in the metallb namespace. This PR introduce a new CRD which, if an instance got created, the controller watches pods * which have the NAD annotation on it * the NAD has an IPAM configured For each of them a FRRConfiguration gets created. The metallbs k8s service FRRConfiguration of that worker node is taken as the base to create this configuration. Known issue: Since there are then two FRRConfiguration, which hold same configs, like timeouts. It is not possible to update thise. The FRRConfiguration webhook will block those. A possible way to change it, would be stop the infra-operator controller-manager, delete the pod FRRConfigurations, do the change that it gets reflected in the metallb LB FRRConfiguration, then enable the controller that the pod FRRConfiguration get re-created. Depends-On: openstack-k8s-operators/lib-common#588 Jira: OSPRH-12384 Signed-off-by: Martin Schuppert <[email protected]>
stuggi
added a commit
to stuggi/infra-operator
that referenced
this pull request
Dec 12, 2024
Secondary network interfaces on pods need be announced in a BGP environment. This can be done by creating FRRConfiguration, per default in the metallb namespace. This PR introduce a new CRD which, if an instance got created, the controller watches pods * which have the NAD annotation on it * the NAD has an IPAM configured For each of them a FRRConfiguration gets created. The metallbs k8s service FRRConfiguration of that worker node is taken as the base to create this configuration. Known issue: Since there are then two FRRConfiguration, which hold same configs, like timeouts. It is not possible to update thise. The FRRConfiguration webhook will block those. A possible way to change it, would be stop the infra-operator controller-manager, delete the pod FRRConfigurations, do the change that it gets reflected in the metallb LB FRRConfiguration, then enable the controller that the pod FRRConfiguration get re-created. Depends-On: openstack-k8s-operators/lib-common#588 Jira: OSPRH-12384 Signed-off-by: Martin Schuppert <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
GetNAD - retrieves a NetworkAttachmentDefinition resource.
Example usage:
CreateNAD creates a new NetworkAttachmentDefinition resource with the provided spec.
Example usage:
CreatePod creates a new Pod resource with the provided annotations and spec.
Example usage: