Enable dynamic changes in the router for non-kube environments #2356
Enable dynamic changes in the router for non-kube environments #2356nluaces wants to merge 35 commits intoskupperproject:mainfrom
Conversation
fgiorgetti
left a comment
There was a problem hiding this comment.
My impression so far is that it is on the right track.
Really nice work @nluaces!
A few other comments I have so far:
- The site name in the router config is changing (we need to check if this will cause issues to the console or vanflow metrics)
- As I already added, the system controller update and the update of the router container for the controlled namespaces is something we need to figure out still
0eb07fd to
d4bc626
Compare
I checked that the name of the site was not changing when the controller just refresh (for example, when a listener has been created); do you have any examples for me to understand this better? |
9c2e556 to
d63b383
Compare
… given that it is going to be set up by the CLI with the install command. remove system adaptor callback in case the reload type is manual
…unning on a container or not
fgiorgetti
left a comment
There was a problem hiding this comment.
The system stop command should use a similar validation done to the system reload command, which performs the following check:
if nsPlatform != currentPlatform {
return nil, fmt.Errorf("existing namespace uses %q platform and it cannot change to %q", nsPlatform, currentPlatform)
}At present if someone runs system stop --platform podman but the actual platform is docker, the container is being left behind.
|
|
||
| func GetDefaultContainerEndpoint() string { | ||
| platform := os.Getenv(types.ENV_PLATFORM) | ||
| platform := config.GetPlatform() |
There was a problem hiding this comment.
Just before doing this, I'd recommend checking if the CONTAINER_ENDPOINT environment variable is set, if so, just return its value.
| return nil, fmt.Errorf("Failed to create directory: %v", err) | ||
| } | ||
|
|
||
| containerEndpoint := os.Getenv("CONTAINER_ENDPOINT") |
There was a problem hiding this comment.
I believe you can keep this one. If the CONTAINER_ENDPOINT is set, use it, otherwise what you have looks correct.
|
|
||
| currentPlatform := config.GetPlatform() | ||
| if currentPlatform.IsKubernetes() { | ||
| currentPlatform = types.PlatformPodman | ||
| } | ||
| if string(currentPlatform) != configuredPlatform { | ||
| return fmt.Errorf("existing namespace uses %q platform and it cannot change to %q", configuredPlatform, string(currentPlatform)) | ||
| } | ||
|
|
||
| if err := removeRouter(namespace, configuredPlatform); err != nil { |
There was a problem hiding this comment.
I believe that this is misplaced. When the system-controller is running with reload-type auto, the validation above will always fail, if the system-controller is running with docker.
If this gets moved to internal/cmd/skupper/system/nonkube/system_stop.go (ValidateInput), I believe it should produce the desired effect.
Implements #2337
Branch based on #2334, the proper commits that implement this issue are bb8ab35 and the following.
flowchart TD id1([new listener resource is created])-->|triggers|InputResourceHandler-->Q{site exists?} Q -->|Yes| A[Refresh Router Config] Q -->|No| B[Bootstrap]The InputResourceHandler was modified to not bootstrap in case a site is already created in the namespace.
EDIT: A new flag called
--reload-typeis available in theskupper system installcommand. It has priority over the env. variable.