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

build: Replace CentOS 7 base images with Rocky Linux #3773

Merged
merged 5 commits into from
Jun 1, 2022

Conversation

gdemonet
Copy link
Contributor

Component: build

Context: There are some CVEs (notably CVE-2018-25032) for which a fix is only available in Red Hat 8 repositories, so we want to take a safer bet by running on a more recent base OS

Summary: The base image for metalk8s-utils and salt-master is changed from centos:7 to rockylinux:8.5.

Acceptance criteria: Everything keeps working as before.

@bert-e
Copy link
Contributor

bert-e commented May 18, 2022

Hello gdemonet,

My role is to assist you with the merge of this
pull request. Please type @bert-e help to get information
on this process, or consult the user documentation.

Status report is not available.

@bert-e
Copy link
Contributor

bert-e commented May 18, 2022

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • one peer

Peer approvals must include at least 1 approval from the following list:

@gdemonet gdemonet force-pushed the improvement/bump-centos-base-images branch from 6b9a30e to a514e5b Compare May 18, 2022 07:44
@gdemonet gdemonet marked this pull request as ready for review May 18, 2022 07:45
@gdemonet gdemonet requested a review from a team as a code owner May 18, 2022 07:45
@gdemonet gdemonet force-pushed the improvement/bump-centos-base-images branch from 4d5d863 to 1034c82 Compare May 18, 2022 08:36
Copy link
Collaborator

@TeddyAndrieux TeddyAndrieux left a comment

Choose a reason for hiding this comment

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

Overall LGTM, we will see if it pass the CI

Wondering if there is a reason to pick RockyLinux instead of Ubi for example ? (just asking I have no strong opinion on this choice)

images/metalk8s-utils/Dockerfile Outdated Show resolved Hide resolved
images/metalk8s-utils/Dockerfile Outdated Show resolved Hide resolved
Comment on lines -11 to +10
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el$CENTOS_VERSION-x86_64
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64
Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh, sad, el8 packages are also available on kubernetes-el7... make sense 🙃

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah... 🤷

images/salt-master/Dockerfile Outdated Show resolved Hide resolved
&& pip3 install pip==20.1 \
&& pip3 install "etcd3 != 0.11.0" \
&& yum install -y git \
&& dnf install -y git \
&& pip3 install "git+https://github.com/kubernetes-client/python.git@cef5e9bd10a6d5ca4d9c83da46ccfe2114cdaaf8#egg=kubernetes" \
Copy link
Collaborator

Choose a reason for hiding this comment

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

(not necessarily part of this PR, but I think we can now move to a "real" version of python-kubernetes since we do not really rely on it)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will open a ticket then!

@gdemonet
Copy link
Contributor Author

Wondering if there is a reason to pick RockyLinux instead of Ubi for example ? (just asking I have no strong opinion on this choice)

