| .. | ||
| kcl.mod | ||
| README.md | ||
{{TASKSERV_DISPLAY_NAME}} Taskserv
{{TASKSERV_DESCRIPTION}}
Overview
This taskserv provides deployment and management capabilities for {{TASKSERV_DISPLAY_NAME}} in Kubernetes environments.
Features
- ✅ Multi-environment support: Development, staging, and production profiles
- ✅ Resource management: Configurable CPU, memory, and storage allocation
- ✅ High availability: Support for replicated deployments
- ✅ Security: Built-in security contexts and non-root execution
- ✅ Monitoring: Health checks and readiness probes
- ✅ Storage: Persistent storage with configurable storage classes
- ✅ Networking: Flexible service types and ingress configuration
Configuration
Basic Configuration
import .taskservs.{{TASKSERV_NAME}}.{{TASKSERV_NAME}} as {{TASKSERV_NAME_SNAKE}}
server_config = {
taskservs = [
{
name = "{{TASKSERV_NAME}}"
profile = "default"
}
]
}
Development Profile
server_config = {
taskservs = [
{
name = "{{TASKSERV_NAME}}"
profile = "development"
}
]
}
Production Profile
server_config = {
taskservs = [
{
name = "{{TASKSERV_NAME}}"
profile = "production"
}
]
}
Configuration Options
Core Settings
| Parameter | Type | Default | Description |
|---|---|---|---|
enabled |
bool | true |
Enable/disable the service |
version |
string | "latest" |
Service version to deploy |
port |
int | {{DEFAULT_PORT}} |
Service port |
replicas |
int | 1 |
Number of replicas |
Resource Settings
| Parameter | Type | Default | Description |
|---|---|---|---|
cpu_request |
string | "100m" |
CPU request |
memory_request |
string | "128Mi" |
Memory request |
cpu_limit |
string | "500m" |
CPU limit |
memory_limit |
string | "512Mi" |
Memory limit |
Storage Settings
| Parameter | Type | Default | Description |
|---|---|---|---|
storage_enabled |
bool | true |
Enable persistent storage |
storage_size |
string | "10Gi" |
Storage size |
storage_class |
string | optional | Storage class name |
Network Settings
| Parameter | Type | Default | Description |
|---|---|---|---|
service_type |
string | "ClusterIP" |
Kubernetes service type |
ingress_enabled |
bool | false |
Enable ingress |
Security Settings
| Parameter | Type | Default | Description |
|---|---|---|---|
security_context_enabled |
bool | true |
Enable security context |
run_as_non_root |
bool | true |
Run as non-root user |
Dependencies
Required Dependencies
- kubernetes: Kubernetes cluster is required for deployment
Optional Dependencies
- monitoring: Enhanced monitoring and metrics collection
- logging: Centralized logging integration
Provided Services
- {{TASKSERV_NAME}}-api: {{TASKSERV_DISPLAY_NAME}} API endpoint
Profiles
Default Profile
Basic configuration suitable for testing and development.
Development Profile
Optimized for development environments:
- Single replica
- Reduced resource allocation
- Smaller storage size
Production Profile
Production-ready configuration:
- Multiple replicas for high availability
- Increased resource allocation
- Load balancer service type
- Ingress enabled
Installation
Using Module Loader
# Load the taskserv
module-loader load taskservs . [{{TASKSERV_NAME}}]
# Deploy using provisioning CLI
provisioning taskserv create {{TASKSERV_NAME}} --infra . --profile production
Manual KCL Configuration
# In your servers.k file
import .taskservs.{{TASKSERV_NAME}}.{{TASKSERV_NAME}} as {{TASKSERV_NAME_SNAKE}}
servers = [
{
hostname = "app-server-01"
taskservs = [
{
name = "{{TASKSERV_NAME}}"
profile = "production"
}
]
}
]
Health Checks
The taskserv includes built-in health checks:
- HTTP Health Check:
curl -f http://localhost:{{DEFAULT_PORT}}/health - Interval: 30 seconds
- Timeout: 10 seconds
- Retries: 3 attempts
Troubleshooting
Common Issues
Service Not Starting
-
Check resource availability:
kubectl describe pod {{TASKSERV_NAME}}-* -
Verify configuration:
kcl run servers.k -
Check logs:
kubectl logs -l app={{TASKSERV_NAME}}
Storage Issues
-
Verify storage class exists:
kubectl get storageclass -
Check PVC status:
kubectl get pvc
Network Connectivity Issues
-
Verify service is running:
kubectl get svc {{TASKSERV_NAME}} -
Test connectivity:
kubectl port-forward svc/{{TASKSERV_NAME}} {{DEFAULT_PORT}}:{{DEFAULT_PORT}} curl http://localhost:{{DEFAULT_PORT}}/health
Debug Mode
Enable debug logging by setting environment variables:
config = {
environment_vars = {
"LOG_LEVEL" = "debug"
"DEBUG" = "true"
}
}
Development
Local Development
-
Clone the taskserv:
cp -r templates/extensions/taskservs/basic-taskserv extensions/taskservs/my-{{TASKSERV_NAME}} -
Customize the configuration in
my-{{TASKSERV_NAME}}.k -
Test locally:
module-loader discover taskservs | grep my-{{TASKSERV_NAME}}
Contributing
- Follow the KCL schema validation requirements
- Include comprehensive documentation
- Add appropriate health checks
- Test with multiple profiles
- Update version information
Version History
| Version | Date | Changes |
|---|---|---|
| 0.0.1 | {{DATE}} | Initial release |
Support
- Documentation: {{DOCS_URL}}
- Issues: {{SUPPORT_URL}}
- Repository: {{REPOSITORY_URL}}
License
{{LICENSE}}