jetski is a CLI tool built on top of multipass and k3s to create an ideal local Kubernetes development experience.
It embraces Infrastructure as Code practice and allows you to manage multiple local Kubernetes instances via their own type-safe config files. On top of that, it manages local routes and DNS rules such that you can access Kubernetes Services and/or Pods directly via their respective DNS names, Service IPs or ClusterIPs from all your local tools. It's "magical", and once you have tried it, there's no going back.
jetski has first-class support for all common Operating Systems, including macOS (both Intel and Apple Silicon architectures), Windows via WSL 2 and Linux (both amd64 and arm64).
First, install multipass on your local development computer.
Then obtain jetski in your Nix shell. You can simply add it as a Nix flake input to your existing flake.nix. For example:
{
# ...
inputs = {
# ...
jetski.url = "github:shopstic/jetski";
};
outputs = { self, nixpkgs, flakeUtils, /* ... ,*/ jetski }:
flakeUtils.lib.eachDefaultSystem
(system:
let
jetskiBin = jetski.defaultPackage.${system};
in
{
devShell = pkgs.mkShellNoCC rec {
buildInputs = [
jetskiBin
];
};
}
);
}Create a config file that describe a local Kubernetes instance, for example:
import type { InstanceConfig } from "https://deno.land/x/jetski@1.0.0/types.ts";
const config: InstanceConfig = {
name: "local",
image: "focal",
cpus: 1,
memoryGiBs: 1,
diskGiBs: 4,
k3sVersion: "v1.21.9+k3s1",
clusterCidr: "10.254.254.0/24",
serviceCidr: "10.254.255.0/24",
clusterDnsIp: "10.254.255.10",
clusterDomain: "jetski.local",
nodeLabels: {
"com.jetski/foo": "bar",
"com.jetski/baz": "boo",
},
sshDirectoryPath: "./local/.ssh",
};
export default config;Then simply launch it via a single command:
jetski --config /path/to/instance-config.ts createTo see the complete list of all supported commands, run jetski with no arguments. The currently supported commands are:
version: Output the currentjetskiversion in JSONssh: SSH into an instance's VMcreate: Create a new instancestop: Shutdown an instance's VMdestroy: Destroy an instancestart: Start a previously stopped instancereset: A convenient command todestroythencreatethe instance again