Use Cases
KSail supports three primary use cases with workflows tailored to each scenario: learning Kubernetes, iterating on applications, and testing in CI/CD.
Learning Kubernetes
Section titled âLearning KubernetesâFor developers new to Kubernetes who want to explore concepts and experiment with different configurations.
Recommended Setup
Section titled âRecommended Setupâksail cluster init \ --name learning \ --distribution Vanilla \ --cni Cilium \ --gitops-engine NoneWhy this configuration:
- Vanilla distribution â Standard upstream Kubernetes behavior
- Cilium CNI â Modern networking with observability features
- No GitOps â Direct kubectl/apply workflow for immediate feedback
Workflow
Section titled âWorkflowâ-
Create cluster
Terminal window ksail cluster create -
Apply manifests directly
Terminal window ksail workload apply -f my-deployment.yamlksail workload get pods -
Experiment with changes
Terminal window ksail workload apply -f updated-deployment.yamlksail workload logs deployment/my-app -
Clean up
Terminal window ksail cluster delete
- Use
ksail workload gento generate example manifests - Use
ksail workload explain <resource>to learn about Kubernetes resources - Use
ksail cluster connectto open K9s for interactive exploration
Iterating on Applications
Section titled âIterating on ApplicationsâFor developers building and testing applications locally before deploying to staging or production.
Recommended Setup
Section titled âRecommended Setupâksail cluster init \ --name dev \ --distribution K3s \ --cni Cilium \ --csi LocalPathProvisioner \ --gitops-engine Flux \ --local-registry \ --local-registry-port 5050Why this configuration:
- K3s distribution â Fast startup and low resource usage
- Cilium CNI â Network policies and observability
- LocalPathProvisioner CSI â Persistent volumes for stateful apps
- Flux GitOps â Declarative deployments matching production patterns
- Local registry â Fast image iteration without pushing to remote registry
Workflow
Section titled âWorkflowâ-
Create cluster
Terminal window ksail cluster create -
Build and push image
Terminal window docker build -t localhost:5050/my-app:dev .docker push localhost:5050/my-app:dev -
Update manifests
k8s/deployment.yaml image: localhost:5050/my-app:dev -
Deploy via GitOps
Terminal window ksail workload pushksail workload reconcile -
Iterate
Terminal window # Make code changesdocker build -t localhost:5050/my-app:dev .docker push localhost:5050/my-app:devksail workload reconcile
- Use
ksail workload logs -f deployment/my-appfor live log streaming - Use
ksail workload exec deployment/my-app -- /bin/shfor debugging - Keep terminal running with
ksail cluster infoto monitor cluster health
Testing in CI/CD
Section titled âTesting in CI/CDâFor automated testing in CI/CD pipelines where reproducibility and speed matter.
Recommended Setup
Section titled âRecommended SetupâapiVersion: ksail.io/v1alpha1kind: Clusterspec: cluster: name: ci-test distribution: K3s cni: Cilium gitOpsEngine: Flux localRegistry: Enabled workload: sourceDirectory: k8sWhy this configuration:
- K3s distribution â Fastest startup time for CI
- Cilium CNI â Required for network policies
- Flux GitOps â Test actual deployment workflow
- Declarative config â Reproducible across CI runs
CI Pipeline Example
Section titled âCI Pipeline Exampleâname: Integration Tests
on: pull_request: branches: [main]
jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4
- name: Install KSail run: | curl -sSL https://github.com/devantler-tech/ksail/releases/latest/download/ksail_linux_amd64 -o ksail chmod +x ksail sudo mv ksail /usr/local/bin/
- name: Create cluster run: ksail cluster create
- name: Build and push run: | docker build -t localhost:5050/my-app:${{ github.sha }} . docker push localhost:5050/my-app:${{ github.sha }}
- name: Deploy run: | sed -i "s|image:.*|image: localhost:5050/my-app:${{ github.sha }}|" k8s/deployment.yaml ksail workload push ksail workload reconcile
- name: Run tests run: | # Wait for deployment ksail workload wait deployment/my-app --for=condition=available
# Run integration tests npm run test:integration
- name: Cleanup if: always() run: ksail cluster delete- Use
--timeoutflags to handle slow CI runners - Cache Docker layers for faster builds
- Use matrix builds to test across multiple Kubernetes versions/distributions
- Consider using
ksail cluster startandksail cluster stopif tests can share a cluster
Configuration Comparison
Section titled âConfiguration Comparisonâ| Aspect | Learning | Development | CI/CD |
|---|---|---|---|
| Distribution | Vanilla | K3s | K3s |
| CNI | Cilium | Cilium | Cilium |
| CSI | None | LocalPathProvisioner | None |
| GitOps | None | Flux | Flux |
| Local Registry | Optional | Yes | Yes |
| Declarative Config | Optional | Recommended | Required |
| Cluster Lifetime | Session | Days/Weeks | Minutes |
Next Steps
Section titled âNext Stepsâ- Features â Deep dive into KSail capabilities
- Concepts â Understand the underlying technologies
- Configuration â Complete configuration reference