Skip to content
This repository has been archived by the owner on Jan 15, 2025. It is now read-only.

PMM-12573 - Upgrade Podman UI #1326

Merged
merged 87 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from 86 commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
6937dcc
rel Notes entry draft
catalinaadam Oct 4, 2024
ae71bc9
rel notes draft
catalinaadam Oct 4, 2024
d2b2ae0
Updated relnotes
catalinaadam Oct 7, 2024
6ae1b0d
corrected install v3 command
catalinaadam Oct 8, 2024
2200f16
Revert "corrected install v3 command"
catalinaadam Oct 8, 2024
535e998
typo
catalinaadam Oct 8, 2024
1a50c28
draft
catalinaadam Oct 9, 2024
a339810
draft
catalinaadam Oct 9, 2024
a6f0310
typo
catalinaadam Oct 10, 2024
070d440
updated troubleshooting and remaining topics
catalinaadam Oct 11, 2024
203e517
updated api
catalinaadam Oct 11, 2024
35e7c0c
Update upgrade_issues.md
catalinaadam Oct 16, 2024
73758bd
Update docs/how-to/upgrade.md
catalinaadam Oct 21, 2024
acd3b78
Update docs/pmm-upgrade/upgrade_docker.md
catalinaadam Oct 21, 2024
525e5b5
Update docs/pmm-upgrade/upgrade_from_ppm_2.md
catalinaadam Oct 21, 2024
2f969b9
Update docs/pmm-upgrade/upgrade_from_ppm_2.md
catalinaadam Oct 21, 2024
417f6cf
Merge branch 'PMM3_Beta' into Upgrade_changes
catalinaadam Oct 21, 2024
c5dab98
feedback from Matej
catalinaadam Oct 21, 2024
d873fea
added screenshot
catalinaadam Oct 21, 2024
7a222f1
Update docs/pmm-upgrade/upgrade_docker.md
catalinaadam Oct 22, 2024
ffab19a
feedback from Nurlan
catalinaadam Oct 23, 2024
1166b7e
feedback from Alex
catalinaadam Oct 23, 2024
634b8f2
added separate section about env changed from v2
catalinaadam Oct 23, 2024
afaab30
table formatting
catalinaadam Oct 23, 2024
37556c0
removed info abour force update via UI
catalinaadam Oct 23, 2024
6ac3352
table formatting
catalinaadam Oct 23, 2024
876052b
table formatting
catalinaadam Oct 23, 2024
7b1d084
table formatting
catalinaadam Oct 23, 2024
9858df4
table formatting
catalinaadam Oct 23, 2024
600510f
table formatting test
catalinaadam Oct 23, 2024
492950d
test
catalinaadam Oct 23, 2024
edec715
test2
catalinaadam Oct 23, 2024
c264596
Update env_var.md
alina-derkach-oaza Oct 23, 2024
8f4fff3
Update env_var.md
alina-derkach-oaza Oct 23, 2024
027e5ca
Update env_var.md
alina-derkach-oaza Oct 23, 2024
cd99f55
table formatting
catalinaadam Oct 24, 2024
83dd6bc
formatting
catalinaadam Oct 24, 2024
6529079
restructured topic
catalinaadam Oct 24, 2024
cf498dc
improved wording
catalinaadam Oct 24, 2024
53ad24f
note about new environment variables for PMM3
catalinaadam Oct 24, 2024
66f85b6
watchtower updates
catalinaadam Oct 24, 2024
3633d02
feedback from Nurlan
catalinaadam Oct 25, 2024
5c14a97
fixed formatting
catalinaadam Oct 25, 2024
80aa2ad
formatting
catalinaadam Oct 25, 2024
e237172
formatting
catalinaadam Oct 25, 2024
324ca48
replaced PMM2 references
catalinaadam Oct 28, 2024
9c39a7f
feedback from Nurlan
catalinaadam Oct 28, 2024
c2688e1
feedback from Alex D
catalinaadam Oct 28, 2024
308c036
Update docs/install-pmm/install-pmm-server/baremetal/docker/index.md
catalinaadam Oct 28, 2024
92833c3
Update docs/pmm-upgrade/upgrade_agent.md
catalinaadam Oct 28, 2024
71e0c4c
Update docs/pmm-upgrade/upgrade_helm.md
catalinaadam Oct 28, 2024
c0e0625
Update docs/pmm-upgrade/upgrade_helm.md
catalinaadam Oct 28, 2024
22737ea
Update docs/pmm-upgrade/upgrade_from_pmm_2.md
catalinaadam Oct 28, 2024
b2fcbc5
formatting
catalinaadam Oct 28, 2024
cfb5c1f
renamed "upgrade"
catalinaadam Oct 30, 2024
807251d
PMM-12573
catalinaadam Nov 4, 2024
c36365c
Update docs/pmm-upgrade/upgrade_podman.md
catalinaadam Nov 4, 2024
400fdb1
Update docs/pmm-upgrade/upgrade_podman.md
catalinaadam Nov 4, 2024
1407eaa
feedback from Nurlan
catalinaadam Nov 4, 2024
036d1f6
Merge branch 'UpgradePodman' of https://github.com/percona/pmm-doc in…
catalinaadam Nov 4, 2024
0a70c77
replaced remaining references /home/admin
catalinaadam Nov 4, 2024
c1a1020
formatting
catalinaadam Nov 4, 2024
c507bb9
formatting
catalinaadam Nov 4, 2024
ab57014
Update docs/pmm-upgrade/upgrade_podman.md
catalinaadam Nov 4, 2024
f26c699
moved upgrade instructions
catalinaadam Nov 6, 2024
8fa4e84
Update docs/pmm-upgrade/upgrade_podman.md
catalinaadam Nov 7, 2024
89462ea
feedback from Nurlan
catalinaadam Nov 7, 2024
f0df328
formatting
catalinaadam Nov 7, 2024
659c64c
Update docs/pmm-upgrade/upgrade_docker.md
catalinaadam Nov 7, 2024
c54bc54
Update docs/use/dashboards/dashboard-inventory.md
catalinaadam Nov 7, 2024
aff1536
formatting
catalinaadam Nov 7, 2024
e7a5398
formatting
catalinaadam Nov 7, 2024
a0c21db
Update docs/install-pmm/install-pmm-server/baremetal/podman/index.md
catalinaadam Nov 7, 2024
30ccf7f
Update docs/install-pmm/install-pmm-server/baremetal/podman/index.md
catalinaadam Nov 7, 2024
111a50b
Update docs/install-pmm/install-pmm-server/baremetal/podman/index.md
catalinaadam Nov 7, 2024
01b60d1
Merge branch 'Upgrade_changes' into UpgradePodman
catalinaadam Nov 7, 2024
35c14fc
Update index.md
catalinaadam Nov 7, 2024
4087d65
feedback from Matej
catalinaadam Nov 7, 2024
326ccdd
feedback from Talha
catalinaadam Nov 7, 2024
1b83a68
formatting
catalinaadam Nov 7, 2024
81d4374
formatting
catalinaadam Nov 8, 2024
ebaa365
Merge branch 'PMM3_Beta' into Upgrade_changes
catalinaadam Nov 8, 2024
e5edafd
formatting
catalinaadam Nov 8, 2024
2aae369
Merge branch 'Upgrade_changes' of https://github.com/percona/pmm-doc …
catalinaadam Nov 8, 2024
13a574b
Merge branch 'Upgrade_changes' into UpgradePodman
catalinaadam Nov 8, 2024
d206f91
Merge branch 'PMM3_Beta' into UpgradePodman
catalinaadam Nov 12, 2024
fe2e80c
Merge branch 'PMM3_Beta' into UpgradePodman
catalinaadam Nov 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
149 changes: 145 additions & 4 deletions docs/install-pmm/install-pmm-server/baremetal/podman/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@

