Skip to main content
Version: 1.0.0

Extensions Service

The Extensions Service (client.extensions) manages K8s-native extensions deployed as KamiwazaExtension Custom Resources. It replaces the legacy App Garden (client.apps) and Tool Shed (client.tools) services for Kubernetes deployments.

Quick Start

from kamiwaza_sdk import KamiwazaClient

client = KamiwazaClient(base_url="https://kamiwaza.test/api")
# ... authenticate ...

# List all extensions
extensions = client.extensions.list_extensions()
for ext in extensions:
print(f"{ext.name}: {ext.phase} ({ext.type})")

# Get a specific extension
detail = client.extensions.get_extension("my-extension")
print(detail.endpoints.external)

# Delete an extension
client.extensions.delete_extension("my-extension")

Methods

list_extensions() -> List[Extension]

List all extensions visible to the current user.

extensions = client.extensions.list_extensions()
for ext in extensions:
print(f"{ext.name} ({ext.type}): {ext.phase}")

get_extension(name: str) -> Extension

Get a single extension by CR name.

ext = client.extensions.get_extension("kaizen-abc12345")
print(ext.version) # "2.0.0"
print(ext.phase) # "Running"
print(ext.endpoints) # ExtensionEndpoints(external="https://...", internal="http://...")

Raises: NotFoundError if the extension does not exist.

create_extension(request: CreateExtension) -> Extension

Create a new extension from a specification.

from kamiwaza_sdk.schemas.extensions import CreateExtension, ExtensionServiceSpec

request = CreateExtension(
name="my-tool",
type="tool",
version="1.0.0",
services=[
ExtensionServiceSpec(
name="backend",
image="myregistry/backend:1.0.0",
primary=True,
ports=[{"container_port": 8000}],
),
],
)
ext = client.extensions.create_extension(request)
print(ext.name) # "my-tool"
print(ext.phase) # "Pending"

delete_extension(name: str) -> bool

Delete an extension by CR name. Returns True on success.

client.extensions.delete_extension("my-tool")

Raises: NotFoundError if the extension does not exist.

Note: K8s CR deletion is asynchronous. The CR may still appear briefly in list_extensions() after deletion.

Schemas

Extension

Response model for an extension.

FieldTypeDescription
namestrExtension CR name
typestr"app" or "tool"
versionstrExtension version
phasestr | NoneCR phase: Pending, Deploying, Running, Failed
servicesList[ExtensionServiceStatus]Per-service status
endpointsExtensionEndpoints | NoneResolved external/internal URLs
owner_user_idstr | NoneUser who created the extension
created_atdatetime | NoneCreation timestamp

CreateExtension

Request model for creating an extension.

FieldTypeRequiredDescription
namestrYesExtension name (K8s DNS label format)
type"app" | "tool"YesExtension type
versionstrYesSemver version string
servicesList[ExtensionServiceSpec]YesOne or more service specs
kamiwazaKamiwazaIntegrationSpecNoPlatform integration settings
networkingNetworkingSpecNoIngress configuration
securitySecuritySpecNoSecurity classification

ExtensionServiceSpec

Specification for a single service within an extension.

FieldTypeDefaultDescription
namestrService name
imagestrContainer image
primaryboolFalseWhether this is the primary ingress service
portsList[ExtensionPort][]Exposed ports (empty = init Job)
envList[Dict]NoneEnvironment variables
replicasint1Number of replicas
resourcesResourceSpecNoneCPU/memory requests and limits
commandList[str]NoneContainer command override

Migration from App Garden / Tool Shed

Legacy (App Garden / Tool Shed)Extensions API
client.apps.list_deployments()client.extensions.list_extensions()
client.apps.deploy(template_id=..., name=...)client.extensions.create_extension(request)
client.apps.get_deployment(deployment_id)client.extensions.get_extension(name)
client.apps.stop_deployment(deployment_id)client.extensions.delete_extension(name)
client.tools.list_deployments()client.extensions.list_extensions()
client.tools.deploy(template_id=..., name=...)client.extensions.create_extension(request)

Key differences:

  • Extensions are identified by name (not UUID)
  • Extensions use a declarative spec (CreateExtension) instead of template IDs
  • The extensions API talks to K8s CRDs, not Docker Compose