• 2025-07-23

    Deploying Next.js to Kubernetes: A practical guide with a complete DevOps Pipeline

    This post continues the hellok8s-* series, following my previous exploration of deploying a Django applications to Kubernetes. While the technology stack differs, the core DevOps principles and deployment challenges remain remarkably similar across frameworks.

    As modern web applications grow in complexity, the gap between development tutorials and production-ready deployments becomes increasingly challenging. Most Next.js guides stop at npm run dev, but production applications require containerization, orchestration, secrets management, CI/CD pipelines, and reproducible development environments. Today, I want to share insights from hellok8s-nextjs, a comprehensive project template that demonstrates how to bridge this gap with battle-tested DevOps practices.

    The Challenge: From Tutorial to Production

    First, let's address the elephant in the room: Vercel exists, and it's excellent. For many Next.js applications, Vercel provides the easiest deployment experience with zero configuration, automatic scaling, and seamless integration with the Next.js ecosystem. If Vercel meets your needs, use it - it's a fantastic platform that handles most of the complexity I'm about to discuss.

    However, real-world enterprise requirements often demand self-hosted solutions for a variety of reasons:

    Compliance requirements (HIPAA, SOC 2, PCI DSS) that require data to remain within specific geographic boundaries or private networks.

    Cost optimization for high-traffic applications where predictable infrastructure costs matter.

    Integration with existing infrastructure and legacy systems that can't be easily migrated.

    Custom security policies that require full control over the deployment environment.

    Air-gapped environments or on-premises deployments where external platforms aren't viable.

    Multi-cloud strategies that require vendor independence.

    When these constraints apply, scaling from a local development server to a production Kubernetes deployment involves numerous considerations that most tutorials don't address. How do you ensure consistent environments across team members? How do you manage secrets securely? How do you achieve zero-downtime deployments with proper rollback capabilities?

    After implementing these patterns across multiple technology stacks and organizations, I've distilled these proven practices into hellok8s-nextjs, a production-ready template that demonstrates the complete DevOps lifecycle for modern Next.js applications. These patterns have proven successful for teams ranging from small startups to enterprise organizations managing hundreds of developers.

    Read more…

    devenv devops docker kubernetes nextjs nix

  • 2025-07-08

    Containers and Signal Handling: Why You Need to Care About PID 1

    When running applications in Docker containers, many developers overlook a critical detail: what process runs as PID 1. This seemingly minor choice can lead to unresponsive containers, resource leaks, and unexpected behavior during shutdown.

    Why PID 1 is Special

    In Linux, the kernel treats PID 1 differently from all other processes. It's the "init" process that bootstraps the system and has two critical responsibilities:

    Signal handling: The kernel doesn't deliver certain signals (like SIGTERM) to PID 1 unless it explicitly registers handlers for them.

    Process reaping: PID 1 must clean up zombie processes by calling waitpid() on dead children.

    When you run a container with:

    CMD ["./my-app"]
    

    Your application becomes PID 1, inheriting these kernel expectations whether it's designed for them or not.

    Read more…

    containers docker linux pid1 signals

  • 2025-07-01

    Deploying Python (Django) to Kubernetes: A practical guide with a complete DevOps Pipeline

    As businesses increasingly move to cloud-native architectures, the complexity of deploying and maintaining modern web applications continues to grow. Today, I want to share insights from a comprehensive project template I've developed that demonstrates DevOps best practices, from local development to production Kubernetes deployments. While this example uses Django, the patterns and practices apply to any modern web framework.

    The Challenge: Bridging the Gap from Tutorial to Production

    Most web framework tutorials stop at basic development servers. But production applications require so much more: containerization, orchestration, secrets management, CI/CD pipelines, and reproducible development environments. The gap between "hello world" and production-ready is where most teams struggle and where costly delays, security vulnerabilities, and scaling bottlenecks emerge.

    After years of building web applications across multiple technology stacks, I've distilled these battle-tested practices into hellok8s-django, a production-ready template that demonstrates the complete DevOps lifecycle, from local development to Kubernetes at scale. These patterns have proven successful with Python, Node.js, Go, Ruby, Haskell and other modern tech stacks.

    Read more…

    devenv devops django docker kubernetes nix

  • 2023-06-19

    New homelab machine

    I've been meaning to share the new addition to my homelab setup for a while now but just never got around to it. It's a beast that's definitely overkill but I wanted to play around and future proof as much as possible.

    It initially started as a project to replace my old 2-bay Synology NAS. I needed an upgrade, storage wise, but I also wanted to switch to ZFS, and since Synology doesn't support ZFS I knew I'd have to build my own rig. That in turn meant I needed to figure out what I was going to install on the thing. Initially I looked at openmediavault but it didn't seem to support ZFS at the time (I don't know if this is still true). Then I looked at FreeNAS as they were going through their rebranding to TrueNAS - but I was weary about switching to FreeBSD at the time. I wanted something that I knew well (Linux) and that I can easily customize. Before you mention TrueNAS Scale (which is Linux based) it wasn't ready at the time1 and I was hesitant about all the cruft that comes pre-installed with it (my main issue with Synology). I guess I wanted to install and configure stuff my way when I need it.

    Read more…

    homelab nixos