Kubes provides some helper methods to help write Kubernetes YAML files. Here’s a list of the helper methods. These are available whether you write your resources in YAML or DSL.
|decode64||Base64 decode a string.|
|docker_image||Method refers to the latest Docker image built by Kubes. This spares you from having to update the image manually in the deployment resource. Note, this can be overridden with the
|dockerfile_port||Exposed port extracted from the Dockerfile of the project.|
|encode64||Base64 encode a string. Also available as
Here’s also the source code with most of the helpers: helpers.rb.
DSL Specific Methods
Each DSL resource has it’s own specific methods. Refer to the DSL Docs for their methods.
There are also provider-specific helpers:
To help you get started quickly, you can generate starter helper code.
$ kubes new helper custom create .kubes/helpers/custom_helper.rb
module CustomHelper end