Manifests

Kimono Manifests #

An application environment manifest can be generated and provided to kimono which will not only set env vars when executing your application. But can also generate, template, and drop files in place prior to starting your application.

This is especialy valuable when you have applications which were not developed for the cloud.

Example Manifest #

File: config/manifests/prod/my-app/my-service/backend.yaml

---
env:
  sourcetype: map
  sourcepath: apps/aws/prod/my-app/my-service/backend
  passall: false
  pass:
    - SOME_VAR
files:
  "/tmp/test/test.yaml":
    dest: /tmp/test/test.yaml
    type: yaml
    createpath: true
    sourcepath: app-content/prod/my-app/my-service/backend-config
    sourcetype: map
  "/tmp/test/test.json":
    dest: /tmp/test/test.json
    type: json
    createpath: true
    sourcepath: app-content/prod/my-app/my-service/backend-config
    sourcetype: map
  "/tmp/test/test.toml":
    dest: /tmp/test/test.toml
    type: toml
    createpath: true
    sourcepath: app-content/prod/my-app/my-service/backend-config
    sourcetype: map
  "/tmp/test/test.xml":
    dest: /tmp/test/test.xml
    type: xml
    createpath: true
    sourcepath: app-content/prod/my-app/my-service/backend-config
    sourcetype: map
  "/tmp/test/test.raw":
    dest: /tmp/test/test.raw
    type: text
    createpath: true
    sourcepath: rawdb/test/test
    sourcetype: raw
  "/tmp/test/test.tmpl.raw":
    dest: /tmp/test/test.tmpl.raw
    type: tmpl
    createpath: true
    sourcepath: rawdb/test/test
    sourcetype: raw
    datapath: app-content/prod/my-app/my-service
    datatype: map

restartpolicy:
  always: true
  delay: 5
  pollonrestart: true
background:
  polling: true
  onchange: int
  interval: 60

Execute App #

kimono -type manifest -info -path prod/my-app/my-service/backend env

Docker file #

FROM garnish/kimono:latest AS kimono
FROM ubuntu:latest

# Copy Kimono into your image
COPY --from=kimono /kimono /kimono

# Set Kimono ENV Vars
ENV KIMONO_ADDRESS=http://my-garnish-server
ENV KIMONO_MANIFEST=prod/my-app/my-service/backend
ENV KIMONO_TOKEN=DONT_PUT_TOKEN_IN_AN_IMAGE

# Add custom app stuff here

# Set the entrypoint to be Kimono
ENTRYPOINT /kimono

# Optional if you don't use KIMONO_COMMAND
# CMD ["env"]