summary refs log tree commit diff
path: root/pkgs/applications/networking/cluster/kubernetes/default.nix
blob: 7f3eef7554c61100c6cfe40fbd3801370a676949 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
{ stdenv, fetchFromGitHub, which, go, makeWrapper, iptables,rsync }:

stdenv.mkDerivation rec {
  name = "kubernetes-${version}";
  version = "v0.5.4";

  src = fetchFromGitHub {
    owner = "GoogleCloudPlatform";
    repo = "kubernetes";
    rev = version;
    sha256 = "1pipcqpjz9zsi4kfsbdvbbbia642l4xg50pznjw5v061c5xk7vnk";
  };

  buildInputs = [ makeWrapper which go iptables rsync ];

  postBuild = ''go build --ldflags '-extldflags "-static" -s' build/pause/pause.go'';

  installPhase = ''
    mkdir -p "$out/bin"
    cp _output/local/go/bin/* "$out/bin/"
    cp pause $out/bin/kube-pause
  '';

  preFixup = ''
    wrapProgram "$out/bin/kube-proxy" --set "PATH" "${iptables}/bin"
  '';

  meta = with stdenv.lib; {
    description = "Open source implementation of container cluster management.";
    license = licenses.asl20;
    homepage = https://github.com/GoogleCloudPlatform;
    maintainers = with maintainers; [offline];
    platforms = [ "x86_64-linux" ];
  };
}