Skip to content

Commit

Permalink
use .<namespace>.svc for HA-rqlite (#5021)
Browse files Browse the repository at this point in the history
  • Loading branch information
laverya authored Nov 25, 2024
1 parent 707d5bc commit e87a657
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
8 changes: 4 additions & 4 deletions pkg/ha/ha_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ func TestEnableHA(t *testing.T) {
Name: "rqlite",
Args: []string{
"-disco-mode=dns",
"-disco-config={\"name\":\"kotsadm-rqlite-headless\"}",
"-disco-config={\"name\":\"kotsadm-rqlite-headless.default.svc\"}",
"-bootstrap-expect=1",
"-auth=/auth/config.json",
"-join-as=kotsadm",
Expand All @@ -333,7 +333,7 @@ func TestEnableHA(t *testing.T) {
wantReplicas: 3,
wantArgs: []string{
"-disco-mode=dns",
"-disco-config={\"name\":\"kotsadm-rqlite-headless\"}",
"-disco-config={\"name\":\"kotsadm-rqlite-headless.default.svc\"}",
"-bootstrap-expect=3",
"-auth=/auth/config.json",
"-join-as=kotsadm",
Expand All @@ -360,7 +360,7 @@ func TestEnableHA(t *testing.T) {
Name: "rqlite",
Args: []string{
"-disco-mode=dns",
"-disco-config={\"name\":\"kotsadm-rqlite-headless\"}",
"-disco-config={\"name\":\"kotsadm-rqlite-headless.default.svc\"}",
"-bootstrap-expect=1",
"-auth=/auth/config.json",
"-join-as=kotsadm",
Expand All @@ -380,7 +380,7 @@ func TestEnableHA(t *testing.T) {
wantReplicas: 3,
wantArgs: []string{
"-disco-mode=dns",
"-disco-config={\"name\":\"kotsadm-rqlite-headless\"}",
"-disco-config={\"name\":\"kotsadm-rqlite-headless.default.svc\"}",
"-bootstrap-expect=3",
"-auth=/auth/config.json",
"-join-as=kotsadm",
Expand Down
5 changes: 4 additions & 1 deletion pkg/kotsadm/objects/rqlite_objects.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package kotsadm

import (
"fmt"
"github.com/pkg/errors"
"github.com/replicatedhq/kots/pkg/k8sutil"
"github.com/replicatedhq/kots/pkg/kotsadm/types"
Expand Down Expand Up @@ -57,6 +58,8 @@ func RqliteStatefulset(deployOptions types.DeployOptions, size resource.Quantity
podLabels[k] = v
}

rqliteDiscoveryFlag := fmt.Sprintf(`-disco-config={"name":"kotsadm-rqlite-headless.%s.svc"}`, deployOptions.Namespace)

statefulset := &appsv1.StatefulSet{
TypeMeta: metav1.TypeMeta{
APIVersion: "apps/v1",
Expand Down Expand Up @@ -132,7 +135,7 @@ func RqliteStatefulset(deployOptions types.DeployOptions, size resource.Quantity
Name: "rqlite",
Args: []string{
"-disco-mode=dns",
"-disco-config={\"name\":\"kotsadm-rqlite-headless\"}",
rqliteDiscoveryFlag,
"-bootstrap-expect=1",
"-auth=/auth/config.json",
"-join-as=kotsadm",
Expand Down

0 comments on commit e87a657

Please sign in to comment.