Code Monkey home page Code Monkey logo

jetski's Introduction

Jetski - the nimble local Kubernetes development environment

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).

License

Apache 2.0 License

Getting started

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
            ];
          };
        }
      );
}

Usage

Create a config file that describe a local Kubernetes instance, for example:

import type { InstanceConfig } from "https://deno.land/x/[email protected]/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 create

To see the complete list of all supported commands, run jetski with no arguments. The currently supported commands are:

  • version: Output the current jetski version in JSON
  • ssh: SSH into an instance's VM
  • create: Create a new instance
  • stop: Shutdown an instance's VM
  • destroy: Destroy an instance
  • start: Start a previously stopped instance
  • reset: A convenient command to destroy then create the instance again

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.