Merge pull request #7545 from offlinehacker/pkgs/kubernetes/fixes
kubernetes: update to 0.15, module fixes
This commit is contained in:
commit
f5bc58d733
|
@ -224,7 +224,7 @@ in {
|
||||||
|
|
||||||
machines = mkOption {
|
machines = mkOption {
|
||||||
description = "Kubernetes controller list of machines to schedule to schedule onto";
|
description = "Kubernetes controller list of machines to schedule to schedule onto";
|
||||||
default = [];
|
default = [config.networking.hostName];
|
||||||
type = types.listOf types.str;
|
type = types.listOf types.str;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -310,6 +310,12 @@ in {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
master = mkOption {
|
||||||
|
description = "Kubernetes apiserver address";
|
||||||
|
default = "${cfg.apiserver.address}:${toString cfg.apiserver.port}";
|
||||||
|
type = types.str;
|
||||||
|
};
|
||||||
|
|
||||||
extraOpts = mkOption {
|
extraOpts = mkOption {
|
||||||
description = "Kubernetes proxy extra command line options.";
|
description = "Kubernetes proxy extra command line options.";
|
||||||
default = "";
|
default = "";
|
||||||
|
@ -355,6 +361,7 @@ in {
|
||||||
--secure_port=${toString cfg.apiserver.securePort} \
|
--secure_port=${toString cfg.apiserver.securePort} \
|
||||||
--portal_net=${cfg.apiserver.portalNet} \
|
--portal_net=${cfg.apiserver.portalNet} \
|
||||||
--logtostderr=true \
|
--logtostderr=true \
|
||||||
|
--runtime_config=api/v1beta3 \
|
||||||
${optionalString cfg.verbose "--v=6 --log_flush_frequency=1s"} \
|
${optionalString cfg.verbose "--v=6 --log_flush_frequency=1s"} \
|
||||||
${cfg.apiserver.extraOpts}
|
${cfg.apiserver.extraOpts}
|
||||||
'';
|
'';
|
||||||
|
@ -416,7 +423,6 @@ in {
|
||||||
script = ''
|
script = ''
|
||||||
export PATH="/bin:/sbin:/usr/bin:/usr/sbin:$PATH"
|
export PATH="/bin:/sbin:/usr/bin:/usr/sbin:$PATH"
|
||||||
exec ${cfg.package}/bin/kubelet \
|
exec ${cfg.package}/bin/kubelet \
|
||||||
--etcd_servers=${concatMapStringsSep "," (f: "http://${f}") cfg.etcdServers} \
|
|
||||||
--api_servers=${concatMapStringsSep "," (f: "http://${f}") cfg.kubelet.apiServers} \
|
--api_servers=${concatMapStringsSep "," (f: "http://${f}") cfg.kubelet.apiServers} \
|
||||||
--address=${cfg.kubelet.address} \
|
--address=${cfg.kubelet.address} \
|
||||||
--port=${toString cfg.kubelet.port} \
|
--port=${toString cfg.kubelet.port} \
|
||||||
|
@ -443,7 +449,7 @@ in {
|
||||||
after = [ "network-interfaces.target" "etcd.service" ];
|
after = [ "network-interfaces.target" "etcd.service" ];
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
ExecStart = ''${cfg.package}/bin/kube-proxy \
|
ExecStart = ''${cfg.package}/bin/kube-proxy \
|
||||||
--etcd_servers=${concatMapStringsSep "," (s: "http://${s}") cfg.etcdServers} \
|
--master=${cfg.proxy.master} \
|
||||||
--bind_address=${cfg.proxy.address} \
|
--bind_address=${cfg.proxy.address} \
|
||||||
--logtostderr=true \
|
--logtostderr=true \
|
||||||
${optionalString cfg.verbose "--v=6 --log_flush_frequency=1s"} \
|
${optionalString cfg.verbose "--v=6 --log_flush_frequency=1s"} \
|
||||||
|
|
|
@ -2,25 +2,27 @@
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "kubernetes-${version}";
|
name = "kubernetes-${version}";
|
||||||
version = "0.12.1";
|
version = "0.15.0";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "GoogleCloudPlatform";
|
owner = "GoogleCloudPlatform";
|
||||||
repo = "kubernetes";
|
repo = "kubernetes";
|
||||||
rev = "v${version}";
|
rev = "v${version}";
|
||||||
sha256 = "1891wpssfp04nkk1h4y3cdgn096b0kq16pc0m2fzilbh3daa6pml";
|
sha256 = "1jiczhx01i8czm1gzd232z2ds2f1lvs5ifa9zjabhzw5ykfzdjg8";
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ makeWrapper which go iptables rsync ];
|
buildInputs = [ makeWrapper which go iptables rsync ];
|
||||||
|
|
||||||
preBuild = "patchShebangs ./hack";
|
buildPhase = ''
|
||||||
|
substituteInPlace "hack/lib/golang.sh" --replace "_cgo" ""
|
||||||
postBuild = ''go build --ldflags '-extldflags "-static" -s' build/pause/pause.go'';
|
GOPATH=$(pwd)
|
||||||
|
patchShebangs ./hack
|
||||||
|
hack/build-go.sh --use_go_build
|
||||||
|
'';
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
mkdir -p "$out/bin"
|
mkdir -p "$out/bin"
|
||||||
cp _output/local/go/bin/* "$out/bin/"
|
cp _output/local/go/bin/* "$out/bin/"
|
||||||
cp pause $out/bin/kube-pause
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
preFixup = ''
|
preFixup = ''
|
||||||
|
|
Loading…
Reference in a new issue