Skip to content

Commit c8b2e6f

Browse files
authored
Add tenant id for Linseed metrics on single tenant with internal elas… (#3963)
* Add tenant id for Linseed metrics on single tenant with internal elasticsearch * Fix! Update CRDs
1 parent cb084c8 commit c8b2e6f

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

pkg/crds/enterprise/crd.projectcalico.org_managedclusters.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ spec:
5252
- type
5353
type: object
5454
type: array
55+
version:
56+
type: string
5557
type: object
5658
type: object
5759
served: true

pkg/render/logstorage/linseed/linseed.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -370,10 +370,8 @@ func (l *linseed) linseedDeployment() *appsv1.Deployment {
370370

371371
replicas := l.cfg.Installation.ControlPlaneReplicas
372372
if l.cfg.Tenant != nil {
373-
if l.cfg.ExternalElastic {
374-
// If a tenant was provided, set the expected tenant ID and enable the shared index backend.
375-
envVars = append(envVars, corev1.EnvVar{Name: "LINSEED_EXPECTED_TENANT_ID", Value: l.cfg.Tenant.Spec.ID})
376-
}
373+
// If a tenant was provided, set the expected tenant ID and enable the shared index backend.
374+
envVars = append(envVars, corev1.EnvVar{Name: "LINSEED_EXPECTED_TENANT_ID", Value: l.cfg.Tenant.Spec.ID})
377375

378376
if l.cfg.Tenant.MultiTenant() {
379377
// For clusters shared between multiple tenants, we need to configure Linseed with the correct namespace information for its tenant.

pkg/render/manager.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -565,10 +565,8 @@ func (c *managerComponent) voltronContainer() corev1.Container {
565565
linseedEndpointEnv := corev1.EnvVar{Name: "VOLTRON_LINSEED_ENDPOINT", Value: fmt.Sprintf("https://tigera-linseed.%s.svc.%s", ElasticsearchNamespace, c.cfg.ClusterDomain)}
566566
if c.cfg.Tenant != nil {
567567
// Configure the tenant id in order to read /write linseed data using the correct tenant ID
568-
// Multi-tenant and single tenant with external elastic needs this variable set
569-
if c.cfg.ExternalElastic {
570-
env = append(env, corev1.EnvVar{Name: "VOLTRON_TENANT_ID", Value: c.cfg.Tenant.Spec.ID})
571-
}
568+
// Multi-tenant and single tenant needs this variable set
569+
env = append(env, corev1.EnvVar{Name: "VOLTRON_TENANT_ID", Value: c.cfg.Tenant.Spec.ID})
572570

573571
// Always configure the Tenant Claim for all multi-tenancy setups (single tenant and multi tenant)
574572
// This will check the tenant claim when a Bearer token is presented to Voltron

0 commit comments

Comments
 (0)