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

Kubernetes Provider on pod hostNetwork enabled #2037

Open
rendy-w opened this issue Sep 4, 2023 · 1 comment
Open

Kubernetes Provider on pod hostNetwork enabled #2037

rendy-w opened this issue Sep 4, 2023 · 1 comment

Comments

@rendy-w
Copy link

rendy-w commented Sep 4, 2023

Hi, I've encountered issue running Proto Cluster when the pod hostNetwork: true while using kubernetes provider.

this is the log:

[Proto.Cluster.Kubernetes.KubernetesProvider] [Cluster][KubernetesProvider] Registering service ip-10-0-2-223 on 10.0.2.223:8
[Proto.Cluster.Kubernetes.KubernetesProvider] Failed to register service
    k8s.Autorest.HttpOperationException: Operation returned an invalid status code 'NotFound'                                                                                                              
        at k8s.Kubernetes.SendRequestRaw(String requestContent, HttpRequestMessage httpRequest, CancellationToken cancellationToken)
        at k8s.Kubernetes.ReadNamespacedPodWithHttpMessagesAsync(String name, String namespaceParameter, Nullable`1 pretty, IDictionary`2 customHeaders, CancellationToken cancellationToken)
       at k8s.KubernetesExtensions.ReadNamespacedPodAsync(IKubernetes operations, String name, String namespaceParameter, Nullable`1 pretty, CancellationToken cancellationToken) 
       at Proto.Cluster.Kubernetes.KubernetesProvider.RegisterMemberInner()                                                                                                                                
       at Proto.Utils.Retry.Try(Func`1 body, Int32 retryCount, Int32 backoffMilliSeconds, Int32 maxBackoffMilliseconds, Action`2 onError, Action`1 onFailed, Boolean ignoreFailure) 

any idea on how to fix this?

@rogeralsing
Copy link
Contributor

I'm guessing now, but it might be that we are unable to talk to the Kubernetes API, e.g. that we should use some other configuration for the Kubernetes API client when using hostNetwork.
but given that it gets status not found at least hints that we are calling a non existing endpoint.

If that is the case, we should probably add some setting for HostNetwork in here:
https://github.com/asynkron/protoactor-dotnet/blob/dev/src/Proto.Cluster.Kubernetes/KubernetesProviderConfig.cs

And then make it use that setting to figure out where to make the client call when talking to the K8s API

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants