Skip to main content
AI
  • Get started with AI

    • Red Hat AI

      Accelerate the development and deployment of enterprise AI solutions.

    • AI learning hub

      Explore learning materials and tools, organized by task.

    • AI interactive demos

      Click through scenarios with Red Hat AI, including training LLMs and more.

    • AI/ML learning paths

      Expand your Red Hat OpenShift AI knowledge using these learning resources.

    • AI quickstarts

      Focused AI use cases designed for fast deployment on Red Hat AI platforms.

    • No-cost AI training

      Foundational Red Hat AI training.

  • Featured resources

    • Red Hat OpenShift AI
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

Red Hat AI Factory with NVIDIA

Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.

Learn
  • Self-guided

    • Documentation

      Find answers, get step-by-step guidance, and learn how to use Red Hat products.

    • Learning paths

      Explore curated walkthroughs for common development tasks.

    • Guided learning

      Receive custom learning paths powered by our AI assistant.

    • See all learning
  • Hands-on

    • Developer Sandbox

      Spin up Red Hat's products and technologies without setup or configuration.

    • Interactive labs

      Learn by doing in these hands-on, browser-based experiences.

    • Interactive demos

      Click through product features in these guided tours.

  • Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics
  • Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
Build
  • Get started

    • Red Hat build of Podman Desktop

      A downloadable, local development hub to experiment with our products and builds.

    • Developer Sandbox

      Spin up Red Hat's products and technologies without setup or configuration.

  • Download products

    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products
  • Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset
  • References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
Community
  • Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions
  • Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github
  • Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

Join the Red Hat Developer program

Download Red Hat products and project builds, access support documentation, learning content, and more.

ConsoleDocsSupport Search
New For you

Recommended

We'll recommend resources you may like as you browse. Try these suggestions for now.

  • Product downloads
  • Cheat sheets
  • Red Hat Developer learning portal
  • Developer blog
  • E-books
  • Developer Sandbox
Log in

Get more with a Red Hat Developer account

  • Product downloads
  • Console access
  • Event registration
  • Training & trials
Explore more account benefitsLog in or register

A subscription may be required for some services.

Contact us

How to Set Up A Kubernetes Developer Box

