Implements custom QCOW delivery
With this commit QCOW images are pulled as a docker image to new qcow-bundle container within ironic pod and copy them to shared ironic volume to be served to hosts. Also squashed with [0], manifests are adjusted to consume new QCOWs and old QCOW related funtionality is removed. [0] https://review.opendev.org/c/airship/airshipctl/+/776270 Co-Authored-By: Alexey Odinokov <aodinokov@mirantis.com> Co-Authored-By: Craig Anderson <craig.anderson@att.com> Change-Id: I958184b34ae94206bc5e87993e9287587b6a11d9 Signed-off-by: Andrii Ostapenko <andrii.ostapenko@att.com>
This commit is contained in:
parent
4c1d1f87c0
commit
3f559c3c1e
@ -59,6 +59,16 @@ spec:
|
||||
- name: ironic-entrypoints
|
||||
mountPath: /bin/init-images
|
||||
subPath: init-images
|
||||
- name: qcow-bundle
|
||||
command:
|
||||
- sh
|
||||
- -c
|
||||
- "cp /qcows/*.qcow2 /qcows/*.qcow2.md5sum /shared/html/images/"
|
||||
image: "quay.io/airshipit/qcow-bundle:latest-ubuntu_focal"
|
||||
imagePullPolicy: Always
|
||||
volumeMounts:
|
||||
- mountPath: "/shared"
|
||||
name: ironic-storage
|
||||
containers:
|
||||
- name: dnsmasq
|
||||
image: "quay.io/metal3-io/ironic:latest"
|
||||
|
@ -22,34 +22,9 @@ spec:
|
||||
Environment="NO_PROXY=REPLACEMENT_NO_PROXY"
|
||||
# TODO: add download sources to the versions catalogue
|
||||
preKubeadmCommands:
|
||||
- echo 'root:r00tme' | chpasswd
|
||||
- echo 'ubuntu:r00tme' | chpasswd
|
||||
- |
|
||||
cat <<EOF | tee /etc/sysctl.d/k8s.conf
|
||||
net.bridge.bridge-nf-call-ip6tables = 1
|
||||
net.bridge.bridge-nf-call-iptables = 1
|
||||
EOF
|
||||
- sysctl --system
|
||||
- swapoff -a
|
||||
- export HTTP_PROXY=REPLACEMENT_HTTP_PROXY
|
||||
- export HTTPS_PROXY=REPLACEMENT_HTTPS_PROXY
|
||||
- export http_proxy=${HTTP_PROXY}
|
||||
- export https_proxy=${HTTPS_PROXY}
|
||||
- export NO_PROXY=REPLACEMENT_NO_PROXY
|
||||
- export no_proxy=${NO_PROXY}
|
||||
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
|
||||
- curl -fsSL https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
|
||||
- echo "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | tee -a /etc/apt/sources.list
|
||||
# Replace xenial with focal or $(lsb_release -cs) once available
|
||||
- echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | tee -a /etc/apt/sources.list
|
||||
- apt update
|
||||
- apt install -y
|
||||
docker-ce="$(apt-cache policy docker-ce | grep 19.03.12 | sort | head -n 1 | tr -s " " | cut -d ' ' -f 2)"
|
||||
docker-ce-cli="$(apt-cache policy docker-ce-cli | grep 19.03.12 | sort | head -n 1 | tr -s " " | cut -d ' ' -f 2)"
|
||||
containerd.io
|
||||
- apt install -y kubelet=1.18.6-00 kubeadm=1.18.6-00 kubectl=1.18.6-00
|
||||
- apt-mark hold docker-ce docker-ce-cli containerd.io kubelet kubeadm kubectl
|
||||
- unset http_proxy https_proxy HTTP_PROXY HTTPS_PROXY no_proxy NO_PROXY
|
||||
# Restart docker to apply any proxy settings
|
||||
- export HOME=/root
|
||||
- systemctl restart docker
|
||||
initConfiguration:
|
||||
nodeRegistration:
|
||||
name: '{{ ds.meta_data.local_hostname }}'
|
||||
|
@ -10,7 +10,7 @@ metadata:
|
||||
hosts:
|
||||
m3:
|
||||
node01:
|
||||
bootMode: UEFI
|
||||
bootMode: legacy
|
||||
macAddress: 52:54:00:b6:ed:31
|
||||
bmcAddress: redfish+http://10.23.25.1:8000/redfish/v1/Systems/air-target-1
|
||||
bmcUsername: root
|
||||
@ -24,7 +24,7 @@ hosts:
|
||||
pxe: 52:54:00:b6:ed:31
|
||||
hardwareProfile: default # defined in the hostgenerator-m3 function
|
||||
node02:
|
||||
bootMode: UEFI
|
||||
bootMode: legacy
|
||||
macAddress: 52:54:00:b6:ed:02
|
||||
bmcAddress: redfish+https://10.23.25.1:8443/redfish/v1/Systems/air-ephemeral
|
||||
bmcUsername: username
|
||||
@ -38,7 +38,7 @@ hosts:
|
||||
pxe: 52:54:00:b6:ed:02
|
||||
hardwareProfile: example # defined in the hardwareprofile-example function
|
||||
node03:
|
||||
bootMode: UEFI
|
||||
bootMode: legacy
|
||||
macAddress: 52:54:00:b6:ed:23
|
||||
bmcAddress: redfish+http://10.23.25.1:8000/redfish/v1/Systems/air-worker-1
|
||||
bmcUsername: username
|
||||
|
@ -7,5 +7,5 @@ files:
|
||||
k8scontrol:
|
||||
# Host the image in a locally served location for CI
|
||||
cluster_controlplane_image:
|
||||
url: http://10.23.24.1:8099/target-image.qcow2
|
||||
checksum: http://10.23.24.1:8099/target-image.qcow2.md5sum
|
||||
url: http://10.23.24.101:80/images/control-plane.qcow2
|
||||
checksum: http://10.23.24.101:80/images/control-plane.qcow2.md5sum
|
||||
|
@ -12,50 +12,17 @@ spec:
|
||||
node-labels: 'metal3.io/uuid={{ ds.meta_data.uuid }},node-type=worker'
|
||||
provider-id: 'metal3://{{ ds.meta_data.uuid }}'
|
||||
feature-gates: "IPv6DualStack=true"
|
||||
ntp:
|
||||
enabled: true
|
||||
servers:
|
||||
- 135.188.34.124
|
||||
- 135.38.244.16
|
||||
- 135.188.34.84
|
||||
files:
|
||||
- path: "/etc/systemd/system/docker.service.d/http-proxy.conf"
|
||||
content: |
|
||||
[Service]
|
||||
Environment="HTTP_PROXY=REPLACEMENT_HTTP_PROXY"
|
||||
Environment="HTTPS_PROXY=REPLACEMENT_HTTPS_PROXY"
|
||||
Environment="NO_PROXY=REPLACEMENT_NO_PROXY"
|
||||
preKubeadmCommands:
|
||||
- echo 'root:r00tme' | chpasswd
|
||||
- echo 'ubuntu:r00tme' | chpasswd
|
||||
- |
|
||||
cat <<EOF | tee /etc/sysctl.d/k8s.conf
|
||||
net.bridge.bridge-nf-call-ip6tables = 1
|
||||
net.bridge.bridge-nf-call-iptables = 1
|
||||
EOF
|
||||
- sysctl --system
|
||||
- |
|
||||
mkdir -p /etc/systemd/system/docker.service.d/
|
||||
cat <<EOF | tee /etc/systemd/system/docker.service.d/http-proxy.conf
|
||||
[Service]
|
||||
Environment="HTTP_PROXY=REPLACEMENT_HTTP_PROXY"
|
||||
Environment="HTTPS_PROXY=REPLACEMENT_HTTPS_PROXY"
|
||||
Environment="NO_PROXY=REPLACEMENT_NO_PROXY"
|
||||
EOF
|
||||
- export HTTP_PROXY=REPLACEMENT_HTTP_PROXY
|
||||
- export HTTPS_PROXY=REPLACEMENT_HTTPS_PROXY
|
||||
- export http_proxy=${HTTP_PROXY}
|
||||
- export https_proxy=${HTTPS_PROXY}
|
||||
- export NO_PROXY=REPLACEMENT_NO_PROXY
|
||||
- export no_proxy=${NO_PROXY}
|
||||
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
|
||||
- curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
|
||||
- add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
|
||||
- echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | tee -a /etc/apt/sources.list
|
||||
- apt-get update
|
||||
- apt-get install -y
|
||||
docker-ce="$(apt policy docker-ce | grep 19.03.9 | sort | head -n 1 | tr -s " " | cut -d ' ' -f 2 )"
|
||||
docker-ce-cli="$(apt policy docker-ce-cli | grep 19.03.9 | sort | head -n 1 | tr -s " " | cut -d ' ' -f 2 )"
|
||||
containerd.io
|
||||
- swapoff -a
|
||||
- apt-get install -y kubelet=1.18.6-00 kubeadm=1.18.6-00
|
||||
- apt-mark hold kubelet kubeadm
|
||||
- systemctl mask ntp
|
||||
- systemctl enable --now systemd-timesyncd
|
||||
- unset http_proxy https_proxy HTTP_PROXY HTTPS_PROXY no_proxy NO_PROXY
|
||||
# Restart docker to apply any proxy settings
|
||||
- export HOME=/root
|
||||
- systemctl restart docker
|
||||
users:
|
||||
- name: deployer
|
||||
sshAuthorizedKeys:
|
||||
|
@ -6,5 +6,5 @@ spec:
|
||||
template:
|
||||
spec:
|
||||
image:
|
||||
url: http://10.23.24.1:8099/target-image.qcow2
|
||||
checksum: http://10.23.24.1:8099/target-image.qcow2.md5sum
|
||||
url: http://10.23.24.102:80/images/data-plane.qcow2
|
||||
checksum: http://10.23.24.102:80/images/data-plane.qcow2.md5sum
|
||||
|
@ -17,7 +17,9 @@ replacements:
|
||||
objref:
|
||||
kind: KubeadmConfigTemplate
|
||||
name: worker-1
|
||||
fieldrefs: ["spec.template.spec.preKubeadmCommands%REPLACEMENT_HTTP_PROXY%"]
|
||||
fieldrefs:
|
||||
- "spec.template.spec.preKubeadmCommands%REPLACEMENT_HTTP_PROXY%"
|
||||
- "spec.template.spec.files[path=/etc/systemd/system/docker.service.d/http-proxy.conf].content%REPLACEMENT_HTTP_PROXY%"
|
||||
- source:
|
||||
objref:
|
||||
name: env-vars-catalogue
|
||||
@ -26,7 +28,9 @@ replacements:
|
||||
objref:
|
||||
kind: KubeadmConfigTemplate
|
||||
name: worker-1
|
||||
fieldrefs: ["spec.template.spec.preKubeadmCommands%REPLACEMENT_HTTPS_PROXY%"]
|
||||
fieldrefs:
|
||||
- "spec.template.spec.preKubeadmCommands%REPLACEMENT_HTTPS_PROXY%"
|
||||
- "spec.template.spec.files[path=/etc/systemd/system/docker.service.d/http-proxy.conf].content%REPLACEMENT_HTTPS_PROXY%"
|
||||
- source:
|
||||
objref:
|
||||
name: env-vars-catalogue
|
||||
@ -35,4 +39,6 @@ replacements:
|
||||
objref:
|
||||
kind: KubeadmConfigTemplate
|
||||
name: worker-1
|
||||
fieldrefs: ["spec.template.spec.preKubeadmCommands%REPLACEMENT_NO_PROXY%"]
|
||||
fieldrefs:
|
||||
- "spec.template.spec.preKubeadmCommands%REPLACEMENT_NO_PROXY%"
|
||||
- "spec.template.spec.files[path=/etc/systemd/system/docker.service.d/http-proxy.conf].content%REPLACEMENT_NO_PROXY%"
|
||||
|
@ -90,16 +90,16 @@
|
||||
disk_format: qcow2
|
||||
ephemeral_disk_size: 20G
|
||||
ephemeral_vm_cfg: "{{ ephemeral_vm_cfg }}"
|
||||
ephemeral_vm_memory_mb: 6124
|
||||
ephemeral_vm_memory_mb: 6144
|
||||
ephemeral_vm_vcpus: 4
|
||||
target_disk_size: 20G
|
||||
target_vm_cfg: "{{ target_vm_cfg }}"
|
||||
target_vm_memory_mb: 6124
|
||||
target_vm_memory_mb: 7168
|
||||
target_vm_vcpus: 2
|
||||
target_vms_count: 1
|
||||
worker_disk_size: 20G
|
||||
worker_vm_cfg: "{{ worker_vm_cfg }}"
|
||||
worker_vm_memory_mb: 6124
|
||||
worker_vm_memory_mb: 7168
|
||||
worker_vm_vcpus: 2
|
||||
worker_vms_count: 1
|
||||
airship_gate_file_exchanger:
|
||||
|
@ -14,9 +14,7 @@
|
||||
|
||||
set -ex
|
||||
|
||||
TARGET_IMAGE_DIR="/srv/images"
|
||||
EPHEMERAL_DOMAIN_NAME="air-ephemeral"
|
||||
TARGET_IMAGE_URL="https://cloud-images.ubuntu.com/focal/current/focal-server-cloudimg-amd64.img"
|
||||
export KUBECONFIG=${KUBECONFIG:-"$HOME/.airship/kubeconfig"}
|
||||
export KUBECONFIG_TARGET_CONTEXT=${KUBECONFIG_TARGET_CONTEXT:-"target-cluster"}
|
||||
|
||||
@ -31,22 +29,6 @@ do
|
||||
xargs -I{} sudo virsh change-media $vm {} --eject || :
|
||||
done
|
||||
|
||||
echo "Download target image"
|
||||
DOWNLOAD="200"
|
||||
if [ -e ${TARGET_IMAGE_DIR}/target-image.qcow2 ]
|
||||
then
|
||||
MTIME=$(date -d @$(stat -c %Y ${TARGET_IMAGE_DIR}/target-image.qcow2) +"%a, %d %b %Y %T %Z")
|
||||
DOWNLOAD=$(curl -sSLI \
|
||||
--write-out '%{http_code}' \
|
||||
-H "If-Modified-Since: ${MTIME}" \
|
||||
${TARGET_IMAGE_URL} | tail -1)
|
||||
fi
|
||||
if [ "${DOWNLOAD}" != "304" ]
|
||||
then
|
||||
curl -sSLo ${TARGET_IMAGE_DIR}/target-image.qcow2 ${TARGET_IMAGE_URL}
|
||||
fi
|
||||
md5sum /srv/images/target-image.qcow2 | cut -d ' ' -f 1 > ${TARGET_IMAGE_DIR}/target-image.qcow2.md5sum
|
||||
|
||||
echo "Create target k8s cluster resources"
|
||||
airshipctl phase run controlplane-ephemeral --debug
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user