Skip to content

Commit

Permalink
Merge pull request #8741 from k8s-infra-cherrypick-robot/cherry-pick-…
Browse files Browse the repository at this point in the history
…8685-to-release-1.3

[release-1.3] 🐛 CAPD: change the haproxy entrypoint to prevent getting stopped immediately after start
  • Loading branch information
k8s-ci-robot committed May 26, 2023
2 parents 82cde2e + 5d688af commit 1bf24ee
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/infrastructure/docker/internal/docker/kind_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ const ControlPlanePort = 6443
// DefaultNetwork is the default network name to use in kind.
const DefaultNetwork = "kind"

// haproxyEntrypoint is the entrypoint used to start the haproxy load balancer container.
var haproxyEntrypoint = []string{"haproxy", "-W", "-db", "-f", "/usr/local/etc/haproxy/haproxy.cfg"}

// Manager is the kind manager type.
type Manager struct{}

Expand All @@ -46,6 +49,7 @@ type nodeCreateOpts struct {
Image string
ClusterName string
Role string
EntryPoint []string
Mounts []v1alpha4.Mount
PortMappings []v1alpha4.PortMapping
Labels map[string]string
Expand Down Expand Up @@ -113,6 +117,7 @@ func (m *Manager) CreateExternalLoadBalancerNode(ctx context.Context, name, imag
ClusterName: clusterName,
Role: constants.ExternalLoadBalancerNodeRoleValue,
PortMappings: portMappings,
EntryPoint: haproxyEntrypoint,
}
node, err := createNode(ctx, createOpts)
if err != nil {
Expand Down Expand Up @@ -143,6 +148,7 @@ func createNode(ctx context.Context, opts *nodeCreateOpts) (*types.Node, error)
// filesystem, which is not only better for performance, but allows
// running kind in kind for "party tricks"
// (please don't depend on doing this though!)
Entrypoint: opts.EntryPoint,
Volumes: map[string]string{"/var": ""},
Mounts: generateMountInfo(opts.Mounts),
PortMappings: generatePortMappings(opts.PortMappings),
Expand Down

0 comments on commit 1bf24ee

Please sign in to comment.