Skip to content

Commit 12f1de5

Browse files
authored
Merge pull request #8685 from chrischdi/pr-reproduce-lb-ct-issue
🐛 CAPD: change the haproxy entrypoint to prevent getting stopped immediately after start
2 parents 83b8694 + a0c371c commit 12f1de5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/infrastructure/docker/internal/docker/kind_manager.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ const ControlPlanePort = 6443
3838
// DefaultNetwork is the default network name to use in kind.
3939
const DefaultNetwork = "kind"
4040

41+
// haproxyEntrypoint is the entrypoint used to start the haproxy load balancer container.
42+
var haproxyEntrypoint = []string{"haproxy", "-W", "-db", "-f", "/usr/local/etc/haproxy/haproxy.cfg"}
43+
4144
// Manager is the kind manager type.
4245
type Manager struct{}
4346

@@ -46,6 +49,7 @@ type nodeCreateOpts struct {
4649
Image string
4750
ClusterName string
4851
Role string
52+
EntryPoint []string
4953
Mounts []v1alpha4.Mount
5054
PortMappings []v1alpha4.PortMapping
5155
Labels map[string]string
@@ -113,6 +117,7 @@ func (m *Manager) CreateExternalLoadBalancerNode(ctx context.Context, name, imag
113117
ClusterName: clusterName,
114118
Role: constants.ExternalLoadBalancerNodeRoleValue,
115119
PortMappings: portMappings,
120+
EntryPoint: haproxyEntrypoint,
116121
}
117122
node, err := createNode(ctx, createOpts)
118123
if err != nil {
@@ -143,6 +148,7 @@ func createNode(ctx context.Context, opts *nodeCreateOpts) (*types.Node, error)
143148
// filesystem, which is not only better for performance, but allows
144149
// running kind in kind for "party tricks"
145150
// (please don't depend on doing this though!)
151+
Entrypoint: opts.EntryPoint,
146152
Volumes: map[string]string{"/var": ""},
147153
Mounts: generateMountInfo(opts.Mounts),
148154
PortMappings: generatePortMappings(opts.PortMappings),

0 commit comments

Comments
 (0)