Tag: #MVP

  • From Zero to Hello World in 30 Minutes: A Founder’s Field-Guide to Shipping on Google Kubernetes Engine

    From Zero to Hello World in 30 Minutes: A Founder’s Field-Guide to Shipping on Google Kubernetes Engine

    Picture yourself as the CTO of a seed-stage startup on a Tuesday afternoon.
    An investor just pinged you: “Can we see the live MVP by Thursday?”
    Your code works on your laptop, but the world still thinks your product is vaporware.

    You need a runway, not a runway meeting.

    You need Google Kubernetes Engine—the hyperscaler’s equivalent of a fully-staffed launchpad that charges you only for the rocket fuel you actually burn.

    Today I’ll walk the tightrope between tutorial and treatise, turning the official GKE quickstart into a strategic story you can narrate to your board, your devs, or your future self at 2 a.m. when the pager goes off.

    Grab your coffee; we’re going from git clone to “Hello, World!” on a public IP in under thirty billable minutes—and we’ll leave the meter running just low enough that your finance lead doesn’t flinch.


    Act I: The Mythical One-Click Infra (Spoiler—There Are Six Clicks)

    The fairy-tale version says, “Kubernetes is too complex.”
    The reality: GKE’s Autopilot mode abstracts away the yak shaving.
    Google runs the control plane, patches the OS, and even autoscaling is a polite request rather than a YAML epic.
    But before we taste that magic, we have to enable the spellbook.

    1. Create or pick a GCP project—think of it as your private AWS account but with better coffee.
    2. Enable the APIs:
      • Kubernetes Engine API
      • Artifact Registry API

    Clickety-click in the console or one shell incantation:

    gcloud services enable container.googleapis.com artifactregistry.googleapis.com

    Three seconds later, the cloud is officially listening.


    Act II: From Source to Immutable Artifact—The Container Story

    We’ll deploy the canonical “hello-app” written in Go.

    It’s 54 MB: every HTTP request gets a “Hello, World!” and the pod’s hostname.

    Perfect for proving that something is alive.

    1. Clone the samples repo—your starting block:
    git clone https://github.com/GoogleCloudPlatform/kubernetes-engine-samples
    cd kubernetes-engine-samples/quickstarts/hello-app
    1. Stamp your Docker image with your project’s coordinates:
    export PROJECT_ID=$(gcloud config get-value project)
    export REGION=us-west1
    docker build -t ${REGION}-docker.pkg.dev/${PROJECT_ID}/hello-repo/hello-app:v1 .

    Notice the tag: us-west1-docker.pkg.dev/your-project/hello-repo/hello-app:v1.
    That’s not vanity labeling; it’s the fully-qualified address where Artifact Registry will babysit your image.

    1. Push it:
    gcloud auth configure-docker ${REGION}-docker.pkg.dev
    docker push ${REGION}-docker.pkg.dev/${PROJECT_ID}/hello-repo/hello-app:v1

    At this point you have an immutable artifact.
    If prod breaks at 3 a.m., you can roll back to this exact SHA faster than your co-founder can send a panicked Slack emoji.


    Act III: Birth of a Cluster—Autopilot vs. Standard Mode

    Time for the strategic fork in the road.

    • Standard mode = you manage the nodes, the upgrades, the tears.
    • Autopilot mode = Google manages the nodes, you manage the profit margins.

    For an MVP sprint, Autopilot is the moral choice:

    gcloud container clusters create-auto hello-cluster \
      --region=${REGION} \
      --project=${PROJECT_ID}

    Two minutes later, you have a Kubernetes API endpoint that fits in a tweet and a bill that starts at roughly $0.10/hour (plus the free-tier credit that erases the first $74.40 every month).
    If you’re running a single-zone staging cluster, that’s “free” in every language except accounting.


    Act IV: Deploy, Expose, Brag

    The kubectl ceremony is delightfully unceremonial.

    1. Deploy:
    kubectl create deployment hello-app \
      --image=${REGION}-docker.pkg.dev/${PROJECT_ID}/hello-repo/hello-app:v1
    kubectl scale deployment hello-app --replicas=3

    Three pods spin up; Autopilot quietly decides which nodes (virtual though they may be) deserve the honor.

    1. Expose:
    kubectl expose deployment hello-app \
      --type=LoadBalancer --port=80 --target-port=8080

    GCP’s control plane now orchestrates a Layer-4 load balancer—yes, that shiny external IP you’ll text to your users.

    1. Fetch the IP:
    kubectl get service hello-app

    Copy the EXTERNAL-IP, paste it into a browser, and watch the hostname change with every refresh.
    You have just built a globally reachable, autoscaled, self-healing web service while your espresso is still warm.


    Act V: Budget, Burn Rate, and Boardroom Storytelling

    Let’s translate the tachometer into English.

    • Cluster management fee: $0.10/hour (~$74/month without free tier).
    • Workload cost: Autopilot bills per pod resource requests.
      Our hello-app asks politely for 100 mCPU and 128 MiB RAM, so you’re looking at ~$3.50/month for three replicas in us-west1.
    • Load balancer: First forwarding rule is ~$18/month; subsequent rules share the cost.

    Total runway for a three-pod MVP: under $25/month—cheaper than the SaaS subscription you’re probably expensing for CI/CD.


    Act VI: Clean-Up or Level-Up

    If this was just a rehearsal, tear it down:

    kubectl delete service hello-app
    gcloud container clusters delete hello-cluster --region=${REGION}

    But if you’re shipping, keep the cluster and iterate:

    • Wire a custom domain via Cloud DNS and a global static IP.
    • Add a CI pipeline in Cloud Build that auto-pushes on every git push.
    • Swap the Service for an Ingress to get HTTP/2, SSL, and path-based routing without extra load balancers.

    Curtain Call: The Meta-Narrative

    Kubernetes used to be a rite of passage—an epic saga of YAML and tears.
    GKE’s Autopilot flips the script: infrastructure becomes a utility, like electricity or Wi-Fi.
    You still need to know Ohm’s Law, but you no longer need to string copper across the continent.

    So, dear founder, the next time an investor asks, “Can we see it live by Thursday?”
    Smile, push your chair back, and say, “Give me thirty minutes and a fresh cup of coffee.”


    Call to Action:
    Fork the hello-app repo, run the playbook above, and share your external IP—or your horror story—in the comments.

    Need deeper cost modeling? Drop your pod specs and traffic estimates; I’ll run the numbers in the GKE Pricing Calculator and post a follow-up.

    Let’s turn Thursday demos into Tuesday habits.