Skip to content

Commit

Permalink
Synchronize OSM with machine-controller (#170)
Browse files Browse the repository at this point in the history
* Add missing flags for node-registry-credentials-secret and node-containerd-registry-mirrors

Signed-off-by: Waleed Malik <ahmedwaleedmalik@gmail.com>

* Enable DHCPv6 support for RHEL

Signed-off-by: Waleed Malik <ahmedwaleedmalik@gmail.com>

* Upgrade to Go v1.18.3

Signed-off-by: Waleed Malik <ahmedwaleedmalik@gmail.com>

* Add support for rocky linux

Signed-off-by: Waleed Malik <ahmedwaleedmalik@gmail.com>

* Add support for VMware Cloud Director as cloud provider

Signed-off-by: Waleed Malik <ahmedwaleedmalik@gmail.com>

* Synchronize KubeVirt with machine-controller

Signed-off-by: Waleed Malik <ahmedwaleedmalik@gmail.com>

* Update fixtures

Signed-off-by: Waleed Malik <ahmedwaleedmalik@gmail.com>

* Update CRDs

Signed-off-by: Waleed Malik <ahmedwaleedmalik@gmail.com>

* Bump OSP versions and update compatibility matrix

Signed-off-by: Waleed Malik <ahmedwaleedmalik@gmail.com>

* Rocky linux is supported in KKP

Signed-off-by: Waleed Malik <ahmedwaleedmalik@gmail.com>
  • Loading branch information
ahmedwaleedmalik committed Jun 8, 2022
1 parent 736f7a3 commit e776eb9
Show file tree
Hide file tree
Showing 37 changed files with 1,132 additions and 160 deletions.
6 changes: 3 additions & 3 deletions .prow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ presubmits:
preset-goproxy: "true"
spec:
containers:
- image: golang:1.18.1
- image: golang:1.18.3
command:
- make
args:
Expand All @@ -61,7 +61,7 @@ presubmits:
preset-goproxy: "true"
spec:
containers:
- image: golang:1.18.1
- image: golang:1.18.3
command:
- make
args:
Expand Down Expand Up @@ -124,7 +124,7 @@ presubmits:
preset-goproxy: "true"
spec:
containers:
- image: golang:1.18.1
- image: golang:1.18.3
command:
- make
args:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

ARG GO_VERSION=1.18.1
ARG GO_VERSION=1.18.3
FROM golang:${GO_VERSION} AS builder
WORKDIR /go/src/k8c.io/operating-system-manager
COPY . .
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export GO111MODULE=on
export GOFLAGS?=-mod=readonly -trimpath
export GIT_TAG ?= $(shell git tag --points-at HEAD)

GO_VERSION = 1.18.1
GO_VERSION = 1.18.3

CMD = $(notdir $(wildcard ./cmd/*))
BUILD_DEST ?= _build
Expand Down
2 changes: 2 additions & 0 deletions cmd/osm-controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ func main() {
flag.StringVar(&opt.nodeNoProxy, "node-no-proxy", ".svc,.cluster.local,localhost,127.0.0.1", "If set, it configures the 'NO_PROXY' environment variable on the nodes.")
flag.StringVar(&opt.nodeInsecureRegistries, "node-insecure-registries", "", "Comma separated list of registries which should be configured as insecure on the container runtime")
flag.StringVar(&opt.nodeRegistryMirrors, "node-registry-mirrors", "", "Comma separated list of Docker image mirrors")
flag.Var(&opt.nodeContainerdRegistryMirrors, "node-containerd-registry-mirrors", "Configure registry mirrors endpoints. Can be used multiple times to specify multiple mirrors")
flag.StringVar(&opt.nodeRegistryCredentialsSecret, "node-registry-credentials-secret", "", "A Secret object reference, that contains auth info for image registry in namespace/secret-name form, example: kube-system/registry-credentials. See doc at https://github.com/kubermaric/machine-controller/blob/master/docs/registry-authentication.md")

flag.StringVar(&opt.healthProbeAddress, "health-probe-address", "127.0.0.1:8085", "The address on which the liveness check on /healthz and readiness check on /readyz will be available")
flag.StringVar(&opt.metricsAddress, "metrics-address", "127.0.0.1:8080", "The address on which Prometheus metrics will be available under /metrics")
Expand Down
2 changes: 2 additions & 0 deletions deploy/crd/crd-operating-system-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ spec:
- scaleway
- baremetal
- external
- vmware-cloud-director
spec:
description: Spec represents the os/image reference in the supported cloud provider
type: object
Expand Down Expand Up @@ -146,6 +147,7 @@ spec:
- ubuntu
- sles
- amzn2
- rockylinux
osVersion:
description: OSVersion the version of the operating system
type: string
Expand Down
2 changes: 2 additions & 0 deletions deploy/crd/crd-operating-system-profile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ spec:
- ubuntu
- sles
- amzn2
- rockylinux
osVersion:
description: OSVersion the version of the operating system
type: string
Expand Down Expand Up @@ -150,6 +151,7 @@ spec:
- scaleway
- baremetal
- external
- vmware-cloud-director
spec:
description: Spec represents the os/image reference in the supported cloud provider
type: object
Expand Down
23 changes: 17 additions & 6 deletions deploy/osps/default/osp-amzn2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ metadata:
spec:
osName: "amzn2"
osVersion: "2.0"
version: "v0.1.2"
version: "v0.1.3"
supportedCloudProviders:
- name: "aws"
supportedContainerRuntimes:
Expand Down Expand Up @@ -414,10 +414,6 @@ spec:
systemctl restart systemd-modules-load.service
sysctl --system
{{- /* Make sure we always disable swap - Otherwise the kubelet won't start'. */}}
sed -i.orig '/.*swap.*/d' /etc/fstab
swapoff -a
yum install -y \
device-mapper-persistent-data \
lvm2 \
Expand All @@ -429,7 +425,7 @@ spec:
socat \
wget \
curl \
{{- if eq .CloudProviderName "vsphere" }}
{{- if or (eq .CloudProviderName "vsphere") (eq .CloudProviderName "vmware-cloud-director") }}
open-vm-tools \
{{- end }}
ipvsadm
Expand Down Expand Up @@ -484,6 +480,7 @@ spec:
Environment="PATH=/opt/bin:/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin/"
EnvironmentFile=-/etc/environment
ExecStartPre=/bin/bash /opt/disable-swap.sh
ExecStartPre=/bin/bash /opt/load-kernel-modules.sh
ExecStartPre=/bin/bash /opt/bin/setup_net_env.sh
ExecStart=/opt/bin/kubelet $KUBELET_EXTRA_ARGS \
Expand Down Expand Up @@ -719,3 +716,17 @@ spec:
[Install]
WantedBy=multi-user.target
- path: "/opt/disable-swap.sh"
permissions: 0755
content:
inline:
encoding: b64
data: |
#!/usr/bin/env bash
set -euo pipefail
# Make sure we always disable swap - Otherwise the kubelet won't start as for some cloud
# providers swap gets enabled on reboot or after the setup script has finished executing.
sed -i.orig '/.*swap.*/d' /etc/fstab
swapoff -a
23 changes: 17 additions & 6 deletions deploy/osps/default/osp-centos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ metadata:
spec:
osName: "centos"
osVersion: "7.7"
version: "v0.1.2"
version: "v0.1.3"
supportedCloudProviders:
- name: "aws"
- name: "azure"
Expand Down Expand Up @@ -433,10 +433,6 @@ spec:
systemctl restart systemd-modules-load.service
sysctl --system
{{- /* Make sure we always disable swap - Otherwise the kubelet won't start'. */}}
sed -i.orig '/.*swap.*/d' /etc/fstab
swapoff -a
yum install -y \
device-mapper-persistent-data \
lvm2 \
Expand All @@ -448,7 +444,7 @@ spec:
socat \
wget \
curl \
{{- if eq .CloudProviderName "vsphere" }}
{{- if or (eq .CloudProviderName "vsphere") (eq .CloudProviderName "vmware-cloud-director") }}
open-vm-tools \
{{- end }}
{{- if eq .CloudProviderName "nutanix" }}
Expand Down Expand Up @@ -515,6 +511,7 @@ spec:
Environment="PATH=/opt/bin:/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin/"
EnvironmentFile=-/etc/environment
ExecStartPre=/bin/bash /opt/disable-swap.sh
ExecStartPre=/bin/bash /opt/load-kernel-modules.sh
ExecStartPre=/bin/bash /opt/bin/setup_net_env.sh
ExecStart=/opt/bin/kubelet $KUBELET_EXTRA_ARGS \
Expand Down Expand Up @@ -750,3 +747,17 @@ spec:
[Install]
WantedBy=multi-user.target
- path: "/opt/disable-swap.sh"
permissions: 0755
content:
inline:
encoding: b64
data: |
#!/usr/bin/env bash
set -euo pipefail
# Make sure we always disable swap - Otherwise the kubelet won't start as for some cloud
# providers swap gets enabled on reboot or after the setup script has finished executing.
sed -i.orig '/.*swap.*/d' /etc/fstab
swapoff -a
23 changes: 17 additions & 6 deletions deploy/osps/default/osp-centos8.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ metadata:
spec:
osName: "centos"
osVersion: "8"
version: "v0.1.2"
version: "v0.1.3"
supportedCloudProviders:
- name: "aws"
- name: "azure"
Expand Down Expand Up @@ -433,10 +433,6 @@ spec:
systemctl restart systemd-modules-load.service
sysctl --system
{{- /* Make sure we always disable swap - Otherwise the kubelet won't start'. */}}
sed -i.orig '/.*swap.*/d' /etc/fstab
swapoff -a
{{- /* CentOS 8 has reached EOL and all packages were moved to vault.centos.org -- https://www.centos.org/centos-linux-eol/ */}}
sudo sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
sudo sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
Expand All @@ -452,7 +448,7 @@ spec:
socat \
wget \
curl \
{{- if eq .CloudProviderName "vsphere" }}
{{- if or (eq .CloudProviderName "vsphere") (eq .CloudProviderName "vmware-cloud-director") }}
open-vm-tools \
{{- end }}
{{- if eq .CloudProviderName "nutanix" }}
Expand Down Expand Up @@ -519,6 +515,7 @@ spec:
Environment="PATH=/opt/bin:/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin/"
EnvironmentFile=-/etc/environment
ExecStartPre=/bin/bash /opt/disable-swap.sh
ExecStartPre=/bin/bash /opt/load-kernel-modules.sh
ExecStartPre=/bin/bash /opt/bin/setup_net_env.sh
ExecStart=/opt/bin/kubelet $KUBELET_EXTRA_ARGS \
Expand Down Expand Up @@ -754,3 +751,17 @@ spec:
[Install]
WantedBy=multi-user.target
- path: "/opt/disable-swap.sh"
permissions: 0755
content:
inline:
encoding: b64
data: |
#!/usr/bin/env bash
set -euo pipefail
# Make sure we always disable swap - Otherwise the kubelet won't start as for some cloud
# providers swap gets enabled on reboot or after the setup script has finished executing.
sed -i.orig '/.*swap.*/d' /etc/fstab
swapoff -a
2 changes: 1 addition & 1 deletion deploy/osps/default/osp-flatcar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ spec:
osName: flatcar
## Flatcar Stable (09/11/2021)
osVersion: "2983.2.0"
version: "v0.1.2"
version: "v0.1.3"
supportedCloudProviders:
- name: aws
- name: azure
Expand Down
33 changes: 26 additions & 7 deletions deploy/osps/default/osp-rhel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ metadata:
spec:
osName: "rhel"
osVersion: "8.5"
version: "v0.1.2"
version: "v0.1.3"
supportedCloudProviders:
- name: "aws"
- name: "azure"
Expand Down Expand Up @@ -430,10 +430,6 @@ spec:
systemctl restart systemd-modules-load.service
sysctl --system
{{- /* Make sure we always disable swap - Otherwise the kubelet won't start'. */}}
sed -i.orig '/.*swap.*/d' /etc/fstab
swapoff -a
yum install -y \
device-mapper-persistent-data \
lvm2 \
Expand All @@ -445,7 +441,7 @@ spec:
socat \
wget \
curl \
{{- if eq .CloudProviderName "vsphere" }}
{{- if or (eq .CloudProviderName "vsphere") (eq .CloudProviderName "vmware-cloud-director") }}
open-vm-tools \
{{- end }}
{{- if eq .CloudProviderName "nutanix" }}
Expand All @@ -466,6 +462,14 @@ spec:
{{- template "configureProxyScript" }}
DEFAULT_IFC_NAME=$(ip -o route get 1 | grep -oP "dev \K\S+")
# enable DHCPv6 on the default interface
echo NETWORKING_IPV6=yes >> /etc/sysconfig/network
echo IPV6INIT=yes >> /etc/sysconfig/network-scripts/ifcfg-$DEFAULT_IFC_NAME
echo DHCPV6C=yes >> /etc/sysconfig/network-scripts/ifcfg-$DEFAULT_IFC_NAME
ifdown $DEFAULT_IFC_NAME && ifup $DEFAULT_IFC_NAME
mkdir -p /etc/systemd/system/kubelet.service.d/
# set kubelet nodeip environment variable
/opt/bin/setup_net_env.sh
Expand Down Expand Up @@ -511,6 +515,7 @@ spec:
Environment="PATH=/opt/bin:/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin/"
EnvironmentFile=-/etc/environment
ExecStartPre=/bin/bash /opt/disable-swap.sh
ExecStartPre=/bin/bash /opt/load-kernel-modules.sh
ExecStartPre=/bin/bash /opt/bin/setup_net_env.sh
ExecStart=/opt/bin/kubelet $KUBELET_EXTRA_ARGS \
Expand Down Expand Up @@ -594,7 +599,7 @@ spec:
{{- if eq .CloudProviderName "openstack" }}
FULL_HOSTNAME=$(echo $FULL_HOSTNAME | sed -e "s/.novalocal//")
{{- end }}
# write the nodeip_env file
# we need the line below because flatcar has the same string "coreos" in that file
if grep -q coreos /etc/os-release
Expand Down Expand Up @@ -749,3 +754,17 @@ spec:
[Install]
WantedBy=multi-user.target
- path: "/opt/disable-swap.sh"
permissions: 0755
content:
inline:
encoding: b64
data: |
#!/usr/bin/env bash
set -euo pipefail
# Make sure we always disable swap - Otherwise the kubelet won't start as for some cloud
# providers swap gets enabled on reboot or after the setup script has finished executing.
sed -i.orig '/.*swap.*/d' /etc/fstab
swapoff -a
Loading

0 comments on commit e776eb9

Please sign in to comment.