Skip to content

Commit f95e8ca

Browse files
committed
feat: run embedded discovery service in Omni
Run a discovery service instance inside Omni (enabled by default). It listens only on the SideroLink interface on port 8093. Clusters can opt in to use this embedded discovery service instead of the `discovery.talos.dev`. It is added as a new cluster feature both on frontend and in cluster templates. Closes #20. Signed-off-by: Utku Ozdemir <[email protected]>
1 parent ed26122 commit f95e8ca

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1687
-870
lines changed

client/api/omni/specs/omni.pb.go

Lines changed: 763 additions & 721 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/api/omni/specs/omni.proto

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,8 @@ message ClusterSpec {
250250
bool enable_workload_proxy = 1;
251251
// DiskEncryption enables disk encryption on all nodes.
252252
bool disk_encryption = 2;
253+
// UseEmbeddedDiscoveryService enables the embedded discovery service.
254+
bool use_embedded_discovery_service = 3;
253255
}
254256

255257
// InstallImage the installer image to use.
@@ -500,6 +502,11 @@ message ClusterStatusSpec {
500502
bool kubernetesAPIReady = 5;
501503
bool controlplaneReady = 6;
502504
bool has_connected_control_planes = 7;
505+
506+
// UseEmbeddedDiscoveryService indicates if the embedded discovery service should be used by this cluster or not.
507+
//
508+
// This is the final decision, taking the feature toggle, the version of the cluster and the Omni instance configuration (whether the feature is enabled or not) into account.
509+
bool use_embedded_discovery_service = 8;
503510
}
504511

505512
// ClusterUUID keeps the UUID of the cluster.
@@ -870,6 +877,9 @@ message FeaturesConfigSpec {
870877

871878
// EtcdBackupSettings represents omni etcd backup settings.
872879
EtcdBackupSettings etcd_backup_settings = 2;
880+
881+
// EmbeddedDiscoveryService enables the embedded discovery service.
882+
bool embedded_discovery_service = 3;
873883
}
874884

875885
message EtcdBackupSettings {

client/api/omni/specs/omni_vtproto.pb.go

Lines changed: 111 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/pkg/template/internal/models/cluster.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ type Features struct {
5555
DiskEncryption bool `yaml:"diskEncryption,omitempty"`
5656
// EnableWorkloadProxy enables workload proxy.
5757
EnableWorkloadProxy bool `yaml:"enableWorkloadProxy,omitempty"`
58+
// UseEmbeddedDiscoveryService enables the use of embedded discovery service.
59+
UseEmbeddedDiscoveryService bool `yaml:"useEmbeddedDiscoveryService,omitempty"`
5860
// BackupConfiguration contains backup configuration settings.
5961
BackupConfiguration BackupConfiguration `yaml:"backupConfiguration,omitempty"`
6062
}
@@ -155,7 +157,8 @@ func (cluster *Cluster) Translate(ctx TranslateContext) ([]resource.Resource, er
155157
cluster.Descriptors.Apply(clusterResource)
156158

157159
clusterResource.TypedSpec().Value.Features = &specs.ClusterSpec_Features{
158-
EnableWorkloadProxy: cluster.Features.EnableWorkloadProxy,
160+
EnableWorkloadProxy: cluster.Features.EnableWorkloadProxy,
161+
UseEmbeddedDiscoveryService: cluster.Features.UseEmbeddedDiscoveryService,
159162
}
160163

161164
clusterResource.TypedSpec().Value.KubernetesVersion = strings.TrimLeft(cluster.Kubernetes.Version, "v")

client/pkg/template/operations/export.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,9 @@ func transformClusterToModel(cluster *omni.Cluster, patches []*omni.ConfigPatch)
331331
Version: "v" + spec.GetTalosVersion(),
332332
},
333333
Features: models.Features{
334-
DiskEncryption: spec.GetFeatures().GetDiskEncryption(),
335-
EnableWorkloadProxy: spec.GetFeatures().GetEnableWorkloadProxy(),
334+
DiskEncryption: spec.GetFeatures().GetDiskEncryption(),
335+
EnableWorkloadProxy: spec.GetFeatures().GetEnableWorkloadProxy(),
336+
UseEmbeddedDiscoveryService: spec.GetFeatures().GetUseEmbeddedDiscoveryService(),
336337
BackupConfiguration: models.BackupConfiguration{
337338
Interval: backupIntervalDuration,
338339
},

client/pkg/template/operations/testdata/export/cluster-resources.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ spec:
2525
features:
2626
enableworkloadproxy: true
2727
diskencryption: true
28+
useembeddeddiscoveryservice: true
2829
backupconfiguration:
2930
interval:
3031
seconds: 7200

client/pkg/template/operations/testdata/export/cluster-template.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ talos:
1212
features:
1313
diskEncryption: true
1414
enableWorkloadProxy: true
15+
useEmbeddedDiscoveryService: true
1516
backupConfiguration:
1617
interval: 2h0m0s
1718
patches:

client/pkg/template/testdata/cluster-valid-bootstrapspec-resources.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ spec:
1616
features:
1717
enableworkloadproxy: false
1818
diskencryption: false
19+
useembeddeddiscoveryservice: false
1920
backupconfiguration: null
2021
---
2122
metadata:

client/pkg/template/testdata/cluster1-resources.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ spec:
1616
features:
1717
enableworkloadproxy: false
1818
diskencryption: true
19+
useembeddeddiscoveryservice: false
1920
backupconfiguration: null
2021
---
2122
metadata:

client/pkg/template/testdata/cluster2-resources.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ spec:
1616
features:
1717
enableworkloadproxy: true
1818
diskencryption: false
19+
useembeddeddiscoveryservice: true
1920
backupconfiguration: null
2021
---
2122
metadata:

0 commit comments

Comments
 (0)