Skip to content
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

[bug]: UHE when starting without connection to Kubernetes API server #558

Open
vvitkovsky opened this issue Apr 27, 2023 · 2 comments
Open
Labels
bug Something isn't working

Comments

@vvitkovsky
Copy link

Describe the bug

If I start app with KubeOps while I don't have a connection to Kubernetes API server app just crash.

To reproduce

Start app with KubOps without a connection to Kubernetes API server

Expected behavior

Try to reconnect after some time

Screenshots

No response

Additional Context

UHE is here:
LeaderElector.cs

public async Task StartAsync(CancellationToken cancellationToken)
{
...
_operatorDeployment = (await _client.List<V1Deployment>(
            _namespace,
            new EqualsSelector("operator-deployment", _settings.Name))).FirstOrDefault();
...
}
@vvitkovsky vvitkovsky added the bug Something isn't working label Apr 27, 2023
@vvitkovsky vvitkovsky changed the title [bug]: [bug]: UHE when starting without connection to Kubernetes API server Apr 27, 2023
@buehler
Copy link
Owner

buehler commented Apr 28, 2023

As mentioned in #557, I don't think this is a real bug. When the application crashes because there is no connection to the Kubernetes API, Kubernetes will restart the application itself (automatic pod restart to match the manifest).

The leader elector is not the only part that accesses the Kubernetes API.

@vvitkovsky
Copy link
Author

Hi Christoph,

Of course, app can be restarted with help of some other app - Kubentetes, OS etc., but this in only one place that just crash app if no connection, all other functionality (like watchers etc) works correctly and try to reconnect from time to time. This specific logic is needed only to apply your crds to Kubernetes API server, in most cases you don't even need this.

Anyway, even disabling this specific functionality with some log message in case of error will be better then just having an app crash, at least for my point of view. Or probably have some configuration parameter to disable such "risky" stuff like this if you really do not need that.

Best regards,
Victor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants