2.9 KiB
2.9 KiB
Deployment Guide
Docker
Building the Image
# Build with default tag
docker build -t cleverclaude:latest .
# Build with specific version
docker build -t cleverclaude:v0.1.0 .
Running the Container
# Show help
docker run --rm cleverclaude:latest
# Run with custom arguments
docker run --rm cleverclaude:latest --name Docker --count 3
Multi-Platform Builds
# Build for multiple platforms
docker buildx build --platform linux/amd64,linux/arm64 \
-t ghcr.io/cleverthis/cleverclaude:latest \
--push .
Kubernetes with Helm
Prerequisites
- Kubernetes cluster (1.23+)
- Helm 3.x installed
- kubectl configured
Basic Installation
# Install with default values
helm install cleverclaude ./k8s
# Install with custom values
helm install cleverclaude ./k8s \
--set image.tag=v0.1.0 \
--set replicaCount=3
Customization
Create a values-prod.yaml file:
image:
tag: v0.1.0
pullPolicy: Always
resources:
limits:
cpu: 1000m
memory: 512Mi
requests:
cpu: 200m
memory: 256Mi
autoscaling:
enabled: true
minReplicas: 3
maxReplicas: 10
targetCPUUtilizationPercentage: 60
ingress:
enabled: true
className: nginx
hosts:
- host: api.example.com
paths:
- path: /
pathType: Prefix
tls:
- secretName: api-tls
hosts:
- api.example.com
Deploy with custom values:
helm upgrade --install cleverclaude ./k8s \
-f values-prod.yaml \
--namespace production \
--create-namespace
Monitoring the Deployment
# Check deployment status
kubectl get deployments -n production
# Check pod status
kubectl get pods -n production -l app.kubernetes.io/name=cleverclaude
# Check HPA status
kubectl get hpa -n production
# View logs
kubectl logs -n production -l app.kubernetes.io/name=cleverclaude
Rollback
# View release history
helm history cleverclaude -n production
# Rollback to previous version
helm rollback cleverclaude -n production
# Rollback to specific revision
helm rollback cleverclaude 3 -n production
CI/CD Pipeline
The Forgejo Actions workflow automatically:
- Runs linting and type checking
- Executes behavior tests on Python 3.11, 3.12, and 3.13
- Builds the wheel package
- Creates and tests the Docker image
- Validates the Helm chart
Continuous Deployment
Add this job to .forgejo/workflows/ci.yml for automated deployments:
deploy:
needs: [docker, helm]
runs-on: docker
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
- name: Deploy to Kubernetes
env:
KUBECONFIG_DATA: ${{ secrets.KUBECONFIG_BASE64 }}
run: |
echo "$KUBECONFIG_DATA" | base64 -d > /tmp/kubeconfig
export KUBECONFIG=/tmp/kubeconfig
helm upgrade --install cleverclaude ./k8s \
--namespace production \
--set image.tag=${{ github.sha }} \
--wait