Skip to content

Commit

Permalink
Drop support for RHEL 7 / CentOS 7 (#11246)
Browse files Browse the repository at this point in the history
* Simplify docker systemd unit

systemd handles missing unit by ignoring the dependency so we don't need
to template them.

* Remove RHEL 7/CentOS 7 support

- remove ref in kubespray roles
- move CI from centos 7 to 8
- remove docs related to centos7

* Remove container-storage-setup

Only used for RHEL 7 and CentOS 7
  • Loading branch information
VannTen authored Sep 5, 2024
1 parent 3da6c4f commit 7f527f6
Show file tree
Hide file tree
Showing 34 changed files with 22 additions and 296 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,11 @@ vagrant up
- **Flatcar Container Linux by Kinvolk**
- **Debian** Bookworm, Bullseye
- **Ubuntu** 20.04, 22.04, 24.04
- **CentOS/RHEL** 7, [8, 9](docs/operating_systems/centos.md#centos-8)
- **CentOS/RHEL** [8, 9](docs/operating_systems/centos.md#centos-8)
- **Fedora** 37, 38
- **Fedora CoreOS** (see [fcos Note](docs/operating_systems/fcos.md))
- **openSUSE** Leap 15.x/Tumbleweed
- **Oracle Linux** 7, [8, 9](docs/operating_systems/centos.md#centos-8)
- **Oracle Linux** [8, 9](docs/operating_systems/centos.md#centos-8)
- **Alma Linux** [8, 9](docs/operating_systems/centos.md#centos-8)
- **Rocky Linux** [8, 9](docs/operating_systems/centos.md#centos-8)
- **Kylin Linux Advanced Server V10** (experimental: see [kylin linux notes](docs/operating_systems/kylinlinux.md))
Expand Down
3 changes: 0 additions & 3 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ SUPPORTED_OS = {
"ubuntu2004" => {box: "generic/ubuntu2004", user: "vagrant"},
"ubuntu2204" => {box: "generic/ubuntu2204", user: "vagrant"},
"ubuntu2404" => {box: "bento/ubuntu-24.04", user: "vagrant"},
"centos" => {box: "centos/7", user: "vagrant"},
"centos-bento" => {box: "bento/centos-7.6", user: "vagrant"},
"centos8" => {box: "centos/8", user: "vagrant"},
"centos8-bento" => {box: "bento/centos-8", user: "vagrant"},
"almalinux8" => {box: "almalinux/8", user: "vagrant"},
Expand All @@ -36,7 +34,6 @@ SUPPORTED_OS = {
"opensuse-tumbleweed" => {box: "opensuse/Tumbleweed.x86_64", user: "vagrant"},
"oraclelinux" => {box: "generic/oracle7", user: "vagrant"},
"oraclelinux8" => {box: "generic/oracle8", user: "vagrant"},
"rhel7" => {box: "generic/rhel7", user: "vagrant"},
"rhel8" => {box: "generic/rhel8", user: "vagrant"},
"debian11" => {box: "debian/bullseye64", user: "vagrant"},
"debian12" => {box: "debian/bookworm64", user: "vagrant"},
Expand Down
2 changes: 1 addition & 1 deletion contrib/dind/group_vars/all/distro.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ distro_settings:
init: |
/sbin/init
centos: &CENTOS
image: "centos:7"
image: "centos:8"
user: "centos"
pid1_exe: /usr/lib/systemd/systemd
init: |
Expand Down
2 changes: 1 addition & 1 deletion docs/CNI/calico.md
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ calico_wireguard_enabled: true

The following OSes will require enabling the EPEL repo in order to bring in wireguard tools:

* CentOS 7 & 8
* CentOS 8
* AlmaLinux 8
* Rocky Linux 8
* Amazon Linux 2
Expand Down
8 changes: 0 additions & 8 deletions docs/CRI/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,6 @@ Enabling the `overlay2` graph driver:
docker_storage_options: -s overlay2
```

Enabling `docker_container_storage_setup`, it will configure devicemapper driver on Centos7 or RedHat7.
Deployers must be define a disk path for `docker_container_storage_setup_devs`, otherwise docker-storage-setup will be executed incorrectly.

```yaml
docker_container_storage_setup: true
docker_container_storage_setup_devs: /dev/vdb
```

Changing the Docker cgroup driver (native.cgroupdriver); valid options are `systemd` or `cgroupfs`, default is `systemd`:

```yaml
Expand Down
6 changes: 3 additions & 3 deletions docs/developers/ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ To generate this Matrix run `./tests/scripts/md-table/main.py`
|---| --- | --- | --- | --- | --- | --- | --- | --- |
almalinux8 | :white_check_mark: | :x: | :x: | :x: | :white_check_mark: | :x: | :x: | :x: |
amazon | :white_check_mark: | :x: | :x: | :x: | :x: | :x: | :x: | :x: |
centos7 | :white_check_mark: | :x: | :x: | :white_check_mark: | :x: | :white_check_mark: | :x: | :white_check_mark: |
centos8 | :white_check_mark: | :x: | :x: | :white_check_mark: | :x: | :white_check_mark: | :x: | :white_check_mark: |
debian11 | :white_check_mark: | :x: | :white_check_mark: | :x: | :x: | :x: | :white_check_mark: | :x: |
debian12 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | :x: | :x: | :x: | :x: |
fedora37 | :white_check_mark: | :x: | :x: | :x: | :x: | :white_check_mark: | :x: | :x: |
Expand All @@ -26,7 +26,7 @@ ubuntu24 | :white_check_mark: | :x: | :x: | :x: | :x: | :x: | :x: | :x: |
|---| --- | --- | --- | --- | --- | --- | --- | --- |
almalinux8 | :white_check_mark: | :x: | :x: | :x: | :x: | :x: | :x: | :x: |
amazon | :x: | :x: | :x: | :x: | :x: | :x: | :x: | :x: |
centos7 | :x: | :x: | :x: | :x: | :x: | :x: | :x: | :x: |
centos8 | :x: | :x: | :x: | :x: | :x: | :x: | :x: | :x: |
debian11 | :x: | :x: | :x: | :x: | :x: | :x: | :x: | :x: |
debian12 | :x: | :x: | :x: | :x: | :x: | :x: | :x: | :x: |
fedora37 | :white_check_mark: | :x: | :x: | :x: | :x: | :x: | :x: | :x: |
Expand All @@ -44,7 +44,7 @@ ubuntu24 | :x: | :x: | :x: | :x: | :x: | :x: | :x: | :x: |
|---| --- | --- | --- | --- | --- | --- | --- | --- |
almalinux8 | :white_check_mark: | :x: | :x: | :x: | :x: | :x: | :x: | :x: |
amazon | :x: | :x: | :x: | :x: | :x: | :x: | :x: | :x: |
centos7 | :white_check_mark: | :x: | :x: | :x: | :x: | :x: | :x: | :x: |
centos8 | :white_check_mark: | :x: | :x: | :x: | :x: | :x: | :x: | :x: |
debian11 | :white_check_mark: | :x: | :x: | :x: | :x: | :x: | :x: | :x: |
debian12 | :white_check_mark: | :x: | :x: | :x: | :x: | :x: | :x: | :x: |
fedora37 | :x: | :x: | :x: | :x: | :x: | :x: | :x: | :x: |
Expand Down
2 changes: 1 addition & 1 deletion docs/developers/vagrant.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ cat << EOF > vagrant/config.rb
\$instance_name_prefix = "kub"
\$vm_cpus = 1
\$num_instances = 3
\$os = "centos-bento"
\$os = "centos8-bento"
\$subnet = "10.0.20"
\$network_plugin = "flannel"
\$inventory = "$INV"
Expand Down
5 changes: 0 additions & 5 deletions docs/operating_systems/centos.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
# CentOS and derivatives

## CentOS 7

The maximum python version officially supported in CentOS is 3.6. Ansible as of version 5 (ansible core 2.12.x) increased their python requirement to python 3.8 and above.
Kubespray supports multiple ansible versions but only the default (5.x) gets wide testing coverage. If your deployment host is CentOS 7 it is recommended to use one of the earlier versions still supported.

## CentOS 8

If you have containers that are using iptables in the host network namespace (`hostNetwork=true`),
Expand Down
2 changes: 1 addition & 1 deletion inventory/sample/group_vars/all/offline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
# krew_download_url: "{{ files_repo }}/github.com/kubernetes-sigs/krew/releases/download/{{ krew_version }}/krew-{{ host_os }}_{{ image_arch }}.tar.gz"

## CentOS/Redhat/AlmaLinux
### For EL7, base and extras repo must be available, for EL8, baseos and appstream
### For EL8, baseos and appstream must be available,
### By default we enable those repo automatically
# rhel_enable_repos: false
### Docker / Containerd
Expand Down
1 change: 0 additions & 1 deletion playbooks/ansible_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
tags:
- check

# CentOS 7 provides too old jinja version
- name: "Check that jinja is not too old (install via pip)"
assert:
msg: "Your Jinja version is too old, install via pip"
Expand Down
6 changes: 0 additions & 6 deletions roles/bootstrap-os/molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@ platforms:
memory: 1024
provider_options:
driver: kvm
- name: centos7
box: centos/7
cpus: 1
memory: 512
provider_options:
driver: kvm
- name: almalinux8
box: almalinux/8
cpus: 1
Expand Down
29 changes: 1 addition & 28 deletions roles/bootstrap-os/tasks/centos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,40 +80,13 @@
- { option: "name", value: "CentOS-{{ ansible_distribution_major_version }} - Extras" }
- { option: "enabled", value: "1" }
- { option: "gpgcheck", value: "0" }
- { option: "baseurl", value: "http://vault.centos.org/{{ 'altarch' if (ansible_distribution_major_version | int) <= 7 and ansible_architecture == 'aarch64' else 'centos' }}/{{ ansible_distribution_major_version }}/extras/$basearch/{% if ansible_distribution_major_version | int > 7 %}os/{% endif %}" }
- { option: "baseurl", value: "http://mirror.centos.org/centos/{{ ansible_distribution_major_version }}/extras/$basearch/os/" }
when:
- use_oracle_public_repo | default(true)
- '''ID="ol"'' in os_release.stdout_lines'
- (ansible_distribution_version | float) >= 7.6
- (ansible_distribution_version | float) < 9

# CentOS 7 EOL at July 1, 2024.
- name: Check CentOS-Base.repo exists for CentOS 7
stat:
path: /etc/yum.repos.d/CentOS-Base.repo
register: centos_base_repo_stat
when:
- ansible_distribution_major_version == "7"

# CentOS 7 EOL at July 1, 2024.
- name: Update CentOS 7 CentOS-Base.repo
when:
- ansible_distribution_major_version == "7"
- centos_base_repo_stat.stat.exists
become: true
block:
- name: Disable CentOS 7 mirrorlist in CentOS-Base.repo
replace:
path: "{{ centos_base_repo_stat.stat.path }}"
regexp: '^mirrorlist='
replace: '#mirrorlist='

- name: Update CentOS 7 baseurl in CentOS-Base.repo
replace:
path: "{{ centos_base_repo_stat.stat.path }}"
regexp: '^#baseurl=http:\/\/mirror.centos.org'
replace: 'baseurl=http:\/\/vault.centos.org'

# CentOS ships with python installed

- name: Check presence of fastestmirror.conf
Expand Down
11 changes: 0 additions & 11 deletions roles/bootstrap-os/tasks/redhat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,6 @@
- rh_subscription_username is defined
- rh_subscription_status.changed

# container-selinux is in extras repo
- name: Enable RHEL 7 repos
community.general.rhsm_repository:
name:
- "rhel-7-server-rpms"
- "rhel-7-server-extras-rpms"
state: "{{ 'enabled' if (rhel_enable_repos | default(True) | bool) else 'disabled' }}"
when:
- ansible_distribution_major_version == "7"
- (not rh_subscription_status.changed) or (rh_subscription_username is defined) or (rh_subscription_org_id is defined)

# container-selinux is in appstream repo
- name: Enable RHEL 8 repos
community.general.rhsm_repository:
Expand Down
19 changes: 0 additions & 19 deletions roles/container-engine/docker-storage/defaults/main.yml

This file was deleted.

This file was deleted.

48 changes: 0 additions & 48 deletions roles/container-engine/docker-storage/tasks/main.yml

This file was deleted.

This file was deleted.

2 changes: 0 additions & 2 deletions roles/container-engine/docker/meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
---
dependencies:
- role: container-engine/containerd-common
- role: container-engine/docker-storage
when: docker_container_storage_setup and ansible_os_family == "RedHat"
14 changes: 3 additions & 11 deletions roles/container-engine/docker/templates/docker.service.j2
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
[Unit]
Description=Docker Application Container Engine
Documentation=http://docs.docker.com
{% if ansible_os_family == "RedHat" %}
After=network.target {{ ' docker-storage-setup.service' if docker_container_storage_setup else '' }} containerd.service
After=network.target docker.socket containerd.service lvm2-monitor.service SuSEfirewall2.service
{% if ansible_os_family != "Suse" %}
BindsTo=containerd.service
{{ 'Wants=docker-storage-setup.service' if docker_container_storage_setup else '' }}
{% elif ansible_os_family == "Debian" %}
After=network.target docker.socket containerd.service
BindsTo=containerd.service
Wants=docker.socket
{% elif ansible_os_family == "Suse" %}
After=network.target lvm2-monitor.service SuSEfirewall2.service
# After=network.target containerd.service
# BindsTo=containerd.service
{% endif %}
Wants=docker.socket

[Service]
Type=notify
Expand Down

This file was deleted.

3 changes: 0 additions & 3 deletions roles/kubernetes/preinstall/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,3 @@ systemd_resolved_disable_stub_listener: "{{ ansible_os_family in ['Flatcar', 'Fl
# Used to disable File Access Policy Daemon service.
# If service is enabled, the CNI plugin installation will fail
disable_fapolicyd: true

# Enable 0120-growpart-azure-centos-7 tasks
growpart_azure_enabled: true
Loading

0 comments on commit 7f527f6

Please sign in to comment.