Rework the gRPC logger by using hand-rolled simple version, rework version parsing to remove regexp matching. The baseline (via benchmark): ``` BenchmarkViaClientSimulator-32 2934 387398 ns/op 101921 B/op 832 allocs/op ``` The baseline + removed logging middleware: ``` BenchmarkViaClientSimulator-32 3543 331166 ns/op 73581 B/op 543 allocs/op ``` Reworked logging middleware: ``` BenchmarkViaClientSimulator-32 3394 334066 ns/op 77985 B/op 568 allocs/op ``` Plus reworked version parsing: ``` BenchmarkViaClientSimulator-32 3510 325714 ns/op 66215 B/op 561 allocs/op ``` So overall, baseline to this PR: * allocs 101921 -> 66215 B/op * alloc ops 832 -> 561 allocs/op Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
Talos Discovery Service (for KubeSpan)
Discovery Service provides cluster membership and KubeSpan peer information for Talos clusters.
Overview
Discovery Service provides centralized service for Talos nodes to exchange information about nodes of the cluster.
Talos runs "official" instance of the service, and anyone can run their own instance on-prem or in the cloud.
Discovery service doesn't store any data, all data is ephemeral and is kept only in memory. Node information is expired (if not updated) after 30 minutes. Discovery service doesn't see actual node information, it only stores and updates encrypted blobs. Discovery data should be submitted encrypted by the client, and service doesn't have the encryption key.
The project has been split into 3 parts (as they have different source code licenses), namely:
- This repository
- Discovery Client, contains the client code to interact with the server
- Discovery Service API, provides gRPC API definition and cluster data protobuf data structures
Setup
All of the details to get started are present in the Makefile, start with make help
.
Interacting
Once the application is running you can test the grpc functionality on the port 3000 and the http pages in browser on port 3001.
To test the grpc calls, install grpcurl and clone the Discovery Service API repository.
-
Sample code-block to test the grpc
Hello
call (change path accordingly)grpcurl -proto v1alpha1/server/cluster.proto -import-path PATH_TO_REPO/discovery-api/api -plaintext -d '{"clusterId": "abc"}' -H 'X-Real-IP: 1.2.3.4' localhost:3000 sidero.discovery.server.Cluster/Hello