REST API Starter
The jhelm-rest module provides a Spring Boot starter that exposes Helm operations as a REST API with OpenAPI/Swagger documentation.
1. Getting Started
1.1. Maven Dependency
Add jhelm-rest to your Spring Boot web application:
<dependency>
<groupId>org.alexmond</groupId>
<artifactId>jhelm-rest</artifactId>
<version>{jhelm-version}</version>
</dependency>
For Swagger UI, add springdoc-openapi:
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>3.0.2</version>
</dependency>
1.2. Sample Application
A ready-to-run sample is available in the jhelm-rest-sample module:
cd jhelm-rest-sample
../mvnw spring-boot:run
Open http://localhost:8080/swagger-ui.html to see all endpoints.
2. Configuration
| Property | Default | Description |
|---|---|---|
|
|
Base path prefix for all REST endpoints |
jhelm:
rest:
base-path: /api/v1
3. Auto-Configuration
JhelmRestAutoConfiguration conditionally registers controllers based on available beans from JhelmCoreAutoConfiguration:
| Controller | Condition | Endpoints |
|---|---|---|
|
|
13 release management endpoints |
|
|
8 chart operation endpoints |
|
|
6 repository management endpoints |
|
|
1 ArtifactHub search endpoint |
|
|
2 dependency management endpoints |
Release endpoints require jhelm-kube on the classpath (Kubernetes client). All other endpoints work with jhelm-core alone.
|
4. API Reference
4.1. Releases — /api/v1/releases
| Method | Path | Description |
|---|---|---|
|
|
List all releases in a namespace |
|
|
Get release status |
|
|
Install a new release |
|
|
Upgrade an existing release |
|
|
Uninstall a release |
|
|
Get release revision history |
|
|
Rollback to a previous revision |
|
|
Run test hooks |
|
|
Get release values (user overrides or all merged) |
|
|
Get rendered Kubernetes manifest |
|
|
Get release notes |
|
|
List Helm hooks |
|
|
List resource statuses |
4.1.1. Install a Release
curl -X POST http://localhost:8080/api/v1/releases \
-H 'Content-Type: application/json' \
-d '{
"chartPath": "/path/to/my-chart",
"releaseName": "my-release",
"namespace": "production",
"values": {
"replicaCount": 3,
"image": {"tag": "v2.0"}
},
"dryRun": false
}'
4.2. Charts — /api/v1/charts
| Method | Path | Description |
|---|---|---|
|
|
Render chart templates to Kubernetes manifests |
|
|
Validate a chart for issues |
|
|
Scaffold a new chart directory |
|
|
Package a chart into a .tgz archive |
|
|
Verify PGP signature of a packaged chart |
|
|
Show all chart info (metadata, values, README) |
|
|
Show default values.yaml |
|
|
Show chart README |
4.2.1. Render Templates
curl -X POST http://localhost:8080/api/v1/charts/template \
-H 'Content-Type: application/json' \
-d '{
"chartPath": "/path/to/my-chart",
"releaseName": "my-release",
"namespace": "production",
"values": {"replicaCount": 3}
}'
4.3. Repositories — /api/v1/repos
| Method | Path | Description |
|---|---|---|
|
|
Add a chart repository |
|
|
List all configured repositories |
|
|
Remove a repository |
|
|
Update repository index |
|
|
List available chart versions |
|
|
Pull a chart from a repository |
4.3.1. Add a Repository
curl -X POST http://localhost:8080/api/v1/repos \
-H 'Content-Type: application/json' \
-d '{"name": "bitnami", "url": "https://charts.bitnami.com/bitnami"}'
4.4. Hub — /api/v1/hub
| Method | Path | Description |
|---|---|---|
|
|
Search ArtifactHub for Helm charts |
4.4.1. Search ArtifactHub
curl 'http://localhost:8080/api/v1/hub/search?keyword=nginx&maxResults=5'
Response:
[
{
"name": "nginx",
"version": "18.3.1",
"appVersion": "1.27.3",
"repoName": "bitnami",
"repoUrl": "https://charts.bitnami.com/bitnami",
"description": "NGINX Open Source is a web server..."
}
]
ArtifactHub API limits maxResults to 60 per request.
|
4.5. Dependencies — /api/v1/dependencies
| Method | Path | Description |
|---|---|---|
|
|
Resolve dependency versions and create Chart.lock |
|
|
Download resolved dependencies from Chart.lock |
5. Error Handling
All endpoints return consistent error responses via JhelmRestExceptionHandler:
-
400 Bad Request — Missing required fields or invalid arguments
-
404 Not Found — Release or resource not found
Error response format:
{"message": "chartPath is required"}
6. Spring Boot Integration
6.1. Minimal Application
@SpringBootApplication
public class MyHelmApp {
public static void main(String[] args) {
SpringApplication.run(MyHelmApp.class, args);
}
}
With jhelm-rest on the classpath, all endpoints are auto-configured. No additional code is needed.