This section provides instructions for running PMM Server with Podman based on our [Docker image](https://hub.docker.com/r/percona/pmm-server).

## About Podman


!!! seealso alert alert-info "See also"
- [Docker](../docker/index.md)
- Other [tags](https://hub.docker.com/r/percona/pmm-server/tags) are available.

Podman is an open-source project available on most Linux platforms and resides on [GitHub](https://github.com/containers/podman). Podman is a daemonless container engine for developing, managing, and running Open Container Initiative (OCI) containers and container images on your Linux System.
Podman is an open-source, daemonless container engine for developing, managing, and running Open Container Initiative (OCI) containers and container images on Linux systems. It is widely supported across Linux distributions and hosted on [GitHub](https://github.com/containers/podman).

Non-privileged users could run containers under the control of Podman.
One of Podman’s advantages is that it allows non-privileged users to run containers, enhancing security by avoiding elevated permissions.

It could be just aliased (`alias docker=podman`) with docker and work with the same way. All instructions from [Docker](../docker/index.md) section also apply here.
Podman is compatible with Docker; by using an alias (`alias docker=podman`), you can run Docker commands seamlessly with Podman. All instructions in the Docker section apply to Podman as well.

Percona recommends running PMM as a non-privileged user and running it as part of the SystemD service provided. SystemD service ensures that the service is running and maintains logs and other management features (start, stop, etc.).
Percona recommends running PMM with Podman as a non-privileged user and as part of the provided SystemD service. SystemD helps ensure that the service is actively running and offers logging and management functions, such as start, stop, and restart.

## Before you start

Expand All @@ -26,6 +28,145 @@ Percona recommends running PMM as a non-privileged user and running it as part o
- Grant Watchtower access to the Docker socket to monitor and manage containers effectively, ensuring proper security measures are in place to protect the Docker socket.
- Verify that both Watchtower and PMM Server are on the same network, or ensure PMM Server can connect to Watchtower for communication. This network setup is essential for PMM Server to initiate updates through Watchtower.

## Update mechanism

PMM Server updates work differently in Podman compared to Docker due to security policies:

- Docker updates use a simpler flow where PMM Server directly instructs Watchtower to replace the Docker container in one step.
- Podman updates require SystemD integration and follow a multi-step process with environment file changes for better security isolation.

## Install

You can install PMM with either automated UI-based updates or a manual update method, depending on your preferences.

The UI-based method, using Watchtower, enables direct updates from the web interface without requiring command-line access and automates the process.

On the other hand, the manual method offers a simpler setup with complete control over updates and no need for additional services, but it requires command-line access and manual intervention to track and apply updates.

=== "Installation with UI updates"

This method enables updates through the PMM web interface using Watchtower and SystemD services. When you initiate an update in the UI, PMM Server updates its image reference, prompting Watchtower to pull the new image. Watchtower then stops the existing container, and SystemD automatically restarts it with the updated image.
{.power-number}

1. Create PMM Server service file at `~/.config/systemd/user/pmm-server.service`:

```sh
[Unit]
Description=pmm-server
Wants=network-online.target
After=network-online.target
After=nss-user-lookup.target nss-lookup.target
After=time-sync.target
[Service]
EnvironmentFile=~/.config/systemd/user/pmm-server.env
Restart=on-failure
RestartSec=20
ExecStart=/usr/bin/podman run \
--volume ~/.config/systemd/user/:/home/pmm/update/ \
--rm --replace=true --name %N \
--env-file=~/.config/systemd/user/pmm-server.env \
--net pmm_default \
--cap-add=net_admin,net_raw \
--userns=keep-id:uid=1000,gid=1000 \
-p 443:8443/tcp --ulimit=host ${PMM_IMAGE}
ExecStop=/usr/bin/podman stop -t 10 %N
[Install]
WantedBy=default.target
```

2. Create the environment file at `~/.config/systemd/user/pmm-server.env`:

```sh
PMM_WATCHTOWER_HOST=http://watchtower:8080
PMM_WATCHTOWER_TOKEN=123
PMM_IMAGE=docker.io/perconalab/pmm-server:3
```

3. Create or update the Watchtower service file at `~/.config/systemd/user/watchtower.service`:

```sh
[Unit]
Description=watchtower
Wants=network-online.target
After=network-online.target
After=nss-user-lookup.target nss-lookup.target
After=time-sync.target
[Service]
Restart=on-failure
RestartSec=20
Environment=WATCHTOWER_HTTP_API_UPDATE=1
Environment=WATCHTOWER_HTTP_API_TOKEN=123
Environment=WATCHTOWER_NO_RESTART=1
Environment=WATCHTOWER_DEBUG=1
ExecStart=/usr/bin/podman run --rm --replace=true --name %N \
-v ${XDG_RUNTIME_DIR}/podman/podman.sock:/var/run/docker.sock \
-e WATCHTOWER_HTTP_API_UPDATE=${WATCHTOWER_HTTP_API_UPDATE} \
-e WATCHTOWER_HTTP_API_TOKEN=${WATCHTOWER_HTTP_API_TOKEN} \
-e WATCHTOWER_NO_RESTART=${WATCHTOWER_NO_RESTART} \
-e WATCHTOWER_DEBUG=${WATCHTOWER_DEBUG} \
--net pmm_default \
--cap-add=net_admin,net_raw \
docker.io/perconalab/watchtower:latest
ExecStop=/usr/bin/podman stop -t 10 %N
[Install]
WantedBy=default.target
```

4. Start services:

```sh
systemctl --user enable --now pmm-server
systemctl --user enable --now watchtower
```

5. Go to `https://localhost:8443` to access the PMM user interface in a web browser. If you are accessing the host remotely, replace `localhost` with the IP or server name of the host.

=== "Installation with manual updates"

The installation with manual updates offers a straightforward setup with direct control over updates, without relying on additional services. In this approach, you manually update the `PMM_IMAGE` in the environment file and restart the PMM Server service. SystemD then automatically manages the container replacement.
{.power-number}

1. Create PMM Server service file at `~/.config/systemd/user/pmm-server.service`:

```sh
[Unit]
Description=pmm-server
Wants=network-online.target
After=network-online.target
After=nss-user-lookup.target nss-lookup.target
After=time-sync.target
[Service]
EnvironmentFile=~/.config/systemd/user/pmm-server.env
Restart=on-failure
RestartSec=20
ExecStart=/usr/bin/podman run \
--rm --replace=true --name %N \
--env-file=~/.config/systemd/user/pmm-server.env \
--net pmm_default \
--cap-add=net_admin,net_raw \
--userns=keep-id:uid=1000,gid=1000 \
-p 443:8443/tcp --ulimit=host ${PMM_IMAGE}
ExecStop=/usr/bin/podman stop -t 10 %N
[Install]
WantedBy=default.target
```

2. Create the environment file at `~/.config/systemd/user/pmm-server.env`:

```sh
PMM_IMAGE=docker.io/perconalab/pmm-server:3
```

3. Start services:

```sh
systemctl --user enable --now pmm-server
```

4. Go to `https://localhost:8443` to access the PMM user interface in a web browser. If you are accessing the host remotely, replace `localhost` with the IP or server name of the host.

For information on manually upgrading, see [Upgrade PMM Server using Podman](../../../../pmm-upgrade/upgrade_podman.md).
=======
## Run as non-privileged user to start PMM

??? info "Summary"
Expand Down
11 changes: 6 additions & 5 deletions docs/pmm-upgrade/upgrade_podman.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Before starting the upgrade, complete these preparation steps to ensure you can

1. Create a backup before upgrading, as downgrades are not possible. Therefore, reverting to a previous version requires an backup made prior to the upgrade.

2. Verify your current PMM version: Check your current PMM version by navigating to **PMM Configuration > Updates** or by running the following command.
2. Verify your current PMM version: Check your current PMM version by navigating to **PMM Configuration > Updates** or by running the following command:

```sh
podman exec -it pmm-server \
Expand All @@ -21,15 +21,16 @@ Follow these steps to upgrade your PMM Server while preserving your monitoring d

1. [Back up your data](../install-pmm/install-pmm-server/baremetal/podman/backup_container_podman.md).

2. Update PMM tag by editing `~/.config/pmm-server/env` file and running the following command to set the latest release version:
2. Update PMM tag by editing `~/.config/systemd/user/pmm-server.env` file and running the following command to set the latest release version:

```sh
sed -i "s/PMM_TAG=.*/PMM_TAG=3.0.0/g" ~/.config/pmm-server/env
sed -i "s/PMM_IMAGE=.*/PMM_IMAGE=docker.io/percona/pmm-server:3.0.0/g" ~/.config/systemd/user/pmm-server.env
```

3. Pre-pull the new image to ensure a faster restart:

```sh
source ~/.config/pmm-server/env
source ~/.config/systemd/user/pmm-server.env
podman pull ${PMM_IMAGE}:${PMM_TAG}
```

Expand All @@ -45,7 +46,7 @@ Follow these steps to upgrade your PMM Server while preserving your monitoring d
podman ps | grep pmm-server
```

3. Check the logs for any errors:
6. Check the logs for any errors:

```sh
podman logs pmm-server
Expand Down
10 changes: 9 additions & 1 deletion docs/release-notes/3.0.0_Beta.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,19 @@ This change comes with proactive notifications, alerting you immediately when ne
When migrating from PMM v2 to PMM v3, you’ll need to update your environment variables to match the new naming convention. This is because PMM v3 introduces several important changes to improve consistency and clarity:

- environment variables now use PMM_ prefix
- some boolean flags reversed (e.g., `DISABLE_` `ENABLE_`)
- some boolean flags reversed (e.g., `DISABLE_` > `ENABLE_`)
- removed deprecated variables

To check the Migration reference table, see [Environment variables in PMM](../install-pmm/install-pmm-server/baremetal/docker/env_var.md##variables-for-migrating-from-pmm-v2-to-pmm-v3).

### UI-based upgrades for Podman installations

You can now upgrade PMM Server installations running under Podman directly through the **PMM Configuration > Updates** panel in the UI.

This functionality integrates Watchtower for automated container updates and requires configuration of new environment variables (`PMM_WATCHTOWER_HOST`, `PMM_WATCHTOWER_TOKEN`) as well as relevant systemd service settings.

For detailed configuration instructions, see [Installation with UI updates](../install-pmm/install-pmm-server/baremetal/podman/index.md).

### Encryption of sensitive data

To strengthen the security of your monitoring setup, all sensitive information stored in the PMM Server database, including usernames, passwords, AWS keys, Azure credentials, and TLS/SSL certificates, is now encrypted.
Expand Down
2 changes: 1 addition & 1 deletion docs/troubleshoot/alerting_issues.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ If you have any templates available in the `/srv/ia/templates` folder, make sur

If you get an email or page from your system that the IP is not reachable from outside my organization, do the following:

To configure your PMM Server’s Public Address, select <i class="uil uil-cog"></i> **Configuration** → <i class="uil uil-setting"></i> **Settings* → *Advanced Settings**, and supply an address to use in your alert notifications.
To configure your PMM Server’s Public Address, select **PMM Configuration > Settings > Advanced Settings**, and supply an address to use in your alert notifications.

## Alert Rule Templates are disabled

Expand Down
Loading