livecycle / deploykit

A Deno toolkit for generating deployment configuration files based on Typescript
MIT License
11 stars 1 forks source link

Deploykit

A Deno based toolkit for generating deployment configuration files using typescript with focus on k8s resources.\ Inspired by Pulumi, JKCfg, ts-kubernetes-models, CDK, Helm and others...

** This project is in very early and experimental stage

Quick example

deploy.ts (./examples/deploy.ts)

import { createMicroservice } from "https://deno.land/x/deploykit@0.0.24/blueprint/k8s/app.ts";
import {
  addDeployment,
  addService,
  expose,
} from "https://deno.land/x/deploykit@0.0.24/blueprint/k8s/operators/all.ts";

createMicroservice().with(
  addDeployment({ image: "my-image" }),
  addService({ port: 80 }),
  expose({ domain: "my-app.com" }),
).dump(
  { name: "my-app", namespace: "my-namespace", labels: { app: "my-app" } },
);

Run deno run https://raw.githubusercontent.com/Yshayy/deploykit/master/examples/deploy.ts

Output ```yaml apiVersion: extensions/v1beta1 kind: Ingress spec: rules: - host: my-app.com http: paths: - backend: serviceName: my-app servicePort: 80 metadata: name: my-app namespace: my-namespace labels: app: my-app --- apiVersion: v1 kind: Service spec: ports: - port: 80 targetPort: 80 metadata: name: my-app namespace: my-namespace labels: app: my-app --- apiVersion: apps/v1 kind: Deployment spec: selector: matchLabels: app: my-app template: metadata: labels: app: my-app spec: containers: - name: app image: my-image metadata: name: my-app namespace: my-namespace labels: app: my-app ```

Usage with kubectl:\ deno run ./deploy.ts | kubectl apply -f -

Why Deno?

Deno brings back some of the script-y aspects of JS and the web, but with the safety of Typescript. It has several advantages such as:

These capabilies allow us to easily create a single deploy.ts file that is easy to manage, execute, extend, integrate in CI/CD.

Why Typescript

TBD

What's Inside

Compared to other solutions

TBD

Roadmap

TBD