Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document how to install on RHEL/CentOS 8/9 #838

Merged

Conversation

marckhouzam
Copy link
Contributor

@marckhouzam marckhouzam commented Jan 9, 2025

What this PR does / why we need it

This PR documents how to install the Tanzu CLI on RHEL/CentOS 8 and 9.

The idea is that users should install the CLI as follows when running on RHEL/CentOS 8 and 9:

cat << EOF | sudo tee /etc/yum.repos.d/tanzu-cli.repo
[tanzu-cli]
name=Tanzu CLI
baseurl=https://storage.googleapis.com/tanzu-cli-installer-packages/rpm/tanzu-cli
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://storage.googleapis.com/tanzu-cli-installer-packages/keys/TANZU-PACKAGING-GPG-RSA-KEY.gpg
EOF

sudo rpm --import https://storage.googleapis.com/tanzu-cli-installer-packages/keys/TANZU-PACKAGING-GPG-RSA-KEY-CENTOS9.gpg

sudo yum install -y tanzu-cli-centos9 # dnf install can also be used

# or for pre-releases
sudo yum install -y tanzu-cli-centos9-unstable # dnf install can also be used

Why we need to run rpm --import manually?

When testing on a real VM running Centos 9, I learned that because both key are configured in the /etc/yum.repos.d/tanzu-cli.repo file, yum will run an rpm --import on both and will fail on the standard key TANZU-PACKAGING-GPG-RSA-KEY.gpg and the installation will still fail.

So, I did two things to fix this:
1- put the TANZU-PACKAGING-GPG-RSA-KEY-CENTOS9.gpg key first in the list of keys in the /etc/yum.repos.d/tanzu-cli.repo file. This means that on a first yum install the key will be imported successfully, although the yum install will still fail; this allows to run yum install a second time, and have it succeed because it will find the required key.
2- have the user run rpm --import manually first, to avoid the first failure.

With the instructions in this PR, there should be no yum install failure at all.

An alternative since we ask users to import the new TANZU-PACKAGING-GPG-RSA-KEY-CENTOS9.gpg key manually, is that we could remove that key from the /etc/yum.repos.d/tanzu-cli.repo file. The value in doing that is that it would keep the instructions the same as for the normal tanzu-cli package except for the rpm –import and the yum install tanzu-cli-centos9. The value in leaving that second key in the file is that if the user forgets to run the rpm –import, then running yum install twice will work.

Which issue(s) this PR fixes

Fixes # N/A

Describe testing done for PR

Let CI run

Release note

Document special installation instructions for RHEL/CentOS 8/9

Additional information

Special notes for your reviewer

The new tanzu-cli-centos packages will only be made available starting with CLI v1.5.2.
To make them available for already released versions would require building each RPM package with the new name and signing it with the new key. This would take more effort than we felt was worthwhile.
To install older versions on Centos 8/9, users will need to deactivate the gpg check using --nogpgcheck; I have specified this in the documentation update in this PR.

Copy link
Contributor

@vuil vuil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Just have a tiny suggestion to maybe improve clarity marginally.

docs/quickstart/install.md Show resolved Hide resolved
@marckhouzam marckhouzam force-pushed the marck/rpmCentosInstallation branch from 12b0370 to 72a8e68 Compare January 10, 2025 16:03
@marckhouzam marckhouzam marked this pull request as ready for review January 10, 2025 16:06
@marckhouzam marckhouzam requested a review from a team as a code owner January 10, 2025 16:06
@marckhouzam marckhouzam force-pushed the marck/rpmCentosInstallation branch from 72a8e68 to 9140d4a Compare January 10, 2025 16:15
Copy link
Contributor

@vuil vuil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@marckhouzam marckhouzam force-pushed the marck/rpmCentosInstallation branch from 9140d4a to dd8376a Compare January 14, 2025 13:34
@marckhouzam marckhouzam merged commit ae63e71 into vmware-tanzu:main Jan 14, 2025
7 checks passed
@marckhouzam marckhouzam deleted the marck/rpmCentosInstallation branch January 14, 2025 19:18
marckhouzam added a commit to marckhouzam/tanzu-cli that referenced this pull request Jan 14, 2025
@marckhouzam marckhouzam added this to the v1.5.2 milestone Jan 14, 2025
marckhouzam added a commit that referenced this pull request Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants