Into my Devops learning path πŸ‘¨β€πŸ’» I decided to deploy a monitoring centre into my workstation where I could be able to watch my containers, resources, logs, etc and continue improving my knowledge, in my case I’m using Silverblue developed by Fedora so in here it’s a little bit different the setup; as monitoring tool I choose Cockpit for its great integration and support.

  • Workstation: Silverblue πŸ–₯️
  • Container engine: Podman βš™οΈ
  • Monitoring tool(app/service):Cockpit πŸ“¦

I splinted out the instructions in 4 simple parts:

  1. Download.
  2. Installation.
  3. Implementation.
  4. Integration.

1. Download

Go to the official website and follow the instructions wrote on this part we need to add those packages into our immutable system πŸ€–.

rpm-ostree install cockpit-system cockpit-ostree cockpit-podman

You can add more extension if you needed it, like kdump, network-manager,etc.

Reboot the system to boot with the need deployment layer implemented.

systemctl reboot

Then when you are already login, checks out the packages are been implemented in your new deployment by typing:

rmp-ostree status

You will see something like:

Deployments:
● ostree://fedora:fedora/31/x86_64/silverblue
                   Version: 31.20200703.0 (2020-07-03T00:46:58Z)
                BaseCommit: b32ee7c7e67c096fadfd116b7cc1602ad45c68210d99d0d0734a295d4f64dde1
              GPGSignature: Valid signature by 7D22D5867F2A4236474BF7B850CB390B3C3359C4
       RemovedBasePackages: firefox 77.0.1-2.fc31
           LayeredPackages: cockpit-networkmanager cockpit-ostree cockpit-podman cockpit-system dnf fedora-workstation-repositories

2. Installation

Here we are gonna to setup and run our container as Root

# podman container runlabel --name cockpit-ws RUN cockpit/ws

Test the service is up and running from your web browser http://localhost:9090 (the connection is done by ssh so make sure the sshd service is running)

systemctl status sshd
systemctl start sshd

3. Implementation

Create the cockpit.service from the path: /etc/systemd/system/cockpit.service

eg:

[Unit]
Description=cockpit container monitoring

[Service]
Restart=on-failure
Killmode=none
ExecStart=/usr/bin/podman start -a cockpit-ws
ExecStop=/usr/bin/podman stop -t 2 cockpit-ws
SuccessExitStatus=143

[Install]
WantedBy=multi-user.target

4. Integration

Back to the official site we set the last step to start the cockpit on boot. As root:

#podman container runlabel INSTALL cockpit/ws

and enable the service

#systemctl enable cockpit.service

And here we are, our monitoring tool up and running by podman, in fact the nicer extension I liked when I tested it was cockpit-podman works really nice.

Hope this post it can be useful.