Intro and Concepts

kdd is a command-line utility to streamline Kubernetes-driven development and deployment. It does NOT have any runtime components or even builds ones. kdd is just a way to structure a cloud application into a multi-service Kubernetes oriented system and streamline docker, kubectl, and cloud cli into a single command line set.

Each system have one kdd.yaml file, with two main constructs:

Install

From cargo (recommended for now):

sh cargo install kdd

Advanced: Install from Binary

Example

The kdd.yaml is at the root of the sytem with the following model.

Full example at Cloud Starter

```yaml system: cstar imagetag: "{{version}}" blockbase_dir: services/

blocks: - common - webserver - agent - redisqueue - db - name: web dir: frontends/web/ - name: web-server dependencies: ['common','web'] # build dependency for when running dbuild (no effect on build).

realms: base:
webexternalports: 8080

dev: yamldir: k8s/dev/ # for dev, we override the yamlDir context: docker-desktop devstuff: Some dev stuff confirm_delete: false

aws: yamldir: k8s/aws/ context: arn:aws:eks:us-west-2:843615417314:cluster/cstar-cluster profile: jc-root registry: 843615417314.dkr.ecr.us-west-2.amazonaws.com/ defaultconfigurations: ['agent', 'db', 'queue', 'web-server'] confirm_delete: false

builders: - name: npminstall whenfile: ./package.json exec: cmd: npm cmdtype: global # basedir | blockdir args: ["install", "--color"] - name: tsc whenfile: ./tsconfig.json exec: cmd: nodemodules/.bin/tsc - name: rollup whenfile: ./rollup.config.js replace: tsc # rollup has rollup-ts, so no need to do it twice exec: cmd: nodemodules/.bin/rollup args: ["-c"] - name: pcss whenfile: ./pcss.config.js exec: cmd: node_modules/.bin/pcss ```

Command examples:

```sh

Change realms to dev

kdd realm dev

Build docker blocks (and their dependencies)

kdd dbuild

build per block name (no space)

kdd dbuild agent,web-server

docker push docker images to the current realm to the registry

kdd dpush

push only some docker images

kdd dpush agent,web-server

execute a kubectl apply for all default configurations

kdd kapply

selectively doing kubectl apply (push image before)

kdd kapply web-server,agent

kdd kdelete, kdd kcreate, kdd kexec ... for the kubectl equivalents

```

Install with binst

(mac / linux only for now)

Install binst first.

sh binst install -r https://binst.io/jc-repo kdd