June 8, 2016
Hemant Jain
Related topics:
ContainersLinux
Related products:
Red Hat Enterprise Linux

    Kubernetes is a great tool for container orchestration on a server cluster. It makes it easy to deploy lots of containers in a resource-efficient way using a simple interface.

    But one thing that is not easy to do with Kubernetes is to deploy it locally. Kubernetes is designed to run on an actual cluster, which means using it only on a single computer is tough.

    I know. You're probably wondering why you'd want to use Kubernetes locally in the first place. The whole point of Kubernetes is to simplify the management of containers on a cluster, right? So running it on a single server might seem like building a second kitchen inside your garage. You could do it, but would it really be that useful?

    Well, yes. There are actually some good reasons why you might want to run Kubernetes on a local test box. Maybe you need to test how your apps behave under Kubernetes before putting them into production. Or perhaps you just want to hone your skills, working with the kubectl CLI interface in a safe, sandboxed environment.

    Fortunately, it's possible to run Kubernetes locally for these purposes. In fact, it's so possible that there's more than one way to do it. But in this post I'll cover the most bare-metal route, which involves running Kubernetes through Docker on your local machine.

    (Another way to do this is with Vagrant, but that requires running a virtual machine through a traditional hypervisor. A local Kubernetes installation through Docker is much lighter on system resources.)

    (Lastly, the Red Hat recommended way is to use the Red Hat Container Development Kit, available here (free), from Red Hat Developers.)

    The only prerequisite — Your development box needs to be running a modern mainstream GNU/Linux distribution such as Red Hat Enterprise Linux, which is available for $0 for development use (you can download it here).

    Step 1: Install and Configure Docker and kubectl

    We need two tools for this to work. The first is Docker. The procedure for installing Docker varies according to your OS, but in most cases, it can be done easily through the package manager (yum and dnf on RHEL and Fedora). Check out the Docker installation documentation for specifics.

    The second tool to grab is kubectl, the Kubernetes CLI tool. You can get this with a quick curl (wget would work fine, too), followed by commands that make the downloaded file executable, and place it in your PATH. The following commands will get the job done:

    curl -O https://storage.googleapis.com/kubernetes-release/release/v1.2.2/bin/linux/amd64/kubectl
    chmod +x kubectl
    mv kubectl /usr/local/bin/kubectl

    Lastly, we need to set an environment variable specifying the Kubernetes version we're using. We just downloaded version 1.2.2, so enter:

    export K8S_VERSION=v1.2.2

    (If you have a different version of kubectl installed, then change the preceding command accordingly.)

    Step 2: Start Docker

    This next step is to start a Kubernetes master (using an image from the Google Cloud Platform repository) on your local machine via Docker. This single command will do it all for you:

    docker run \
    --volume=/:/rootfs:ro \
    --volume=/sys:/sys:ro \
    --volume=/var/lib/docker/:/var/lib/docker:rw \
    --volume=/var/lib/kubelet/:/var/lib/kubelet:rw \
    --volume=/var/run:/var/run:rw \
    --net=host \
    --pid=host \
    --privileged=true \
    --name=kubelet \
    -d \
    gcr.io/google_containers/hyperkube-amd64:${K8S_VERSION} \
    /hyperkube kubelet \
    --containerized \
    --hostname-override="127.0.0.1" \
    --address="0.0.0.0" \
    --api-servers=http://localhost:8080 \
    --config=/etc/kubernetes/manifests \
    --cluster-dns=10.0.0.10 \
    --cluster-domain=cluster.local \
    --allow-privileged=true --v=2

    Step 3: Create a Cluster

    The final step is to use kubectl to create a cluster for us to manage, like so:

    kubectl config set-cluster test-doc --server=http://localhost:8080
    kubectl config set-context test-doc --cluster=test-doc
    kubectl config use-context test-doc

    Step 4: Enjoy

    That's it! With your Kubernetes master running and kubectl installed in your PATH, you can now use the latter to orchestrate your local Kubernetes cluster.

    If you want to launch other apps in containers locally so that you can orchestrate them with Kubernetes, feel free to use Docker to do so. You can also check out the kubectl documentation for the complete list of commands available from the tool.

    Parting Thoughts

    This is a handy way to do some quick testing or experimentation with Kubernetes on a developer box. But it's also worth acknowledging the downsides of this approach so that you're aware of the limitations.

    The biggest limitation is that this setup doesn't make it easy to sync your development and testing environments. If you update your app code, you'll have to restart Docker with Kubernetes and the newer app images manually. If this is a real problem for you, you might have a better experience with Vagrant. Vagrant doesn't automate the process entirely, but it at least makes it a little faster to start up a new cluster.

    The other downside to this method is that it doesn't involve real networking. It does everything over localhost. In most situations, this should not be a problem. But if you need to test Kubernetes for the orchestration of apps in a cluster containing multiple nodes with different real IP addresses, this won't work well. In that case, you really need a real cluster (or a set of virtual machines, at least).

    Despite these drawbacks, the steps described above are useful if you need to do some quick Kubernetes testing, or if you just want to practice using kubectl.


    Hemant Jain

    Hemant Jain is the founder and owner of Rapidera Technologies, a full service software development shop. He and his team focus a lot on modern software delivery techniques and tools. Prior to Rapidera he managed large scale enterprise development projects at Autodesk and Deloitte.

    Last updated: January 19, 2023

    Recent Posts

    • A day in the life of an NVIDIA H100 on Red Hat OpenShift 5

    • Migrate BuildConfigs to builds for Red Hat OpenShift with one plug-in install

    • Run Red Hat Enterprise Linux CoreOS on NVIDIA BlueField DPUs

    • Agent harness engineering: Separating model capabilities from enforcement

    • What's new for developers in Red Hat Enterprise Linux 10.3 and 9.9

    What’s up next?

     

    Red Hat Developers logo

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Build

    • Developer Sandbox
    • Developer tools
    • Interactive tutorials
    • API catalog

    Quicklinks

    • Learning resources
    • E-books
    • Cheat sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site status dashboard
    • Report a security problem

    Red Hat Developer

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2026 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility
    Ask AI