mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2025-01-06 04:24:28 +03:00
kubernetes: 1.2.4 -> 1.4.0
This commit is contained in:
parent
5ea6d5fa72
commit
83ee0a0670
@ -1,55 +1,69 @@
|
|||||||
{ stdenv, fetchFromGitHub, which, go, makeWrapper, iptables, rsync, utillinux, coreutils, e2fsprogs, procps-ng }:
|
{ stdenv, lib, fetchFromGitHub, which, go, go-bindata, makeWrapper, rsync
|
||||||
|
, iptables, coreutils
|
||||||
|
, components ? [
|
||||||
|
"cmd/kubectl"
|
||||||
|
"cmd/kubelet"
|
||||||
|
"cmd/kube-apiserver"
|
||||||
|
"cmd/kube-controller-manager"
|
||||||
|
"cmd/kube-proxy"
|
||||||
|
"plugin/cmd/kube-scheduler"
|
||||||
|
"cmd/kube-dns"
|
||||||
|
"federation/cmd/federation-apiserver"
|
||||||
|
"federation/cmd/federation-controller-manager"
|
||||||
|
]
|
||||||
|
}:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "kubernetes-${version}";
|
name = "kubernetes-${version}";
|
||||||
version = "1.2.4";
|
version = "1.4.0";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "kubernetes";
|
owner = "kubernetes";
|
||||||
repo = "kubernetes";
|
repo = "kubernetes";
|
||||||
rev = "v${version}";
|
rev = "v${version}";
|
||||||
sha256 = "1a3y0f1l008ywkwwygg9vn2rb722c54i3pbgqks38gw1yyvgbiih";
|
sha256 = "0q7xwdjsmfrz7pnmylkbkr2yxsl2gzzy17aapfznl2hb1ms81kys";
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ makeWrapper which go iptables rsync ];
|
buildInputs = [ makeWrapper which go rsync go-bindata ];
|
||||||
|
|
||||||
buildPhase = ''
|
outputs = ["out" "man""pause"];
|
||||||
GOPATH=$(pwd):$(pwd)/Godeps/_workspace
|
|
||||||
mkdir -p $(pwd)/Godeps/_workspace/src/k8s.io
|
|
||||||
ln -s $(pwd) $(pwd)/Godeps/_workspace/src/k8s.io/kubernetes
|
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
substituteInPlace "hack/lib/golang.sh" --replace "_cgo" ""
|
substituteInPlace "hack/lib/golang.sh" --replace "_cgo" ""
|
||||||
patchShebangs ./hack
|
patchShebangs ./hack
|
||||||
hack/build-go.sh --use_go_build
|
|
||||||
|
|
||||||
(cd cluster/addons/dns/kube2sky && go build ./kube2sky.go)
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
WHAT="--use_go_build ${concatStringsSep " " components}";
|
||||||
|
|
||||||
|
postBuild = "(cd build/pause && gcc pause.c -o pause)";
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
mkdir -p "$out/bin" "$out"/libexec/kubernetes/cluster
|
mkdir -p "$out/bin" "$man/share/man" "$pause/bin"
|
||||||
cp _output/local/go/bin/{kube*,hyperkube} "$out/bin/"
|
|
||||||
cp cluster/addons/dns/kube2sky/kube2sky "$out/bin/"
|
cp _output/local/go/bin/* "$out/bin/"
|
||||||
cp cluster/saltbase/salt/helpers/safe_format_and_mount "$out/libexec/kubernetes"
|
cp build/pause/pause "$pause/bin/pause"
|
||||||
cp -R hack "$out/libexec/kubernetes"
|
cp -R docs/man/man1 "$man/share/man"
|
||||||
cp cluster/update-storage-objects.sh "$out/libexec/kubernetes/cluster"
|
|
||||||
makeWrapper "$out"/libexec/kubernetes/cluster/update-storage-objects.sh "$out"/bin/kube-update-storage-objects \
|
|
||||||
--prefix KUBE_BIN : "$out/bin"
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
preFixup = ''
|
preFixup = ''
|
||||||
wrapProgram "$out/bin/kube-proxy" --prefix PATH : "${iptables}/bin"
|
wrapProgram "$out/bin/kube-proxy" --prefix PATH : "${iptables}/bin"
|
||||||
wrapProgram "$out/bin/kubelet" --prefix PATH : "${stdenv.lib.makeBinPath [ utillinux procps-ng ]}"
|
wrapProgram "$out/bin/kubelet" --prefix PATH : "${coreutils}/bin"
|
||||||
chmod +x "$out/libexec/kubernetes/safe_format_and_mount"
|
|
||||||
wrapProgram "$out/libexec/kubernetes/safe_format_and_mount" --prefix PATH : "${stdenv.lib.makeBinPath [ e2fsprogs utillinux ]}"
|
# Remove references to go compiler
|
||||||
substituteInPlace "$out"/libexec/kubernetes/cluster/update-storage-objects.sh \
|
while read file; do
|
||||||
--replace KUBE_OUTPUT_HOSTBIN KUBE_BIN
|
cat $file | sed "s,${go},$(echo "${go}" | sed "s,$NIX_STORE/[^-]*,$NIX_STORE/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee,"),g" > $file.tmp
|
||||||
|
mv $file.tmp $file
|
||||||
|
chmod +x $file
|
||||||
|
done < <(find $out/bin $pause/bin -type f 2>/dev/null)
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = {
|
||||||
description = "Production-Grade Container Scheduling and Management";
|
description = "Production-Grade Container Scheduling and Management";
|
||||||
license = licenses.asl20;
|
license = licenses.asl20;
|
||||||
homepage = http://kubernetes.io;
|
homepage = http://kubernetes.io;
|
||||||
maintainers = with maintainers; [offline];
|
maintainers = with maintainers; [offline];
|
||||||
platforms = [ "x86_64-linux" ];
|
platforms = platforms.linux;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user