Follow the Kubernetes developmemt Guide and Build
I have used ubuntu 24
- Create a lightsail VM from AWS with atleast 8GB RAM and 50GB of disk space
- Install
NIX
cli. https://nixos.org/download/#nix-install-linux - Install
home-manager
by following https://nix-community.github.io/home-manager/index.xhtml#sec-install-standalone - Install
Docker
https://docs.docker.com/engine/install/ubuntu/ - Configure Docker to run as a non-root user https://docs.docker.com/engine/install/linux-postinstall/
- Create
home.nix
using the home.nix file. - Install
Kubernetes
dependencies using home-manager - Checkout
kubernetes
code from github repo - Build the code using this
{ config, pkgs, ... }:
{
home.username = "ubuntu";
home.homeDirectory = "/home/ubuntu";
home.stateVersion = "24.11"; # Please read the comment before changing.
# The home.packages option allows you to install Nix packages into your
# environment.
home.packages = [
pkgs.hello
pkgs.htop
pkgs.git
pkgs.fortune
pkgs.cowsay
pkgs.jdk23
pkgs.go
pkgs.coreutils-full
pkgs.ed
pkgs.findutils
pkgs.gawk
pkgs.gnused
pkgs.gnutar
pkgs.gnugrep
pkgs.gnumake
pkgs.jq
pkgs.gcc
pkgs.zsh
pkgs.oh-my-zsh
];
home.file = {
};
home.sessionVariables = {
# EDITOR = "emacs";
EDITOR = "vi";
};
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
}
# Copy the home.nix file under $HOME/.config/home-manager/home.nix
vi ~/.config/home-manager/home.nix
# Applies the changes
home-manager switch