Kubes: Kubernetes Deployment Tool

Kubes is a Kubernetes Deployment Tool. It builds the docker image, creates the Kubernetes YAML, and runs kubectl apply. It automates the deployment process and saves you precious finger-typing energy.

The Code

Easy to learn


Commands

kubes init
kubes docker build
kubes docker push
kubes compile
kubes deploy
kubes apply
kubes get
kubes exec
kubes logs
kubes delete -y

Structure

.kubes
└── resources
    ├── clock
    │   └── deployment.yaml
    ├── worker
    │   └── deployment.yaml
    └── web
        ├── deployment.yaml
        └── service.yaml

Init Generator

$ kubes init --app demo --repo user/repo                                                               ⎈ (gke-dev/demo)
      create  .kubes/config.rb
      create  .kubes/config/env/dev.rb
      create  .kubes/config/env/prod.rb
      create  .kubes/resources/web/deployment.yaml
      create  .kubes/resources/web/deployment/dev.yaml
      create  .kubes/resources/web/deployment/prod.yaml
      create  .kubes/resources/web/service.yaml
Initialized .kubes folder
Updated .gitignore
$

Deploy

$ kubes deploy
=> docker build -t user/demo-web:kubes-2020-06-19T00-20-28-1ef4db6 -f Dockerfile .
Successfully built 1c5b10652c36
=> docker push user/demo-web:kubes-2020-06-19T00-20-28-1ef4db6
Compiled  .kubes/resources files
Deploying kubes files
=> kubectl apply -f .kubes/output/web/service.yaml
service/demo-web created
=> kubectl apply -f .kubes/output/web/deployment.yaml
deployment.apps/demo-web created
=> kubectl apply -f .kubes/output/web/ingress.yaml
ingress.networking.k8s.io/demo-web created
$

YAML

---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: demo-web
  labels:
    app: demo
  namespace: default
spec:
  replicas: 2
  selector:
    matchLabels:
      app: demo
  template:
    metadata:
      labels:
        app: demo
    spec:
      containers:
      - name: demo-web
        image: <%= built_image %>

DSL

name "demo-web"
namespace "default"
labels(role: "web")

replicas 2
image built_image # IE: user/demo-web:kubes-2020-06-13T19-55-16-43afc6e

Learn More

Quick Start