v7 fails with Microsoft.Orleans.Hosting.Kubernetes
See original GitHub issueWhen v7 is used with Microsoft.Orleans.Hosting.Kubernetes 7.0.0 it fails to interact with ClusterVersion CRD (see logs below). The hosting library is using KubernetesClient 7.0.7 while v7 clustering us using 6.0.19. The root cause is that KubernetesClient 7.0.7 library is used at runtime and it changes object returned by ListNamespacedCustomObjectAsync
, GetNamespacedCustomObjectAsync
, etc. from Newtonsoft.Json.Linq.JObject
(assumed in 6.0.19) to System.Text.Json.JsonElement
.
{"EventId":0,"LogLevel":"Warning","Category":"Orleans.Clustering.Kubernetes.KubeMembershipTable","Message":"We tried to Initialize ClusterVersion but fail. Ignoring for now...","Exception":"System.InvalidCastException: Unable to cast object of type \u0027System.Text.Json.JsonElement\u0027 to type \u0027Newtonsoft.Json.Linq.JObject\u0027. at Orleans.Clustering.Kubernetes.KubeMembershipTable.TryInitClusterVersion()","State":{"Message":"We tried to Initialize ClusterVersion but fail. Ignoring for now...","{OriginalFormat}":"We tried to Initialize ClusterVersion but fail. Ignoring for now..."},"Scopes":[]}
{"EventId":0,"LogLevel":"Warning","Category":"Orleans.Clustering.Kubernetes.KubeMembershipTable","Message":"Failure reading all silo entries for cluster id actors-silo","Exception":"System.InvalidCastException: Unable to cast object of type \u0027System.Text.Json.JsonElement\u0027 to type \u0027Newtonsoft.Json.Linq.JObject\u0027. at Orleans.Clustering.Kubernetes.KubeMembershipTable.GetClusterVersion() at Orleans.Clustering.Kubernetes.KubeMembershipTable.ReadAll()","State":{"Message":"Failure reading all silo entries for cluster id actors-silo","ClusterId":"actors-silo","{OriginalFormat}":"Failure reading all silo entries for cluster id {ClusterId}"},"Scopes":[]}
Issue Analytics
- State:
- Created 8 months ago
- Reactions:3
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Microsoft.Orleans.Hosting.Kubernetes 7.2.1
Microsoft Orleans hosting support for Kubernetes. ... NET 7.0 .NET CLI; Package Manager; PackageReference; Paket CLI; Script & Interactive; Cake.
Read more >Orleans Clustering Provider for Kubernetes
This provider behaves like any regular application being hosted on Kubernetes. That means it doesn't care about the underlying kubernetes security model. In ......
Read more >Orleans Voting sample app on Kubernetes
This is an Orleans sample application that demonstrates deployment to Kubernetes. The application is a simplistic Web app for voting on a ...
Read more >Microsoft Orleans documentation
Learn to use the Orleans SDK for .NET. Browse API reference, sample code, tutorials, quickstarts, conceptual articles and more.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
https://github.com/OrleansContrib/Orleans.Clustering.Kubernetes/pull/64
Fix here 😃
I can try to fix it by upgrading KubernetesClient to 7.x.y version and switching from NewtonsoftJson to System.Text.Json. The officially supported Kubernetes version would go from 1.22 to 1.23.
Would that be ok with @galvesribeiro ?
cc @SamEmber