feat: update live patching scripts to support custom repo service#6139
feat: update live patching scripts to support custom repo service#6139
Conversation
| sed -i 's/https:\/\/snapshot.ubuntu.com\/ubuntu\/\([0-9]\{8\}T[0-9]\{6\}Z\)/https:\/\/snapshot.ubuntu.com\/ubuntu\/'"${golden_timestamp}"'/g' ${source_list_path} | ||
| # No live patching repo service annotation, so we need to change to use the ubuntu snapshot repo | ||
| # e.g. replace http://10.224.0.5/ubuntu/ with https://snapshot.ubuntu.com/ubuntu/20250318T000000Z | ||
| sed -i 's/http:\/\/[0-9]\+.[0-9]\+.[0-9]\+.[0-9]\+\/ubuntu\//https:\/\/snapshot.ubuntu.com\/ubuntu\/'"${golden_timestamp}"'/g' ${source_list_path} |
There was a problem hiding this comment.
not related to this PR, but we need to make the same changes to the cshelper in RP
There was a problem hiding this comment.
Yes, that's what we need to update in captureVHD API if it's NI:
- Get service IP
- Update cse for copied VMSS
| sed -i 's/https:\/\/snapshot.ubuntu.com\/ubuntu\/\([0-9]\{8\}T[0-9]\{6\}Z\)/http:\/\/'"${live_patching_repo_service}"'\/ubuntu\//g' ${source_list_path} | ||
| # upgrade the old live patching repo service to the new one | ||
| # e.g. replace http://10.224.0.5/ubuntu/ with http://10.224.0.6/ubuntu/ | ||
| sed -i 's/http:\/\/[0-9]\+.[0-9]\+.[0-9]\+.[0-9]\+\/ubuntu\//http:\/\/'"${live_patching_repo_service}"'\/ubuntu\//g' ${source_list_path} |
There was a problem hiding this comment.
Is there a way to run existing e2es on this new Image version?
There was a problem hiding this comment.
Seem the e2e is on the new image version.
There was a problem hiding this comment.
discussed with Ye offline regarding how we can get full RP E2E coverage before merge
4918e66 to
b0df435
Compare
b0df435 to
8bb0a4c
Compare
8bb0a4c to
4dc791b
Compare
parts/linux/cloud-init/artifacts/mariner/mariner-package-update.sh
Outdated
Show resolved
Hide resolved
| # Network isolated cluster can't access the internet, so we deploy a live patching repo service in the cluster | ||
| # The node will use the live patching repo service to download the repo metadata and packages | ||
| # If the annotation is not set, we will use the ubuntu snapshot repo | ||
| live_patching_repo_service=$($KUBECTL get node ${node_name} -o jsonpath="{.metadata.annotations['kubernetes\.azure\.com/live-patching-repo-service']}") |
There was a problem hiding this comment.
should we log something out if kubectl fails? you can grab the exit code with $?
There was a problem hiding this comment.
Since we added set -e for this script, if kubectl fails, it will exit directly and also log the reason.
|
No changes to cached containers or packages on Windows VHDs |
What type of PR is this?
/kind feature
What this PR does / why we need it:
For network isolated clusters, when doing security patch, they can't access internet to download packages. We decided to provide an internal repo service for these clusters. This PR is to update live patching scripts to support custom repo service.
Which issue(s) this PR fixes:
Fixes #
Requirements:
Special notes for your reviewer:
Release note: