Update default CRI and cgroup driver

Default CRI: containerd
Default cgroup driver: systemd

* Fixed VM disk size issue

Relates-To: #456

Change-Id: I4072fffcd466534e51a4e2da0b38272ead820d65
This commit is contained in:
SIGUNOV, VLADIMIR (vs422h) 2021-04-20 17:23:44 -04:00 committed by Vladimir Sigunov
parent c8d9160fe2
commit e174dbe318
6 changed files with 36 additions and 15 deletions

View File

@ -130,4 +130,4 @@ stringData:
- mkdir -p /var/lib/docker-engine /mnt/ephemeral/var/lib/docker-engine - mkdir -p /var/lib/docker-engine /mnt/ephemeral/var/lib/docker-engine
- mount --bind /mnt/ephemeral/var/lib/docker-engine /var/lib/docker-engine - mount --bind /mnt/ephemeral/var/lib/docker-engine /var/lib/docker-engine
- mkdir -p /mnt/ephemeral/var/lib/kubelet/ /var/lib/kubelet/ - mkdir -p /mnt/ephemeral/var/lib/kubelet/ /var/lib/kubelet/
- mount --bind /mnt/ephemeral/var/lib/kubelet/ /var/lib/kubelet/ - mount --bind /mnt/ephemeral/var/lib/kubelet/ /var/lib/kubelet/

View File

@ -14,29 +14,41 @@ spec:
apiServer: apiServer:
timeoutForControlPlane: 1000s timeoutForControlPlane: 1000s
files: files:
- path: "/etc/systemd/system/docker.service.d/http-proxy.conf" - path: "/etc/systemd/system/containerd.service.d/http-proxy.conf"
content: | content: |
[Service] [Service]
Environment="HTTP_PROXY=REPLACEMENT_HTTP_PROXY" Environment="HTTP_PROXY=REPLACEMENT_HTTP_PROXY"
Environment="HTTPS_PROXY=REPLACEMENT_HTTPS_PROXY" Environment="HTTPS_PROXY=REPLACEMENT_HTTPS_PROXY"
Environment="NO_PROXY=REPLACEMENT_NO_PROXY" Environment="NO_PROXY=REPLACEMENT_NO_PROXY"
# Since we are using containerd as a default CRI, we do not need
# any adjustments and settings for docker anymore. However, if for
# some reason docker has to be presented in the system, we need to
# create http-proxy.conf.
# TODO: add download sources to the versions catalogue # TODO: add download sources to the versions catalogue
preKubeadmCommands: preKubeadmCommands:
# Restart docker to apply any proxy settings # Restart docker to apply any proxy settings
- export HOME=/root - export HOME=/root
- mkdir -p /etc/containerd
- containerd config default | sed -r -e '/\[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc\]$/a\ SystemdCgroup = true' | tee /etc/containerd/config.toml
- systemctl daemon-reload - systemctl daemon-reload
- systemctl restart docker - systemctl restart containerd
initConfiguration: initConfiguration:
nodeRegistration: nodeRegistration:
name: '{{ ds.meta_data.local_hostname }}' name: '{{ ds.meta_data.local_hostname }}'
kubeletExtraArgs: kubeletExtraArgs:
node-labels: 'metal3.io/uuid={{ ds.meta_data.uuid }},node-type=controlplane' node-labels: 'metal3.io/uuid={{ ds.meta_data.uuid }},node-type=controlplane'
cgroup-driver: "systemd"
container-runtime: remote
criSocket: "unix:///run/containerd/containerd.sock"
joinConfiguration: joinConfiguration:
controlPlane: {} controlPlane: {}
nodeRegistration: nodeRegistration:
name: '{{ ds.meta_data.local_hostname }}' name: '{{ ds.meta_data.local_hostname }}'
kubeletExtraArgs: kubeletExtraArgs:
node-labels: 'metal3.io/uuid={{ ds.meta_data.uuid }},node-type=controlplane' node-labels: 'metal3.io/uuid={{ ds.meta_data.uuid }},node-type=controlplane'
cgroup-driver: "systemd"
container-runtime: remote
criSocket: "unix:///run/containerd/containerd.sock"
ntp: ntp:
servers: servers:
- 0.pool.ntp.org - 0.pool.ntp.org

View File

@ -19,7 +19,7 @@ replacements:
name: cluster-controlplane name: cluster-controlplane
fieldrefs: fieldrefs:
- "spec.kubeadmConfigSpec.preKubeadmCommands%REPLACEMENT_HTTP_PROXY%" - "spec.kubeadmConfigSpec.preKubeadmCommands%REPLACEMENT_HTTP_PROXY%"
- "spec.kubeadmConfigSpec.files[path=/etc/systemd/system/docker.service.d/http-proxy.conf].content%REPLACEMENT_HTTP_PROXY%" - "{.spec.kubeadmConfigSpec.files[:].content}%REPLACEMENT_HTTP_PROXY%"
- source: - source:
objref: objref:
name: env-vars-catalogue name: env-vars-catalogue
@ -30,7 +30,7 @@ replacements:
name: cluster-controlplane name: cluster-controlplane
fieldrefs: fieldrefs:
- "spec.kubeadmConfigSpec.preKubeadmCommands%REPLACEMENT_HTTPS_PROXY%" - "spec.kubeadmConfigSpec.preKubeadmCommands%REPLACEMENT_HTTPS_PROXY%"
- "spec.kubeadmConfigSpec.files[path=/etc/systemd/system/docker.service.d/http-proxy.conf].content%REPLACEMENT_HTTPS_PROXY%" - "{.spec.kubeadmConfigSpec.files[:].content}%REPLACEMENT_HTTPS_PROXY%"
- source: - source:
objref: objref:
name: env-vars-catalogue name: env-vars-catalogue
@ -41,4 +41,4 @@ replacements:
name: cluster-controlplane name: cluster-controlplane
fieldrefs: fieldrefs:
- "spec.kubeadmConfigSpec.preKubeadmCommands%REPLACEMENT_NO_PROXY%" - "spec.kubeadmConfigSpec.preKubeadmCommands%REPLACEMENT_NO_PROXY%"
- "spec.kubeadmConfigSpec.files[path=/etc/systemd/system/docker.service.d/http-proxy.conf].content%REPLACEMENT_NO_PROXY%" - "{.spec.kubeadmConfigSpec.files[:].content}%REPLACEMENT_NO_PROXY%"

