Deploy production-ready K3s clusters with Traefik IngressRoute, cert-manager SSL automation, and a comprehensive Helm chart supporting Deployments, StatefulSets, and CronJobs.
Deploy production-ready K3s (lightweight Kubernetes) clusters with automated SSL/TLS certificate management, Traefik ingress controller with IngressRoute CRD support, and a comprehensive Helm chart template for deploying applications.
This skill helps you work with the k3s-deploy framework, which provides:
**Required Environment Variable:**
```bash
export LETSENCRYPT_EMAIL="[email protected]"
```
**Basic Installation (Development):**
```bash
./scripts/setup-k3s.sh
```
**Production Installation (with Longhorn storage):**
```bash
export INSTALL_LONGHORN=true
export LETSENCRYPT_EMAIL="[email protected]"
./scripts/setup-k3s.sh
```
**Optional Environment Variables:**
The setup script will:
**Deploy with Default Configuration:**
```bash
./scripts/deploy-app.sh
```
**Deploy with Custom Values:**
```bash
NAMESPACE=my-app VALUES_FILE=examples/production-app-values.yaml ./scripts/deploy-app.sh
```
**Deploy with Custom Release Name:**
```bash
RELEASE_NAME=api-service NAMESPACE=backend ./scripts/deploy-app.sh
```
**Check All Resources:**
```bash
kubectl get all -n <namespace>
```
**Check IngressRoute Status:**
```bash
kubectl get ingressroute -n <namespace>
kubectl describe ingressroute <name> -n <namespace>
```
**Check Certificate Status:**
```bash
kubectl get certificates -n <namespace>
kubectl describe certificate <name> -n <namespace>
```
**View Traefik Logs:**
```bash
kubectl logs -n traefik deployment/traefik
```
**Check Longhorn Status (if installed):**
```bash
kubectl get pods -n longhorn-system
kubectl get storageclass
kubectl get volumes.longhorn.io -n longhorn-system
```
**Fix Docker Registry Issues:**
```bash
./scripts/fix-registry.sh
```
**Debug Helm Deployment:**
```bash
helm template my-app ./helm-chart -f examples/simple-app-values.yaml
helm get values <release-name> -n <namespace>
helm get manifest <release-name> -n <namespace>
```
The generic Helm chart supports:
**IngressRoute (Recommended for Traefik):**
```yaml
ingress:
useIngressRoute: true
tls:
enabled: true
certManager:
enabled: true
clusterIssuer: "letsencrypt-prod" # or "letsencrypt-staging"
```
**Persistence:**
```yaml
persistence:
enabled: true
storageClass: "local-path" # or "longhorn" for production
size: 10Gi
```
**StatefulSet (for databases, etc.):**
```yaml
statefulset:
enabled: true
```
**CronJob (for scheduled tasks):**
```yaml
cronjob:
enabled: true
schedule: "0 2 * * *"
```
**RBAC:**
```yaml
rbac:
create: true
rules:
- apiGroups: [""]
resources: ["pods"]
verbs: ["get", "list"]
```
1. **Modify Configuration**: Edit `helm-chart/values.yaml` or create a custom values file (see `examples/` directory)
2. **Test Locally**: Run `helm template my-app ./helm-chart -f your-values.yaml` to verify generated manifests
3. **Deploy**: Use `./scripts/deploy-app.sh` with appropriate environment variables
4. **Monitor**: Use `kubectl` commands to check status
5. **Debug**: Check Traefik logs and certificate status if issues occur
**Deploy a simple web application:**
```bash
export LETSENCRYPT_EMAIL="[email protected]"
./scripts/setup-k3s.sh
NAMESPACE=web-app VALUES_FILE=examples/simple-app-values.yaml ./scripts/deploy-app.sh
```
**Deploy a stateful database with Longhorn:**
```bash
export LETSENCRYPT_EMAIL="[email protected]"
export INSTALL_LONGHORN=true
./scripts/setup-k3s.sh
NAMESPACE=database VALUES_FILE=examples/stateful-db-values.yaml ./scripts/deploy-app.sh
```
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/k3s-deployment-framework/raw