Rymote.Synapse.Cluster.Kubernetes 1.0.0

dotnet add package Rymote.Synapse.Cluster.Kubernetes --version 1.0.0
                    
NuGet\Install-Package Rymote.Synapse.Cluster.Kubernetes -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Rymote.Synapse.Cluster.Kubernetes" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Rymote.Synapse.Cluster.Kubernetes" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Rymote.Synapse.Cluster.Kubernetes" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Rymote.Synapse.Cluster.Kubernetes --version 1.0.0
                    
#r "nuget: Rymote.Synapse.Cluster.Kubernetes, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Rymote.Synapse.Cluster.Kubernetes@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Rymote.Synapse.Cluster.Kubernetes&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Rymote.Synapse.Cluster.Kubernetes&version=1.0.0
                    
Install as a Cake Tool

Rymote.Synapse.Cluster.Kubernetes

Kubernetes Endpoints-watching IMembershipProvider for Rymote.Synapse.Cluster. Discovers cluster peers automatically by watching a headless Kubernetes Service's endpoint addresses.

How it works

The provider watches a Kubernetes Endpoints resource (v1 core API) for a named headless Service. Each ready EndpointAddress in the service's subsets becomes a peer node. Pod identity is derived deterministically from stable per-pod environment variables using a GUID v5 (SHA-1 namespace hash) — the same pod always resolves to the same NodeIdentity.

Membership changes (peers joining or leaving) are pushed to subscribers of IMembershipProvider.Changes. The watch runs in a background loop and reconnects automatically with exponential backoff on disconnect (Kubernetes drops watches approximately every 5 minutes).

PublishSubscriptionAsync and WithdrawSubscriptionAsync are no-ops — subscription propagation in Kubernetes deployments is handled peer-to-peer by the cluster's SubscriptionPropagator.

Requirements

In-cluster (default)

  • The pod must run with a service account that has get and list and watch permissions on the endpoints resource in the target namespace.
  • The following environment variables must be present in each pod spec:
Variable Source Purpose
POD_IP status.podIP (Downward API) Self-endpoint IP address
SYNAPSE_NODE_ID Set explicitly, or use HOSTNAME Stable per-pod identity string
HOSTNAME Kubernetes sets automatically Fallback identity source
POD_UID metadata.uid (Downward API) Second fallback identity source

At least one of SYNAPSE_NODE_ID, HOSTNAME, or POD_UID must be set. POD_IP is always required.

Local development (UseLocalKubeconfig = true)

Set UseLocalKubeconfig = true in options to use ~/.kube/config instead of in-cluster service account credentials.

Quickstart

<PackageReference Include="Rymote.Synapse.Cluster.Kubernetes" Version="*" />
services.AddSynapse(builder =>
{
    builder.UseKubernetesMembership(options =>
    {
        options.ServiceName = "my-app-headless";   // name of the headless Service
        options.Namespace   = "production";         // default: "default"
        options.Port        = 8443;                 // Synapse transport port on each pod
    });
});

RBAC example

apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: synapse-endpoints-reader
rules:
  - apiGroups: [""]
    resources: ["endpoints"]
    verbs: ["get", "list", "watch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: synapse-endpoints-reader
subjects:
  - kind: ServiceAccount
    name: default
roleRef:
  kind: Role
  name: synapse-endpoints-reader
  apiGroup: rbac.authorization.k8s.io

Pod spec Downward API example

env:
  - name: POD_IP
    valueFrom:
      fieldRef:
        fieldPath: status.podIP
  - name: POD_UID
    valueFrom:
      fieldRef:
        fieldPath: metadata.uid
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 97 5/18/2026