View File

@ -12,18 +12,27 @@ spec:
node-labels: 'metal3.io/uuid={{ ds.meta_data.uuid }}' node-labels: 'metal3.io/uuid={{ ds.meta_data.uuid }}'
provider-id: 'metal3://{{ ds.meta_data.uuid }}' provider-id: 'metal3://{{ ds.meta_data.uuid }}'
feature-gates: "IPv6DualStack=true" feature-gates: "IPv6DualStack=true"
cgroup-driver: "systemd"
container-runtime: remote
criSocket: "unix:///run/containerd/containerd.sock"
files: files:
- path: "/etc/systemd/system/docker.service.d/http-proxy.conf" - path: "/etc/systemd/system/containerd.service.d/http-proxy.conf"
content: | content: |
[Service] [Service]
Environment="HTTP_PROXY=REPLACEMENT_HTTP_PROXY" Environment="HTTP_PROXY=REPLACEMENT_HTTP_PROXY"
Environment="HTTPS_PROXY=REPLACEMENT_HTTPS_PROXY" Environment="HTTPS_PROXY=REPLACEMENT_HTTPS_PROXY"
Environment="NO_PROXY=REPLACEMENT_NO_PROXY" Environment="NO_PROXY=REPLACEMENT_NO_PROXY"
# Since we are using containerd as a default CRI, we do not need
# any adjustments and settings for docker anymore. However, if for
# some reason docker has to be presented in the system, we need to
# create http-proxy.conf.
preKubeadmCommands: preKubeadmCommands:
# Restart docker to apply any proxy settings # Restart docker and containerd to apply any proxy settings
- export HOME=/root - export HOME=/root
- mkdir -p /etc/containerd
- containerd config default | sed -r -e '/\[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc\]$/a\ SystemdCgroup = true' | tee /etc/containerd/config.toml
- systemctl daemon-reload - systemctl daemon-reload
- systemctl restart docker - systemctl restart containerd
users: users:
- name: deployer - name: deployer
sshAuthorizedKeys: sshAuthorizedKeys:

View File

@ -18,7 +18,7 @@ replacements:
kind: KubeadmConfigTemplate kind: KubeadmConfigTemplate
name: worker-1 name: worker-1
fieldrefs: fieldrefs:
- "spec.template.spec.files[path=/etc/systemd/system/docker.service.d/http-proxy.conf].content%REPLACEMENT_HTTP_PROXY%" - "{.spec.template.spec.files[:].content}%REPLACEMENT_HTTP_PROXY%"
- source: - source:
objref: objref:
name: env-vars-catalogue name: env-vars-catalogue
@ -28,7 +28,7 @@ replacements:
kind: KubeadmConfigTemplate kind: KubeadmConfigTemplate
name: worker-1 name: worker-1
fieldrefs: fieldrefs:
- "spec.template.spec.files[path=/etc/systemd/system/docker.service.d/http-proxy.conf].content%REPLACEMENT_HTTPS_PROXY%" - "{.spec.template.spec.files[:].content}%REPLACEMENT_HTTPS_PROXY%"
- source: - source:
objref: objref:
name: env-vars-catalogue name: env-vars-catalogue
@ -38,4 +38,4 @@ replacements:
kind: KubeadmConfigTemplate kind: KubeadmConfigTemplate
name: worker-1 name: worker-1
fieldrefs: fieldrefs:
- "spec.template.spec.files[path=/etc/systemd/system/docker.service.d/http-proxy.conf].content%REPLACEMENT_NO_PROXY%" - "{.spec.template.spec.files[:].content}%REPLACEMENT_NO_PROXY%"

View File

@ -88,16 +88,16 @@
airship_gate_flavors: airship_gate_flavors:
medium: medium:
disk_format: qcow2 disk_format: qcow2
ephemeral_disk_size: 20G ephemeral_disk_size: 30G
ephemeral_vm_cfg: "{{ ephemeral_vm_cfg }}" ephemeral_vm_cfg: "{{ ephemeral_vm_cfg }}"
ephemeral_vm_memory_mb: 6144 ephemeral_vm_memory_mb: 6144
ephemeral_vm_vcpus: 4 ephemeral_vm_vcpus: 4
target_disk_size: 20G target_disk_size: 30G
target_vm_cfg: "{{ target_vm_cfg }}" target_vm_cfg: "{{ target_vm_cfg }}"
target_vm_memory_mb: 7168 target_vm_memory_mb: 7168
target_vm_vcpus: 2 target_vm_vcpus: 2
target_vms_count: 1 target_vms_count: 1
worker_disk_size: 20G worker_disk_size: 30G
worker_vm_cfg: "{{ worker_vm_cfg }}" worker_vm_cfg: "{{ worker_vm_cfg }}"
worker_vm_memory_mb: 7168 worker_vm_memory_mb: 7168
worker_vm_vcpus: 2 worker_vm_vcpus: 2