Advanced Topics
Learn about advanced Knative features and best practices for production deployments.
Custom Domains
To use a custom domain, update the domain configuration:
kubectl patch configmap config-domain -n knative-serving \ --type merge \ -p '{"data":{"example.com":""}}'Health Checks
Configure liveness and readiness probes:
spec: template: spec: containers: - image: your-image livenessProbe: httpGet: path: /health readinessProbe: httpGet: path: /readyBest Practices
- Use meaningful revision names for easier traffic management
- Set appropriate resource limits to optimize costs
- Implement proper health checks for reliable deployments
- Use secrets for sensitive data instead of environment variables
- Monitor your services with observability tools
Troubleshooting
Service Not Ready
Check the service status:
kubectl describe ksvc helloView pod logs:
kubectl logs -l serving.knative.dev/service=helloDNS Issues
Verify DNS configuration:
kubectl get configmap config-domain -n knative-serving -o yamlConclusion
Knative provides a powerful platform for building and running serverless applications on Kubernetes. With its auto-scaling capabilities, revision management, and traffic splitting features, it simplifies the deployment and management of cloud-native applications.