kubelet.scm 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. (use-modules (gnu packages base)
  2. (gnu packages bash)
  3. (gnu packages compression)
  4. (gnu packages docker)
  5. (gnu packages linux)
  6. (gnu packages package-management)
  7. (guix build utils)
  8. (guix gexp)
  9. (guix store)
  10. (packages kubernetes))
  11. (define coredns-image
  12. (local-file "/nix/store/1crdy15nv25jpbvknrzyhg6khv9ikhl9-docker-image-coredns-coredns-1.7.1.tar"))
  13. (define pause-image
  14. (local-file "/nix/store/xjlwhyqjhx0j2sc41wfpsw1zvhn98vh5-docker-image-pause.tar.gz"))
  15. (run-with-store (open-connection)
  16. (gexp->derivation
  17. "kubelet"
  18. (with-imported-modules '((guix build utils))
  19. #~(begin
  20. (use-modules (guix build utils))
  21. (let* ((bin (string-append #$output "/bin"))
  22. (kubelet.sh (string-append bin "/kubelet.sh")))
  23. (mkdir-p bin)
  24. (copy-file #$(local-file "dot_local/bin/executable_kubelet")
  25. kubelet.sh)
  26. (chmod kubelet.sh #o555)
  27. (setenv "PATH" (string-append #$(file-append tar "/bin")
  28. ":" #$(file-append gzip "/bin")
  29. ":" #$(file-append bash "/bin")))
  30. (patch-shebang kubelet.sh)
  31. (wrap-program kubelet.sh
  32. '("KUBELET_COREDNS_IMAGE" "" = (#$coredns-image))
  33. '("KUBELET_PAUSE_IMAGE" "" = (#$pause-image))
  34. '("PATH" ":" = (#$(file-append containerd "/bin")
  35. #$(file-append coreutils "/bin")
  36. #$(file-append grep "/bin")
  37. #$(file-append gzip "/bin")
  38. #$(file-append kmod "/bin")
  39. "/nix/store/lp8ch8l5dn4bcp056cpr1gfyb9i8zi54-kubernetes-1.25.4/bin"
  40. #$(file-append util-linux "/bin")))))))))