Skip to content

Commit 8d1dbd1

Browse files
authored
Make it work for CentOS7/CentOS8/RHEL7/RHEL8 (#793)
* Make it work for CentOS7/CentOS8/RHEL7/RHEL8 Plus, it's possible to choose whatever version of docker Signed-off-by: Artiom Diomin <[email protected]> * CentOS8 AWS e2e test Signed-off-by: Artiom Diomin <[email protected]>
1 parent 1663928 commit 8d1dbd1

18 files changed

+152
-120
lines changed

.prow.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,27 @@ presubmits:
508508
memory: 1Gi
509509
cpu: 500m
510510

511+
- name: pull-machine-controller-e2e-aws-centos8
512+
always_run: false
513+
decorate: true
514+
error_on_eviction: true
515+
clone_uri: "ssh://[email protected]/kubermatic/machine-controller.git"
516+
labels:
517+
preset-aws: "true"
518+
preset-hetzner: "true"
519+
preset-e2e-ssh: "true"
520+
spec:
521+
containers:
522+
- image: golang:1.13.8
523+
command:
524+
- "./hack/ci-e2e-test.sh"
525+
args:
526+
- "TestAWSCentOS8ProvisioningE2E"
527+
resources:
528+
requests:
529+
memory: 1Gi
530+
cpu: 500m
531+
511532
- name: pull-machine-controller-e2e-vsphere-datastore-cluster
512533
always_run: false
513534
decorate: true

pkg/userdata/centos/provider.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ write_files:
149149
content: |
150150
{{ kernelSettings | indent 4 }}
151151
152-
- path: /etc/sysconfig/selinux
152+
- path: /etc/selinux/config
153153
content: |
154154
# This file controls the state of SELinux on the system.
155155
# SELINUX= can take one of these three values:
@@ -176,9 +176,7 @@ write_files:
176176
sysctl --system
177177
178178
{{- /* Make sure we always disable swap - Otherwise the kubelet won't start */}}
179-
cp /etc/fstab /etc/fstab.orig
180-
cat /etc/fstab.orig | awk '$3 ~ /^swap$/ && $1 !~ /^#/ {$0="# commented out by cloudinit\n#"$0} 1' > /etc/fstab.noswap
181-
mv /etc/fstab.noswap /etc/fstab
179+
sed -i.orig '/.*swap.*/d' /etc/fstab
182180
swapoff -a
183181
{{ if ne .CloudProviderName "aws" }}
184182
{{- /* The normal way of setting it via cloud-init is broken, see */}}
@@ -188,6 +186,9 @@ write_files:
188186
189187
yum install -y yum-utils
190188
yum-config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
189+
{{- /* Due to DNF modules we have to do this on docker-ce repo
190+
More info at: https://bugzilla.redhat.com/show_bug.cgi?id=1756473 */}}
191+
yum-config-manager --save --setopt=docker-ce-stable.module_hotfixes=true
191192
192193
{{- /* We need to explicitly specify docker-ce and docker-ce-cli to the same version.
193194
See: https://github.com/docker/cli/issues/2533 */}}
@@ -208,7 +209,7 @@ write_files:
208209
open-vm-tools \
209210
{{- end }}
210211
ipvsadm
211-
yum versionlock docker-ce-*
212+
yum versionlock add docker-ce-*
212213
213214
{{ safeDownloadBinariesScript .KubeletVersion | indent 4 }}
214215
# set kubelet nodeip environment variable

pkg/userdata/centos/testdata/kubelet-v1.15-aws.yaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ write_files:
4040
fs.inotify.max_user_watches = 1048576
4141
4242
43-
- path: /etc/sysconfig/selinux
43+
- path: /etc/selinux/config
4444
content: |
4545
# This file controls the state of SELinux on the system.
4646
# SELINUX= can take one of these three values:
@@ -63,14 +63,13 @@ write_files:
6363
setenforce 0 || true
6464
systemctl restart systemd-modules-load.service
6565
sysctl --system
66-
cp /etc/fstab /etc/fstab.orig
67-
cat /etc/fstab.orig | awk '$3 ~ /^swap$/ && $1 !~ /^#/ {$0="# commented out by cloudinit\n#"$0} 1' > /etc/fstab.noswap
68-
mv /etc/fstab.noswap /etc/fstab
66+
sed -i.orig '/.*swap.*/d' /etc/fstab
6967
swapoff -a
7068
7169
7270
yum install -y yum-utils
7371
yum-config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
72+
yum-config-manager --save --setopt=docker-ce-stable.module_hotfixes=true
7473
7574
DOCKER_VERSION='18.09.9-3.el7'
7675
yum install -y docker-ce-${DOCKER_VERSION} \
@@ -85,7 +84,7 @@ write_files:
8584
curl \
8685
yum-plugin-versionlock \
8786
ipvsadm
88-
yum versionlock docker-ce-*
87+
yum versionlock add docker-ce-*
8988
9089
opt_bin=/opt/bin
9190
cni_bin_dir=/opt/cni/bin

pkg/userdata/centos/testdata/kubelet-v1.16-aws.yaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ write_files:
4040
fs.inotify.max_user_watches = 1048576
4141
4242
43-
- path: /etc/sysconfig/selinux
43+
- path: /etc/selinux/config
4444
content: |
4545
# This file controls the state of SELinux on the system.
4646
# SELINUX= can take one of these three values:
@@ -63,14 +63,13 @@ write_files:
6363
setenforce 0 || true
6464
systemctl restart systemd-modules-load.service
6565
sysctl --system
66-
cp /etc/fstab /etc/fstab.orig
67-
cat /etc/fstab.orig | awk '$3 ~ /^swap$/ && $1 !~ /^#/ {$0="# commented out by cloudinit\n#"$0} 1' > /etc/fstab.noswap
68-
mv /etc/fstab.noswap /etc/fstab
66+
sed -i.orig '/.*swap.*/d' /etc/fstab
6967
swapoff -a
7068
7169
7270
yum install -y yum-utils
7371
yum-config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
72+
yum-config-manager --save --setopt=docker-ce-stable.module_hotfixes=true
7473
7574
DOCKER_VERSION='18.09.9-3.el7'
7675
yum install -y docker-ce-${DOCKER_VERSION} \
@@ -85,7 +84,7 @@ write_files:
8584
curl \
8685
yum-plugin-versionlock \
8786
ipvsadm
88-
yum versionlock docker-ce-*
87+
yum versionlock add docker-ce-*
8988
9089
opt_bin=/opt/bin
9190
cni_bin_dir=/opt/cni/bin

pkg/userdata/centos/testdata/kubelet-v1.17-aws-external.yaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ write_files:
4040
fs.inotify.max_user_watches = 1048576
4141
4242
43-
- path: /etc/sysconfig/selinux
43+
- path: /etc/selinux/config
4444
content: |
4545
# This file controls the state of SELinux on the system.
4646
# SELINUX= can take one of these three values:
@@ -63,14 +63,13 @@ write_files:
6363
setenforce 0 || true
6464
systemctl restart systemd-modules-load.service
6565
sysctl --system
66-
cp /etc/fstab /etc/fstab.orig
67-
cat /etc/fstab.orig | awk '$3 ~ /^swap$/ && $1 !~ /^#/ {$0="# commented out by cloudinit\n#"$0} 1' > /etc/fstab.noswap
68-
mv /etc/fstab.noswap /etc/fstab
66+
sed -i.orig '/.*swap.*/d' /etc/fstab
6967
swapoff -a
7068
7169
7270
yum install -y yum-utils
7371
yum-config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
72+
yum-config-manager --save --setopt=docker-ce-stable.module_hotfixes=true
7473
7574
DOCKER_VERSION='18.09.9-3.el7'
7675
yum install -y docker-ce-${DOCKER_VERSION} \
@@ -85,7 +84,7 @@ write_files:
8584
curl \
8685
yum-plugin-versionlock \
8786
ipvsadm
88-
yum versionlock docker-ce-*
87+
yum versionlock add docker-ce-*
8988
9089
opt_bin=/opt/bin
9190
cni_bin_dir=/opt/cni/bin

pkg/userdata/centos/testdata/kubelet-v1.17-aws.yaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ write_files:
4040
fs.inotify.max_user_watches = 1048576
4141
4242
43-
- path: /etc/sysconfig/selinux
43+
- path: /etc/selinux/config
4444
content: |
4545
# This file controls the state of SELinux on the system.
4646
# SELINUX= can take one of these three values:
@@ -63,14 +63,13 @@ write_files:
6363
setenforce 0 || true
6464
systemctl restart systemd-modules-load.service
6565
sysctl --system
66-
cp /etc/fstab /etc/fstab.orig
67-
cat /etc/fstab.orig | awk '$3 ~ /^swap$/ && $1 !~ /^#/ {$0="# commented out by cloudinit\n#"$0} 1' > /etc/fstab.noswap
68-
mv /etc/fstab.noswap /etc/fstab
66+
sed -i.orig '/.*swap.*/d' /etc/fstab
6967
swapoff -a
7068
7169
7270
yum install -y yum-utils
7371
yum-config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
72+
yum-config-manager --save --setopt=docker-ce-stable.module_hotfixes=true
7473
7574
DOCKER_VERSION='18.09.9-3.el7'
7675
yum install -y docker-ce-${DOCKER_VERSION} \
@@ -85,7 +84,7 @@ write_files:
8584
curl \
8685
yum-plugin-versionlock \
8786
ipvsadm
88-
yum versionlock docker-ce-*
87+
yum versionlock add docker-ce-*
8988
9089
opt_bin=/opt/bin
9190
cni_bin_dir=/opt/cni/bin

pkg/userdata/centos/testdata/kubelet-v1.17-vsphere-mirrors.yaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ write_files:
5050
fs.inotify.max_user_watches = 1048576
5151
5252
53-
- path: /etc/sysconfig/selinux
53+
- path: /etc/selinux/config
5454
content: |
5555
# This file controls the state of SELinux on the system.
5656
# SELINUX= can take one of these three values:
@@ -73,16 +73,15 @@ write_files:
7373
setenforce 0 || true
7474
systemctl restart systemd-modules-load.service
7575
sysctl --system
76-
cp /etc/fstab /etc/fstab.orig
77-
cat /etc/fstab.orig | awk '$3 ~ /^swap$/ && $1 !~ /^#/ {$0="# commented out by cloudinit\n#"$0} 1' > /etc/fstab.noswap
78-
mv /etc/fstab.noswap /etc/fstab
76+
sed -i.orig '/.*swap.*/d' /etc/fstab
7977
swapoff -a
8078
8179
hostnamectl set-hostname node1
8280
8381
8482
yum install -y yum-utils
8583
yum-config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
84+
yum-config-manager --save --setopt=docker-ce-stable.module_hotfixes=true
8685
8786
DOCKER_VERSION='18.09.9-3.el7'
8887
yum install -y docker-ce-${DOCKER_VERSION} \
@@ -98,7 +97,7 @@ write_files:
9897
yum-plugin-versionlock \
9998
open-vm-tools \
10099
ipvsadm
101-
yum versionlock docker-ce-*
100+
yum versionlock add docker-ce-*
102101
103102
opt_bin=/opt/bin
104103
cni_bin_dir=/opt/cni/bin

pkg/userdata/centos/testdata/kubelet-v1.17-vsphere-proxy.yaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ write_files:
5050
fs.inotify.max_user_watches = 1048576
5151
5252
53-
- path: /etc/sysconfig/selinux
53+
- path: /etc/selinux/config
5454
content: |
5555
# This file controls the state of SELinux on the system.
5656
# SELINUX= can take one of these three values:
@@ -73,16 +73,15 @@ write_files:
7373
setenforce 0 || true
7474
systemctl restart systemd-modules-load.service
7575
sysctl --system
76-
cp /etc/fstab /etc/fstab.orig
77-
cat /etc/fstab.orig | awk '$3 ~ /^swap$/ && $1 !~ /^#/ {$0="# commented out by cloudinit\n#"$0} 1' > /etc/fstab.noswap
78-
mv /etc/fstab.noswap /etc/fstab
76+
sed -i.orig '/.*swap.*/d' /etc/fstab
7977
swapoff -a
8078
8179
hostnamectl set-hostname node1
8280
8381
8482
yum install -y yum-utils
8583
yum-config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
84+
yum-config-manager --save --setopt=docker-ce-stable.module_hotfixes=true
8685
8786
DOCKER_VERSION='18.09.9-3.el7'
8887
yum install -y docker-ce-${DOCKER_VERSION} \
@@ -98,7 +97,7 @@ write_files:
9897
yum-plugin-versionlock \
9998
open-vm-tools \
10099
ipvsadm
101-
yum versionlock docker-ce-*
100+
yum versionlock add docker-ce-*
102101
103102
opt_bin=/opt/bin
104103
cni_bin_dir=/opt/cni/bin

pkg/userdata/centos/testdata/kubelet-v1.17-vsphere.yaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ write_files:
4242
fs.inotify.max_user_watches = 1048576
4343
4444
45-
- path: /etc/sysconfig/selinux
45+
- path: /etc/selinux/config
4646
content: |
4747
# This file controls the state of SELinux on the system.
4848
# SELINUX= can take one of these three values:
@@ -65,16 +65,15 @@ write_files:
6565
setenforce 0 || true
6666
systemctl restart systemd-modules-load.service
6767
sysctl --system
68-
cp /etc/fstab /etc/fstab.orig
69-
cat /etc/fstab.orig | awk '$3 ~ /^swap$/ && $1 !~ /^#/ {$0="# commented out by cloudinit\n#"$0} 1' > /etc/fstab.noswap
70-
mv /etc/fstab.noswap /etc/fstab
68+
sed -i.orig '/.*swap.*/d' /etc/fstab
7169
swapoff -a
7270
7371
hostnamectl set-hostname node1
7472
7573
7674
yum install -y yum-utils
7775
yum-config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
76+
yum-config-manager --save --setopt=docker-ce-stable.module_hotfixes=true
7877
7978
DOCKER_VERSION='18.09.9-3.el7'
8079
yum install -y docker-ce-${DOCKER_VERSION} \
@@ -90,7 +89,7 @@ write_files:
9089
yum-plugin-versionlock \
9190
open-vm-tools \
9291
ipvsadm
93-
yum versionlock docker-ce-*
92+
yum versionlock add docker-ce-*
9493
9594
opt_bin=/opt/bin
9695
cni_bin_dir=/opt/cni/bin

pkg/userdata/rhel/provider.go

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ write_files:
149149
content: |
150150
{{ kernelSettings | indent 4 }}
151151
152-
- path: /etc/sysconfig/selinux
152+
- path: /etc/selinux/config
153153
content: |
154154
# This file controls the state of SELinux on the system.
155155
# SELINUX= can take one of these three values:
@@ -176,20 +176,22 @@ write_files:
176176
sysctl --system
177177
178178
{{- /* Make sure we always disable swap - Otherwise the kubelet won't start */}}
179-
cp /etc/fstab /etc/fstab.orig
180-
cat /etc/fstab.orig | awk '$3 ~ /^swap$/ && $1 !~ /^#/ {$0="# commented out by cloudinit\n#"$0} 1' > /etc/fstab.noswap
181-
mv /etc/fstab.noswap /etc/fstab
179+
sed -i.orig '/.*swap.*/d' /etc/fstab
182180
swapoff -a
183181
{{ if ne .CloudProviderName "aws" }}
184182
{{- /* The normal way of setting it via cloud-init is broken, see */}}
185183
{{- /* https://bugs.launchpad.net/cloud-init/+bug/1662542 */}}
186184
hostnamectl set-hostname {{ .MachineSpec.Name }}
187185
{{ end }}
188186
189-
dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
187+
yum install -y yum-utils
188+
yum-config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
189+
{{- /* Due to DNF modules we have to do this on docker-ce repo
190+
More info at: https://bugzilla.redhat.com/show_bug.cgi?id=1756473 */}}
191+
yum-config-manager --save --setopt=docker-ce-stable.module_hotfixes=true
190192
191-
DOCKER_VERSION='18.09.1-3.el7'
192-
dnf install -y docker-ce-${DOCKER_VERSION} \
193+
DOCKER_VERSION='18.09.9-3.el7'
194+
yum install -y docker-ce-${DOCKER_VERSION} \
193195
docker-ce-cli-${DOCKER_VERSION} \
194196
ebtables \
195197
ethtool \
@@ -199,13 +201,12 @@ write_files:
199201
socat \
200202
wget \
201203
curl \
202-
python3-dnf-plugin-versionlock \
204+
yum-plugin-versionlock \
203205
{{- if eq .CloudProviderName "vsphere" }}
204206
open-vm-tools \
205207
{{- end }}
206208
ipvsadm
207-
dnf versionlock add docker-ce docker-ce-cli
208-
dnf clean all
209+
yum versionlock add docker-ce-*
209210
210211
{{ safeDownloadBinariesScript .KubeletVersion | indent 4 }}
211212
# set kubelet nodeip environment variable

0 commit comments

Comments
 (0)