Skip to main content
Redhat Developers  Logo
  • Products

    Featured

    • Red Hat Enterprise Linux
      Red Hat Enterprise Linux Icon
    • Red Hat OpenShift AI
      Red Hat OpenShift AI
    • Red Hat Enterprise Linux AI
      Linux icon inside of a brain
    • Image mode for Red Hat Enterprise Linux
      RHEL image mode
    • Red Hat OpenShift
      Openshift icon
    • Red Hat Ansible Automation Platform
      Ansible icon
    • Red Hat Developer Hub
      Developer Hub
    • View All Red Hat Products
    • Linux

      • Red Hat Enterprise Linux
      • Image mode for Red Hat Enterprise Linux
      • Red Hat Universal Base Images (UBI)
    • Java runtimes & frameworks

      • JBoss Enterprise Application Platform
      • Red Hat build of OpenJDK
    • Kubernetes

      • Red Hat OpenShift
      • Microsoft Azure Red Hat OpenShift
      • Red Hat OpenShift Virtualization
      • Red Hat OpenShift Lightspeed
    • Integration & App Connectivity

      • Red Hat Build of Apache Camel
      • Red Hat Service Interconnect
      • Red Hat Connectivity Link
    • AI/ML

      • Red Hat OpenShift AI
      • Red Hat Enterprise Linux AI
    • Automation

      • Red Hat Ansible Automation Platform
      • Red Hat Ansible Lightspeed
    • Developer tools

      • Red Hat Trusted Software Supply Chain
      • Podman Desktop
      • Red Hat OpenShift Dev Spaces
    • Developer Sandbox

      Developer Sandbox
      Try Red Hat products and technologies without setup or configuration fees for 30 days with this shared Openshift and Kubernetes cluster.
    • Try at no cost
  • Technologies

    Featured

    • AI/ML
      AI/ML Icon
    • Linux
      Linux Icon
    • Kubernetes
      Cloud icon
    • Automation
      Automation Icon showing arrows moving in a circle around a gear
    • View All Technologies
    • Programming Languages & Frameworks

      • Java
      • Python
      • JavaScript
    • System Design & Architecture

      • Red Hat architecture and design patterns
      • Microservices
      • Event-Driven Architecture
      • Databases
    • Developer Productivity

      • Developer productivity
      • Developer Tools
      • GitOps
    • Secure Development & Architectures

      • Security
      • Secure coding
    • Platform Engineering

      • DevOps
      • DevSecOps
      • Ansible automation for applications and services
    • Automated Data Processing

      • AI/ML
      • Data Science
      • Apache Kafka on Kubernetes
      • View All Technologies
    • Start exploring in the Developer Sandbox for free

      sandbox graphic
      Try Red Hat's products and technologies without setup or configuration.
    • Try at no cost
  • Learn

    Featured

    • Kubernetes & Cloud Native
      Openshift icon
    • Linux
      Rhel icon
    • Automation
      Ansible cloud icon
    • Java
      Java icon
    • AI/ML
      AI/ML Icon
    • View All Learning Resources

    E-Books

    • GitOps Cookbook
    • Podman in Action
    • Kubernetes Operators
    • The Path to GitOps
    • View All E-books

    Cheat Sheets

    • Linux Commands
    • Bash Commands
    • Git
    • systemd Commands
    • View All Cheat Sheets

    Documentation

    • API Catalog
    • Product Documentation
    • Legacy Documentation
    • Red Hat Learning

      Learning image
      Boost your technical skills to expert-level with the help of interactive lessons offered by various Red Hat Learning programs.
    • Explore Red Hat Learning
  • Developer Sandbox

    Developer Sandbox

    • Access Red Hat’s products and technologies without setup or configuration, and start developing quicker than ever before with our new, no-cost sandbox environments.
    • Explore Developer Sandbox

    Featured Developer Sandbox activities

    • Get started with your Developer Sandbox
    • OpenShift virtualization and application modernization using the Developer Sandbox
    • Explore all Developer Sandbox activities

    Ready to start developing apps?

    • Try at no cost
  • Blog
  • Events
  • Videos

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

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

Share:

    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

    • Meet the Red Hat Node.js team at PowerUP 2025

    • How to use pipelines for AI/ML automation at the edge

    • What's new in network observability 1.8

    • LLM Compressor: Optimize LLMs for low-latency deployments

    • How to set up NVIDIA NIM on Red Hat OpenShift AI

    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 LinkedIn YouTube Twitter Facebook

    Products

    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform

    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

    Red Hat legal and privacy links

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

    Report a website issue