Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds DrainConnectionsTimeout microcluster configuration #867

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/k8s/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ require (
golang.org/x/mod v0.21.0
golang.org/x/net v0.30.0
golang.org/x/sync v0.8.0
golang.org/x/sys v0.27.0
golang.org/x/sys v0.28.0
gopkg.in/yaml.v2 v2.4.0
helm.sh/helm/v3 v3.15.3
k8s.io/api v0.31.3
Expand Down Expand Up @@ -181,3 +181,5 @@ require (
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
)

replace github.com/canonical/microcluster/v2 => github.com/claudiubelu/microcluster/v2 v2.0.0-20241211230101-f5ddb1da2a47
8 changes: 4 additions & 4 deletions src/k8s/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ github.com/canonical/k8s-snap-api v1.0.15 h1:uhEJiEhrK93tJAly+quuAayanMhT/5vpePl
github.com/canonical/k8s-snap-api v1.0.15/go.mod h1:LDPoIYCeYnfgOFrwVPJ/4edGU264w7BB7g0GsVi36AY=
github.com/canonical/lxd v0.0.0-20241106165613-4aab50ec18c3 h1:1OAWxun8+xS5vQta/GTSIVoTP6uDP4uD9eR93UbTWiw=
github.com/canonical/lxd v0.0.0-20241106165613-4aab50ec18c3/go.mod h1:ORoLmeSj+tQmUgh10kLA9eMtRnbBZPT6X10V2I4cTGs=
github.com/canonical/microcluster/v2 v2.1.0 h1:jEycvk2vu8XH5SaT4GatqymCOmY7Bhj/mOM4d8XN13c=
github.com/canonical/microcluster/v2 v2.1.0/go.mod h1:Aofp11LCtIpIm8OdkQRpl7RWXYtLMTE+B+SOE0gcyAE=
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/chai2010/gettext-go v1.0.2 h1:1Lwwip6Q2QGsAdl/ZKPCwTe9fe0CjlUbqj5bFNSjIRk=
github.com/chai2010/gettext-go v1.0.2/go.mod h1:y+wnP2cHYaVj19NZhYKAwEMH2CI1gNHeQQ+5AjwawxA=
github.com/claudiubelu/microcluster/v2 v2.0.0-20241211230101-f5ddb1da2a47 h1:y76FVyXL2OQJs6CSCN6KikUcsLukMk65lBz/0IoVv2Y=
github.com/claudiubelu/microcluster/v2 v2.0.0-20241211230101-f5ddb1da2a47/go.mod h1:wG2DsOefwQOaYffOUJsKp6XLUdpjHIpyF6cQ6gJHndU=
github.com/containerd/cgroups v1.1.0 h1:v8rEWFl6EoqHB+swVNjVoCJE8o3jX7e8nqBGPLaDFBM=
github.com/containerd/cgroups v1.1.0/go.mod h1:6ppBcbh/NOOUU+dMKrykgaBnK9lCIBxHqJDGwsa1mIw=
github.com/containerd/containerd v1.7.13 h1:wPYKIeGMN8vaggSKuV1X0wZulpMz4CrgEsZdaCyB6Is=
Expand Down Expand Up @@ -519,8 +519,8 @@ golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s=
golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA=
golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc=
Expand Down
2 changes: 2 additions & 0 deletions src/k8s/pkg/k8sd/api/endpoints.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package api

import (
"context"
"time"

apiv1 "github.com/canonical/k8s-snap-api/api/v1"
"github.com/canonical/microcluster/v2/rest"
Expand Down Expand Up @@ -31,6 +32,7 @@ func New(ctx context.Context, provider Provider) map[string]rest.Server {
Endpoints: k8sd.Endpoints(),
},
},
DrainConnectionsTimeout: 10 * time.Second,
},
}
}
Expand Down
13 changes: 7 additions & 6 deletions src/k8s/pkg/k8sd/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,12 +220,13 @@ func (a *App) Run(ctx context.Context, customHooks *state.Hooks) error {
}

err := a.cluster.Start(ctx, microcluster.DaemonArgs{
Version: string(apiv1.K8sdAPIVersion),
Verbose: a.config.Verbose,
Debug: a.config.Debug,
Hooks: hooks,
ExtensionServers: api.New(ctx, a),
ExtensionsSchema: database.SchemaExtensions,
Version: string(apiv1.K8sdAPIVersion),
Verbose: a.config.Verbose,
Debug: a.config.Debug,
Hooks: hooks,
ExtensionServers: api.New(ctx, a),
ExtensionsSchema: database.SchemaExtensions,
DrainConnectionsTimeout: 10 * time.Second,
})
if err != nil {
return fmt.Errorf("failed to run microcluster: %w", err)
Expand Down
Loading