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

Kubernetes 101 for developers: Names, ports, YAML files, and more

August 30, 2022
Don Schenck
Related topics:
ContainersKubernetes
Related products:
Developer SandboxDeveloper ToolsetRed Hat OpenShift

    Once you've written your first container-based application and have it running in Docker or Podman, you're ready to move to the next level. That means multiple applications—microservices—running within a managed environment. Kubernetes, an open source container orchestration platform, is just such an environment, and by far the most popular one at that. Let's consider it from a developer's perspective.

    Run multiple containers on Kubernetes

    Running a container with Docker or Podman is great, but it's only a start. To implement an entire system, you need several services (or microservices, if you will). Kubernetes can orchestrate the entire system in a namespace, giving you both isolation from other namespaces and a shared environment within a namespace. You can just plop your applications into your Kubernetes cluster and let it run. Well ... it might not be that simple, but that's not a bad generalization.

    Kubernetes port management

    Imagine you're running multiple services in Kubernetes, and those services use network ports for communications—a Web API or a database, for example. Kubernetes will automatically allow you to use the same port number for multiple services. This is fantastic for developers. You don't need to remember that "this API uses port 8080, this other one uses 8082" and so on. Instead, you simply assign a port and let Kubernetes worry about it. Eight applications that all use port 443? No problem.

    Kubernetes names

    Once you have those services running, Kubernetes helps make life easier for you by allowing you to reference any other service by the name you assign to it. You don't need to know IP addresses or some long, convoluted name. You named the service getcustomer? Well, then ... you reference it as getcustomer, no matter where it's running within Kubernetes. Even after that service scales up to several running instances, you don't need to concern yourself with that. Just call the service by its name; Kubernetes will do the load balancing.

    Kubernetes Secrets

    When dealing with sensitive information like passwords and connect strings in your code, Kubernetes once again makes life easy for the developer. When you establish a Secret in Kubernetes, you can assign an environment variable name to it. Then, in your code, you simply use the value of that environment variable as the value of the Secret.

    So easy. So nice.

    Kubernetes rolling updates

    Kubernetes, out of the box, supports what's known as a rolling update. This means that you can start a new version of your application while the older version is running. Once the new version is ready, Kubernetes will automagically transfer traffic over to your new version.

    As a developer, you might think this is more of a big deal for the operations side of things, but here's the thing: Rolling updates are great when you're developing code and desk testing. While you're working at your local PC and want to try the new version of your application, you simply move it to Kubernetes and let the rolling update handle it. No need to stop this, start that, change routing, etc., etc. As a developer, this makes life much easier. It seems like a trivial thing, but you'll get spoiled very quickly.

    Kubernetes and dependencies

    We're all too familiar with the old "It works on my PC" problem: You carefully craft an artisanal service that works perfectly on your workstation, and after you have gently deployed it to a server, it crashes, because one of the dependencies on the server is the wrong version. But you can't change that or another application might break. Cue frustration and complexity.

    Or, you could build a container that holds all the dependencies you need and deploy it to Kubernetes. Done. No conflict, no frustration, reduced complexity. For a developer, this is wonderful.

    Kubernetes YAML files

    Yes, yes, we developers are all about source code. But what about using source code to deploy our applications? Is that a thing?

    With Kubernetes, it is. Alongside your Java (or C# or Node.js or Python or...) code, you'll be creating one or more YAML files to define the objects and environment your application needs in Kubernetes.

    But why should a developer care? Isn't this the realm of operations?

    Well, it's good for a developer because it makes your development and desk testing completely repeatable and consistent. And when you're finished, you have code to turn over to the operations folks, who can tweak it, improve it, and get it ready for production. That same code is then available to you for any future work. It's a cycle, and it's helpful for everyone, and it has a name: DevOps.

    Want more?

    Reading is fine, but you can actually use Kubernetes for free by taking advantage of our free offering, the Developer Sandbox for Red Hat OpenShift. (Red Hat Openshift is a Kubernetes distribution focused on developer experience and application security that's platform agnostic.) We even have an activity that you can do to get started with Kubernetes.

    Last updated: November 8, 2023

    Recent Posts

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

    • Control multicluster costs with right-sizing in Red Hat Advanced Cluster Management 5

    • Lightbits is now certified for Red Hat OpenStack Services on OpenShift

    • What's new in Red Hat OpenShift 5 for developers

    • On-demand screen context in Red Hat Developer Hub intelligent assistant

    What’s up next?

    The evolution of microservices and containers in recent years significantly changed the way we design, develop, and run software. In Kubernetes Patterns, you'll learn to create cloud-native applications with Kubernetes as a runtime platform and build container images directly within the cluster.

    Get the free e-book
    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