Templates
🌟 Status: Live on Mainnet
Templates allow builders to consume NodeOps Cloud Compute or offer apps and services to end users from the Template Marketplace.
- Templates define Cloud infra, apps, and services
- Templates may be kept private or submitted to be considered for listing as a public template in the Cloud Marketplace
To consume your own template that leverages a bespoke app you must:
- Create a public Docker image of the app
- Create a template that leverages that Docker and upload it to the Marketplace
In the boostrapping phase of the Network, templates earn 20% of the workload fee.
This allows early template contributors to enjoy a significant incentive should their template prove popular.
Template specification overview​
Specification | Description | Example | Allowable Values |
---|---|---|---|
Docker Image | Specifies the public Docker image used for deployment. | nginx:latest | Valid Docker image tags (name:tag ) for arch amd64 |
Resource Allocation | Defines cpu and memory resources allocated to the application. | cpu: "500m" memory: "128Mi" | CPU (m for milli-cores), Memory (Mi ) |
Environment Variables | Configures environment variables, including placeholders and defaults. | env: - name: APP_ENV value: "{{.ENV}}" default: development | Dynamic ({{.ENV}} ), Static values |
Internet Exposure | Indicates whether the application should be accessible publicly. | expose: true | true , false |
The template structure is versatile to accommodate all your use cases, use the drop down to learn more:
Show me the YAML definition
name: template.yaml
type: object
required:
- version
- services
description: Schema for the YAML template file used to manage Cloud Compute infrastructure.
properties:
version:
type: float
example: 0.1
description: Defines the version of the template specification. Must start at 0.1.
services:
type: object
description: List of services to be deployed.
properties:
image:
type: string
required: true
description: Publicly-accessible Docker/container image for the service.
imagePullPolicy:
type: string
required: false
enum: ["Always", "IfNotPresent", "Never"]
description: Defines when to pull the Docker image for the service.
command:
type: string
required: false
description: The command to execute when the service starts.
args:
type: array
required: false
description: Arguments to pass to the command for the service.
items:
type: string
ports:
type: array
required: true
description: Port definitions for the service.
items:
type: object
required:
- containerPort
- expose
properties:
containerPort:
type: integer
required: true
description: Application port.
protocol:
type: string
required: false
enum: ["TCP", "UDP"]
description: The protocol used by the service.
expose:
type: boolean
required: false
description: Boolean value indicating if the port should be exposed for the service.
example: false
env:
type: array
required: false
description: Predefined environment variables for runtime.
items:
type: object
required:
- name
- value
properties:
name:
type: string
required: true
description: Name of the environment variable.
value:
type: string
required: true
description: The value of the environment variable (static or dynamic).
default:
type: string
required: false
description: Sets a fallback value to apply.
resourceUsage:
type: object
required: true
description: Specifies the resources required by the service.
properties:
idle:
type: object
required: true
description: Minimum requirements.
properties:
cpu:
type: integer
required: true
description: CPU unit in millicores.
memory:
type: integer
required: true
description: Memory unit in megabytes.
This means there are few boundaries constraining what you may create and consume from the Cloud Marketplace.
Templates state their resource requirements, currently, apps and code may be called via a public Docker image.
🚧 NodeOps is developing alternative methods for you to set up templates.
Template constraints​
- Maximum of 5 services.
- Only one service per template can be exposed to the public.
- Only 1 persistent volume is allowed.
- The total resource usage is limited to 4 Compute Units (CUs)
calculated as: CU = max(total CPU, total Memory)
- Upon template interruption, all services will be restarted as part of a single pod with multiple containers.
Update your Docker image​
To push out an updated version of your NodeOps template, push a new tag to your Docker image with the command:
docker push {username}/{template)name}:tagname
Then, from the NodeOps Marketplace console, navigate to My Templates and select your template, update the YAML version number and submit for re-review.
FAQ​
- If I make my template public on the Marketplace, does its code and configuration become public?
No. Even though the Docker image is public, that doesn't mean that Docker exposes its code. Furthermore, you decide whether the YAML file that configures you template is made public or hidden. This means you may also keep hidden what Docker image you leverage.
What next?​
- Learn how to Dockerize your App ahead of creating a template
- Follow the Guide to upload a template to the Marketplace
- Learn more about the other products and services in the NodeOps Ecosystem