Commit 15d7b619 authored by Brian Downs's avatar Brian Downs

Merge remote-tracking branch 'upstream/master' into issue-112

parents bb8e5374 f72d39ad
......@@ -12,7 +12,7 @@ If you're interested in contributing documentation, please note the following:
## Developer Certificate Of Origin ##
To contribute to this project, you must agree to the Developer Certificate of Origin (DCO) for each commit you make. The DCO is a simple statement that you, as a contributor, have the legal rite to make the contribution.
To contribute to this project, you must agree to the Developer Certificate of Origin (DCO) for each commit you make. The DCO is a simple statement that you, as a contributor, have the legal right to make the contribution.
See the [DCO](DCO) file for the full text of what you must agree to.
......
......@@ -29,3 +29,7 @@ generate: build/data
build/data:
mkdir -p $@
.PHONY: binary-size-check
binary-size-check:
scripts/binary_size_check.sh
......@@ -70,7 +70,7 @@ There are two major ways that K3s is lighter weight than upstream Kubernetes:
1. The memory footprint to run it is smaller
2. The binary, which contains all the non-containerized components needed to run a cluster, is smaller
The memory footprint is reduced primarily by running many components inside of single process. This eliminates significant overhead that would otherwise be duplicated for each component.
The memory footprint is reduced primarily by running many components inside of a single process. This eliminates significant overhead that would otherwise be duplicated for each component.
The binary is smaller by removing third-party storage drivers and cloud providers, which is explained in more detail below.
......
......@@ -3,7 +3,6 @@ package cmds
import (
"context"
"github.com/rancher/k3s/pkg/daemons/config"
"github.com/rancher/k3s/pkg/version"
"github.com/urfave/cli"
)
......@@ -60,7 +59,7 @@ type Server struct {
ClusterReset bool
ClusterResetRestorePath string
EncryptSecrets bool
StartupHooks []func(context.Context, config.Control) error
StartupHooks []func(context.Context, <-chan struct{}, string) error
EtcdDisableSnapshots bool
EtcdSnapshotDir string
EtcdSnapshotCron string
......
......@@ -61,7 +61,7 @@ func StartServer(ctx context.Context, config *Config) error {
}
for _, hook := range config.StartupHooks {
if err := hook(ctx, config.ControlConfig); err != nil {
if err := hook(ctx, config.ControlConfig.Runtime.APIServerReady, config.ControlConfig.Runtime.KubeConfigAdmin); err != nil {
return errors.Wrap(err, "startup hook")
}
}
......
......@@ -12,5 +12,5 @@ type Config struct {
ControlConfig config.Control
Rootless bool
SupervisorPort int
StartupHooks []func(context.Context, config.Control) error
StartupHooks []func(context.Context, <-chan struct{}, string) error
}
#!/bin/sh
set -e
if [ "${DEBUG}" = 1 ]; then
set -x
fi
MAX_BINARY_SIZE=61000000
SIZE=$(ls -l dist/artifacts/k3s | awk -F ' ' '{print $5}')
if [ ${SIZE} -gt ${MAX_BINARY_SIZE} ]; then
echo "k3s binary exceeds acceptable size of "${MAX_BINARY_SIZE}
exit 1
fi
exit 0
......@@ -7,5 +7,7 @@ cd $(dirname $0)
if [ -z "$SKIP_VALIDATE" ]; then
./validate
fi
./build
./package
./binary_size_check.sh
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment