Skip to main content

Project Eastern

Travis GitHub license Read the Docs PyPI Docker Hub

A Kubernetes templating and deployment tool.

Table of Contents

Features

  • Simple, logicless template engine designed for YAML
  • Work with multiple environments
  • In use in production at Wongnai
  • Extensible plugin architecture

Installation

Note that Eastern requires kubectl.

Installing from PyPI

Run pip install eastern to install.

Running from Docker Image

Eastern is available on Docker Hub for continuous delivery users.

docker run -v `pwd`:/projects/ --rm wongnai/eastern eastern generate /projects/kubernetes.yaml

Installing from Git

  1. Clone this repository
  2. Run python3 setup.py install. You might to run this as root.
  3. Run eastern to verify that it is installed.

Usage

Template language

At its core, Eastern is a YAML templating tool. Eastern provides the following commands as YAML comment.

  • load? file_1.yaml, file_2.yaml ...: Load the first file available
  • load! file_1.yaml, file_2.yaml ...: Same as load? but throw when no file is loaded.

The file name and contents may contains variable interpolation. Available variable is

  • ${NAMESPACE}: Name of namespace

Additional variables can be passed by -s var=value.

For example:

image: wongnai/eastern:${IMAGE_TAG}
env:
  # load! env-${NAMESPACE}.yaml, env.yaml

See full deployment example in the example folder.

Once you have written a template, test it with eastern generate path/to/file.yaml namespace -s IMAGE_TAG=2.0.

Deploy

To deploy, run eastern deploy path/to/file.yaml namespace.

Available options:

  • --set var=value (-s): Set additional template variables
  • --edit (-e): Edit resulting YAML before deploying
  • --no-wait: Exit after running kubectl without waiting for rolling deploy

Deploy jobs

Eastern comes with Job deployment tool.

To start a job, run eastern job path/to/file.yaml namespace image_tag. The file must have the job as its only document. Eastern will add image_tag as job suffix, deploy, wait until job's completion and remove the job.

Supplied image_tag is available in the template as ${IMAGE_TAG}.

Plugin

Eastern is extensible. We use Eastern plugins ourselves. The API docs is available on Read the Docs.

License

(C) 2017 Wongnai Media Co, Ltd.

Eastern is licensed under MIT License

Release files for eastern 5.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for eastern 5.0.0
File Size Uploaded
eastern-5.0.0.tar.gz 13.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for eastern 5.0.0
File Interpreter ABI Platform
eastern-5.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 29.1 kB

Release files / eastern-5.0.0.tar.gz

Download URL eastern-5.0.0.tar.gz
Size 13.7 kB
Tags Source
SHA-256 checksum
How to use checksums
a1b0454065bc58661ab9187449d1d44a72d36ede4612b3f7ba986456f02838b8
BLAKE2b-256 checksum
How to use checksums
603ee0be95cd612c8b0a63f7bfae6ae21d1e5f2c2ad2b8f7b6a55c28508d6500
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.10.4

Release files / eastern-5.0.0-py3-none-any.whl

Download URL eastern-5.0.0-py3-none-any.whl
Size 15.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
82a49518a1657713e299a743b5a08414261194363292390c3a05e3fc3608da60
BLAKE2b-256 checksum
How to use checksums
b5a394938cf55b37b28361460397080cebae9ce9df0eac2842bfe576d7d5a449
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.10.4

Release history Release notifications | RSS feed

This release

5.0.0 This release

2 release files

4.5.1

2 release files

4.4.1

2 release files

4.4.0

2 release files

4.3.0

2 release files

4.2.1

2 release files

4.2.0

1 release file

4.1.2

1 release file

4.1.1

1 release file

4.0.0

1 release file

3.0.0

1 release file

2.1.0

2 release files

2.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page