Getting Started
In this tutorial, we will create an Anemos project that generates Kubernetes manifests for an example application. We will start simple and generate the manifests in the main script. Then, gradually we will refactor the code into a more modular structure. Lastly, we will generate a package that can be reused by other projects.
Creating a New Project
To create a new Anemos project, you can use the anemos new command. This command will create a new directory
with the necessary files for an Anemos project.
- Shell
anemos new example
This will create a new directory called example with a single index.js file. index.js is the main script of the project.
This is where we will write our code to generate the Kubernetes manifests.
Building the Project
To generate the Kubernetes manifests from your Anemos project, use the anemos build
command:
- Shell
anemos build index.js
This command instructs Anemos to perform the build process that effectively runs the index.js file.
The generated resources will be placed in the output directory. For the default template, this
will initially contain a single Pod manifest.
By default, the output folder will be created in the directory where your main script is located. If you want
to specify a different output directory, you can set it in the builder options.
Output directory must be inside the directory where your main script is located.
The output directory is managed by Anemos and its contents are deleted
before each build. Do not store any manually created files in this directory.
Visual Studio Code
If you are using Visual Studio Code, you can use the Anemos VS Code plugin
to get intellisense and build your project. Plugin provides anemos.build command that you can run from the command palette
to build the index.js file on the root of your project. It also includes a default keyboard shortcut Ctrl+E Ctrl-A or Cmd+E Cmd+A.