Skip to content

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
  • Labs icon Lab
  • A Cloud Guru
Google Cloud Platform icon
Labs

Exploring Podman and Kubernetes Interoperability on RHEL

Podman can be used to capture the configuration of local containers and pods and export them to a Kubernetes YAML file. In this lab, we’re going to examine how interoperability between Podman and Kubernetes works by using Podman to generate a YAML configuration file. We'll use both Kubernetes and Podman to run the pod defined in our YAML file. Upon completion of this lab, you will have a solid understanding of how Podman interoperates with Kubernetes.

Google Cloud Platform icon
Labs

Path Info

Level
Clock icon Intermediate
Duration
Clock icon 1h 0m
Published
Clock icon Apr 23, 2021

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.

Table of Contents

  1. Challenge

    Create an nginx Podman Pod

    Before you can create a YAML file, you need a pod and some containers. First, create an nginx pod.

    Perform the following tasks:

    • Check for existing pods and containers.
    • Create a Podman pod named test-pod with port 80 published to 8080.
    • Start the nginx container:
      • Put it in the test-pod pod.
      • Set restart to always.
      • Set the name to test-nginx.
      • Use the nginx short name for the container image.
    • Check again for pods and containers.
    • Test the nginx pod with curl and a web browser.
  2. Challenge

    Generate a Kubernetes YAML File

    Use the podman generate kube command to generate your Kubernetes YAML file.

    Perform the following tasks:

    • Check again for pods and containers.
    • Create a YAML file from your test-pod pod.
      • Name the file test-pod.yml.
    • Examine the test-pod.yml file.
    • Clean up all Podman pods, containers, and images before proceeding.
  3. Challenge

    Execute Your Podman-Generated Kubernetes YAML File Using Podman

    Use Podman to run the pod defined in your test-pod.yml file.

    Perform the following tasks:

    • Check for existing pods and containers.
    • Run the pod from your test-pod.yml YAML file.
    • Check again for pods and containers.
    • Test the nginx pod with curl and a web browser.
    • Clean up all Podman pods, containers, and images before proceeding.
  4. Challenge

    Install and Start MicroK8s

    Before you can try to run your YAML file, you need to install and start MicroK8s. 3 scripts have been provided to do this in the cloud_user home directory. Run them in the following order: microk8s_1.sh, then microk8s_2.sh, and finally microk8s_3.sh. The first 2 scripts need to be run with sudo. The third must be run without sudo. Wait a minute between scripts 1 and 2 so that snapd can fully initialize.

    Note: You will need to log out of the lab server after script 2, and then log back in.

  5. Challenge

    Execute Your Podman-Generated Kubernetes YAML File Using MicroK8s

    Use MicroK8s to create your nginx pod using the test-pod.yml YAML file.

    Perform the following tasks:

    • Check to see if you have any Kubernetes pods.
    • Create your nginx pod using your test-pod.yml file.
    • Check again to see if you have any Kubernetes pods.
    • Get more information on the details and status of your pod.
    • Test the nginx pod with curl and a web browser.
    • Remove your test-pod pod.
    • Check again to see if you have any Kubernetes pods.

The Cloud Content team comprises subject matter experts hyper focused on services offered by the leading cloud vendors (AWS, GCP, and Azure), as well as cloud-related technologies such as Linux and DevOps. The team is thrilled to share their knowledge to help you build modern tech solutions from the ground up, secure and optimize your environments, and so much more!

What's a lab?

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Provided environment for hands-on practice

We will provide the credentials and environment necessary for you to practice right within your browser.

Guided walkthrough

Follow along with the author’s guided walkthrough and build something new in your provided environment!

Did you know?

On average, you retain 75% more of your learning if you get time for practice.

Start learning by doing today

View Plans