Deploy a productionβready scheduled task scope
π― Goal: Install the nullplatform agent, configure a Scheduled task (CronJob) scope, and create your first scope with productionβready defaults.
Introductionβ
This guide walks you through deploying a Kubernetes Scheduled task (CronJob) scope on nullplatform. You'll install the agent, configure the scope repository and variables, register scope actions and channels, and create your first scope instance in the UI.
What youβll set upβ
By the end of this guide, you'll have:
- A running nullplatform agent in your Kubernetes cluster
- The scopes repository available to the agent
- A Scheduled task scope configured and registered (schema, actions, channel)
- A first scope instance created from the UI
Prerequisitesβ
- Access to a Kubernetes cluster
- Helm installed
- Gomplate
- The nullplatform CLI:
curl https://cli.nullplatform.com/install.sh | sh - An API key with
controlplane:agentplus the roles you need (Developer, Ops, SecOps, Secrets Reader). See Authenticate the agent for more info.
1. Install the nullplatform agent (Helm)β
1.1 Add the Helm repoβ
helm repo add nullplatform https://nullplatform.github.io/helm-charts
helm repo update
1.2 Install the agent chartβ
helm install nullplatform-agent nullplatform/nullplatform-agent \
--set configuration.values.NP_API_KEY=$NP_API_KEY \
--set configuration.values.TAGS="$AGENT_TAGS" \
--set configuration.values.AGENT_REPO=$AGENT_REPO
π See the Agent installation docs for more info.
1.3 Set environment variablesβ
Use the default agent tag in this guide:
export NP_API_KEY=<your_api_key>
export AGENT_TAGS=<key:value>
export AGENT_REPO="https://github.com/nullplatform/scopes.git#main"
π‘ Tip: Save your AGENT_TAGS. Youβll reuse them when configuring the scope.
β Checkpoint: Agent runningβ
Letβs make sure everything is working properly.
Check the agent in the UI
- Grab the agent ID from the install logs. It looks like this:
"id\":\"123b245d-6e7b-4c56-d78e-12f34b50\" - In the platform UI, go to Platform settings > Agents.
- You should see your new agent listed by that ID.
Check that the repo is installed
Run this command:
kubectl exec <<nullplatform-agent-pod>> -n nullplatform-tools -- ls /root/.np
You should see the path to the repository: @nullplatform.
2. Clone the scopes repositoryβ
Open a new terminal and clone the scopes repository:
git clone https://github.com/nullplatform/scopes.git
cd scopes
This repo includes:
- A base Scheduled task scope implementation
- Utility scripts for configuration and cluster setup
- The agent deployment flow
scopes/
βββ scheduled_task/ # Scheduled task specific implementation
β βββ scope/ # Scope lifecycle actions
β β βββ workflows/
β β βββ create.yaml
β β βββ update.yaml
β β βββ delete.yaml
β βββ deployment/ # Deployment actions
β β βββ workflows/
β β βββ initial.yaml
β β βββ blue_green.yaml
β β βββ ...
β βββ ...
βββ agent/ # Agent deployment scripts
βββ configure # Configuration script
βββ entrypoint # Main execution script
3. Configure scope environment variablesβ
Set the variables the configuration scripts expect:
export NP_API_KEY=<your_api_key_here>
export NRN=<your_resource_nrn>
export REPO_PATH=/root/.np/nullplatform/scopes
export SERVICE_PATH=scheduled_task
export ENVIRONMENT=development
NP_API_KEYβ API key with agent rolesNRNβ Target resource NRN (from the UI)REPO_PATHβ Path where the agent mounts the repo (/root/.np/nullplatform/scopesfor the public repo)SERVICE_PATHβ Path to the scope implementation (here:scheduled_task)ENVIRONMENTβ Must match the environment tag inAGENT_TAGS(e.g.,environment:development)
Tag alignmentβ
Ensure ENVIRONMENT corresponds to your AGENT_TAGS value (e.g., development, stage, or production).
4. Configure the Scheduled task scopeβ
Run the scope configuration script to register the scope schema, actions, and the agent notification channel:
./configure
The configuration script:
- Registers the JSON schema that defines the scopeβs parameters.
- Creates action specs, like
create-scope,delete-scope. - Registers the scope type.
- Sets up a notification channel so your agent can receive events.
Expected output:
β The scope setup process completed successfully.
β Checkpoint β Channel createdβ
In the UI, go to Platform settings β Channels, filter by the NRN you used, and confirm a new channel exists.
5. Create your first Scheduled task scope (UI)β
- Open your application and go to Scopes.
- Click + New scope.
- Select Scheduled task under target (default name:
Scheduled task). - Provide configuration values and Create scope.
Thatβs itβyour agentβbacked Scheduled task scope is live.
Wrapβup πβ
You now have:
- A nullplatform agent running in your cluster with the scopes repo mounted
- A Scheduled task scope configured and registered
- A first scope created via the UI
What's nextβ
- Enable custom Nginx settings on my scope: customize traffic behavior for your Kubernetes scopes
- Create an SQS queue service: let teams self-serve the queues your scheduled tasks consume