TNS
VOXPOP
Will JavaScript type annotations kill TypeScript?
The creators of Svelte and Turbo 8 both dropped TS recently saying that "it's not worth it".
Yes: If JavaScript gets type annotations then there's no reason for TypeScript to exist.
0%
No: TypeScript remains the best language for structuring large enterprise applications.
0%
TBD: The existing user base and its corpensource owner means that TypeScript isn’t likely to reach EOL without a putting up a fight.
0%
I hope they both die. I mean, if you really need strong types in the browser then you could leverage WASM and use a real programming language.
0%
I don’t know and I don’t care.
0%
Containers

How to Add Container Support to Red Hat Cockpit

This tutorial walks through the process of adding podman container support to the Red Hat Cockpit system.
Feb 19th, 2020 12:00pm by
Featued image for: How to Add Container Support to Red Hat Cockpit
Feature image via Unsplash.

If you’re a Red Hat Enterprise Linux or CentOS user, chances are you’ve heard of Cockpit, a powerful web-based GUI that allows you to manage a number of tasks on your servers. With this tool, you can:

  • Get an at-a-glance look at system performance
  • View logs
  • Manage system storage
  • Enable/Disable the firewall
  • Configure networking
  • Create/manage user accounts
  • Stop/start services
  • View SSH sessions
  • View diagnostic reports and kernel dumps
  • Manage SELinux
  • Update software
  • Access the terminal

That’s all out of the box. You can also add other features to the system, such as container support. Understand, if you’re working with RHEL/CentOS 8, you’ll be adding podman support. If, on the other hand, you’re using an older release (such as CentOS 7), you can still add Docker support.

I’m going to walk you through the process of adding podman container support to the Cockpit system. Once you’ve done that, you’ll be able to download images and deploy containers. For anyone who’d prefer a handy GUI tool for this task, Cockpit is, by far, the easiest to get up and running. And considering you can do other admin tasks within this one tool, it makes perfect sense to add containers into the mix.

Let’s make this happen.

What You’ll Need

The only things you’ll need to add container support to Cockpit are:

  • A running instance of Cockpit (either on CentOS or RHEL).
  • A user with sudo privileges.

That’s it. Let’s make some magic. I’ll demonstrate on a freshly updated instance of CentOS 8.

Enabling Cockpit

Prior to CentOS 8, you had to install Cockpit. With CentOS 8, on the other hand, it’s installed out of the box. Even though the software is installed, it’s not enabled. So the first thing to be done is to enable Cockpit.

Log into your CentOS or RHEL server. If the server has a desktop environment, open a terminal window. From the terminal, issue the command:

sudo systemctl enable --now cockpit.socket

When prompted, type your sudo password and hit Enter. After that command completes, Cockpit is enabled and ready to go.

Accessing Cockpit

Before we continue on, let’s make sure you can access Cockpit. Point a web browser to: https://SERVER_IP:9090 (where SERVER_IP is the IP address of the hosting server). You should be greeted by the Cockpit login (Figure 1).

Figure 1: The Cockpit login.

Log in with the root user’s credentials, making sure to check the box for Reuse my password for privileged tasks. Why? Because at the moment, Podman isn’t capable of running rootless containers, so you’ll need that heightened privilege to work with Podman.

However, we’ve not added Podman support yet. So let’s add it. Log out of Cockpit and head back to the terminal window.

Adding Podman Support

In order to add Podman support, you’ll need to install another application. At the terminal window, issue the following command:

sudo dnf install cockpit-podman -y

Once that command completes, log back into Cockpit (with root’s credentials) and you should see Podman Containers listed in the left sidebar (Figure 2).

Figure 2: We’ve successfully added Podman support to Cockpit.

Click Podman Containers in the left navigation and you’ll see a warning that the service isn’t running (Figure 3).

Figure 3: The Cockpit Podman service isn’t running.

Make sure the checkbox for Automatically start podman on boot is checked, and then click Start podman.

You should now see the Podman Containers Cockpit dashboard (Figure 4).

Figure 4: The Podman Container dashboard.

Working with Podman Containers

Unless you’ve already used the podman command line, you won’t have any images or containers listed in the dashboard. Let’s fix that.

To download a new image, click Get new image. In the resulting pop-up (Figure 5), type the name of the image you want to download and wait for the results.

Figure 5: Downloading a container image via Cockpit.

Once the results have appeared (Figure 6), select the image you want and click Download.

Figure 6: Selecting the exact image you want to use.

There’s one caveat you’ll experience on CentOS. Unless you’re a subscriber to RHEL, you won’t be able to download images from the Red Hat repositories. That’s okay, because if you scroll down, you’ll find images from other sources.

After the image downloads, you’ll see it listed in the Dashboard. Click the run button (right-pointing arrow) associated with the image and you can then configure a container to be deployed in the resulting popup window (Figure 7).

Figure 7: Configuring your container for deployment.

Your deployed container will now be listed in the Podman Dashboard (Figure 8).

Figure 8: A running container listed in the Podman Cockpit Dashboard.

And that’s all there is to adding container support to the Cockpit web-based GUI. Although you might not work all of your container magic within the confines of this tool, it can make the management of your containers and images significantly easier.

Group Created with Sketch.
TNS owner Insight Partners is an investor in: Enable, Docker.
THE NEW STACK UPDATE A newsletter digest of the week’s most important stories & analyses.