Skip to main content

Custom Templates

Overview

Custom Templates allow you to create application components with technology stacks that are not covered by CodeNOW’s predefined scaffolders. You define how the component is built and deployed by providing your own Dockerfile and/or Helm charts.

  • Use Docker Generic when you want to supply both a Dockerfile and Helm charts.
  • Use Helm Generic when you want to keep CodeNOW’s default image build but provide your own Helm charts.
  • For existing scaffolded components, you can expose and customize the default Dockerfile and Helm charts stored in the component repository.

This page provides concise, manual-only guidance and links to the relevant manuals. Tutorials and step-by-step examples are intentionally omitted here.

When to Use Custom Templates

  • Your stack is not available among supported technology stacks.
  • You need full control over the container image and deployment manifests.
  • You want to deploy a third-party image with custom Helm configuration.
caution

By defining the build and deployment of your custom stack, you are responsible for troubleshooting and maintaining your configuration.

Options

  1. Expose and customize Dockerfile and Helm charts of an existing component.
    • Go to your component’s repository and enable visibility of Dockerfile and Helm files; then edit as needed.
  2. Create a component with Docker Generic (custom Dockerfile + Helm charts).
  3. Create a component with Helm Generic (custom Helm charts, reuse default image build).

Configuration and Deployment

Good Practices

  • Expose port 80 in your container; CodeNOW expects services to run on port 80.
  • Prefer starting from well-known Helm charts when possible (e.g., charts on Artifact Hub).
  • Keep secrets out of repository files; manage them via CodeNOW service connections and environment variables.

Edit Default Dockerfile and Helm Charts

For scaffolded components, enable visibility of the default Dockerfile and Helm files in your repository and edit them to adapt the stack and deployment.

Prerequisites:

  • Existing application and component created with a predefined scaffolder.

Steps (high level):

  • Open component repository; toggle Dockerfile visibility; toggle Helm files visibility.
  • Edit Dockerfile to adjust base image, runtime, ports.
  • Edit Helm charts to adapt deployment, resources, and ingress.

Create Component with Docker Generic

Create a component and configure both its Dockerfile and Helm charts. The Docker Generic scaffolder gives you full freedom over your stack and deployment.

Prerequisites:

  • Existing application in CodeNOW.

Steps (high level):

  • Create new component; select Docker Generic.
  • Provide Dockerfile and Helm charts in the repository.
  • Build and deploy using your configuration.

Create Component with Helm Generic

Reuse CodeNOW’s default image build while providing your own Helm charts.

Prerequisites:

  • Existing application in CodeNOW.

Steps (high level):

  • Create new component; select Helm Generic.
  • Edit Helm charts in the repository; adapt values and templates.

Helm Chart Overrides

When using Helm Generic or Docker Generic, CodeNOW creates /codenow/config/helm-values.yaml in the component repository. Use this file to set environment-specific values.

Tips

  • Configuring via Helm requires familiarity with Helm templates and values.

  • Explore Docker Hub for trusted base images.

  • Keep ports and probes aligned with your stack; expose port 80.

  • Your application must return an HTTP **200 OK** success status code in response to a GET request to its deployment URL (cf. NodeJS/Express API example).

Deployment configuration files

  • By default, all files in the /codenow/config folder are deployed as is to the /codenow/config repository of the deployed container.
  • This default behavior is implemented by Helm configuration files. You can change it by modifying the Helm files for your component (see Edit a component's Helm chart and Helm charts override).
  • You may customize the deployment folder for the configuration files by updating the Helm files.
  • Applications can access any deployment configuration files used in a CodeNOW deployment in the /codenow/config repository of the deployed container.

Runtime environment variables

  • CodeNOW creates automatically runtime environment variables for connection properties. Use the method provided by your custom stack to access environment variables at runtime (e.g., process.env in NodeJS scripts, os.environ in Python).

Troubleshooting