For metalk8s-utils, UBI was really missing too many packages (it doesn't have most core repos), so it was going to be a pain to download all the missing ones from various places, Rocky made more sense to me.
For salt-master, well, since we already have one base image in the ISO, I decided to use the same one to avoid increasing the storage consumption.

@gdemonet gdemonet force-pushed the improvement/bump-centos-base-images branch from 1034c82 to 006c3e1 Compare May 18, 2022 17:37
@bert-e
Copy link
Contributor

bert-e commented May 19, 2022

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • one peer

Peer approvals must include at least 1 approval from the following list:

@bert-e
Copy link
Contributor

bert-e commented May 23, 2022

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • one peer

Peer approvals must include at least 1 approval from the following list:

@gdemonet gdemonet force-pushed the improvement/bump-centos-base-images branch 4 times, most recently from 6c537c8 to 563b5a4 Compare May 25, 2022 06:10
@bert-e
Copy link
Contributor

bert-e commented May 25, 2022

Conflict

There is a conflict between your branch improvement/bump-centos-base-images and the
destination branch development/123.0.

Please resolve the conflict on the feature branch (improvement/bump-centos-base-images).

git fetch && \
git checkout origin/improvement/bump-centos-base-images && \
git merge origin/development/123.0

Resolve merge conflicts and commit

git push origin HEAD:improvement/bump-centos-base-images

@gdemonet gdemonet force-pushed the improvement/bump-centos-base-images branch from 563b5a4 to a63bbc9 Compare May 25, 2022 09:11
@bert-e
Copy link
Contributor

bert-e commented May 25, 2022

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • one peer

Peer approvals must include at least 1 approval from the following list:

Comment on lines 23 to 24
&& pip3 install pip==20.1 \
&& pip3 install "etcd3 != 0.11.0" \
Copy link
Collaborator

Choose a reason for hiding this comment

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

nitpick: It's not consistent 😢

Suggested change
&& pip3 install pip==20.1 \
&& pip3 install "etcd3 != 0.11.0" \
&& pip3 install "pip == 20.1" \
&& pip3 install "etcd3 != 0.11.0" \

@bert-e
Copy link
Contributor

bert-e commented May 25, 2022

Conflict

There is a conflict between your branch improvement/bump-centos-base-images and the
destination branch development/123.0.

Please resolve the conflict on the feature branch (improvement/bump-centos-base-images).

git fetch && \
git checkout origin/improvement/bump-centos-base-images && \
git merge origin/development/123.0

Resolve merge conflicts and commit

git push origin HEAD:improvement/bump-centos-base-images

@gdemonet gdemonet force-pushed the improvement/bump-centos-base-images branch from 3398ee5 to e59df61 Compare May 31, 2022 06:26
@bert-e
Copy link
Contributor

bert-e commented May 31, 2022

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • one peer

Peer approvals must include at least 1 approval from the following list:

@gdemonet gdemonet force-pushed the improvement/bump-centos-base-images branch from e59df61 to f8ef487 Compare May 31, 2022 06:31
gdemonet added 5 commits May 31, 2022 16:06
The `images/metalk8s-utils/configure-repos.sh` script was taking a
"CENTOS_VERSION" argument, but it appears the repository used for all
Red Hat-based distros is always the same, whether it's a 7 or 8 major.

So we remove this argument entirely, until this statement changes.
This will reduce the chances of being affected by CVEs on CentOS 7 not
being resolved in upstream repos, and ensure a more consistent
experience with the more common Red Hat 8 distributions which will be
used under MetalK8s.

Note that we also remove the `jnettop` tool (which is old, and not
available in EPEL 8), and install `iftop` instead.
This will avoid CVEs affecting CentOS 7 packages which may not be fixed
upstream.
We are not using CentOS 7 anymore (replaced by Rocky Linux), so let's
not keep this variable around.
To get rid of https://nvd.nist.gov/vuln/detail/CVE-2018-25032 in
salt-master and metalk8s-utils, and avoid future similar issues, we keep
the images updated by issuing a `dnf update` at build-time.
@gdemonet gdemonet force-pushed the improvement/bump-centos-base-images branch from f8ef487 to e4b7c6c Compare May 31, 2022 14:06
@gdemonet
Copy link
Contributor Author

gdemonet commented Jun 1, 2022

/approve

@bert-e
Copy link
Contributor

bert-e commented Jun 1, 2022

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • one peer

Peer approvals must include at least 1 approval from the following list:

The following options are set: approve

Copy link
Collaborator

@TeddyAndrieux TeddyAndrieux left a comment

Choose a reason for hiding this comment

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

:shipit:

@bert-e
Copy link
Contributor

bert-e commented Jun 1, 2022

In the queue

The changeset has received all authorizations and has been added to the
relevant queue(s). The queue(s) will be merged in the target development
branch(es) as soon as builds have passed.

The changeset will be merged in:

  • ✔️ development/123.0

The following branches will NOT be impacted:

  • development/2.0
  • development/2.1
  • development/2.10
  • development/2.11
  • development/2.2
  • development/2.3
  • development/2.4
  • development/2.5
  • development/2.6
  • development/2.7
  • development/2.8
  • development/2.9

There is no action required on your side. You will be notified here once
the changeset has been merged. In the unlikely event that the changeset
fails permanently on the queue, a member of the admin team will
contact you to help resolve the matter.

IMPORTANT

Please do not attempt to modify this pull request.

  • Any commit you add on the source branch will trigger a new cycle after the
    current queue is merged.
  • Any commit you add on one of the integration branches will be lost.

If you need this pull request to be removed from the queue, please contact a
member of the admin team now.

The following options are set: approve

@bert-e
Copy link
Contributor

bert-e commented Jun 1, 2022

I have successfully merged the changeset of this pull request
into targetted development branches:

  • ✔️ development/123.0

The following branches have NOT changed:

  • development/2.0
  • development/2.1
  • development/2.10
  • development/2.11
  • development/2.2
  • development/2.3
  • development/2.4
  • development/2.5
  • development/2.6
  • development/2.7
  • development/2.8
  • development/2.9

Please check the status of the associated issue None.

Goodbye gdemonet.

@bert-e bert-e merged commit 50ff721 into development/123.0 Jun 1, 2022
@bert-e bert-e deleted the improvement/bump-centos-base-images branch June 1, 2022 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants