Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add function to extract and cache CoreDNS Binary in VHD for localdns #6082

Merged
merged 11 commits into from
Mar 27, 2025

Conversation

SriHarsha001
Copy link
Collaborator

@SriHarsha001 SriHarsha001 commented Mar 25, 2025

What type of PR is this?
feature

What this PR does / why we need it:
This PR adds a function to extract a coredns binary from cached coredns container images in the VHD. It extracts binary of n-1 coredns image version and latest revision version (v.Major.Minor.Patch-Revision) and copies it to /opt/azure/containers/localdns/binary/coredns path. This binary will be used by localdns systemd unit. The function also handles the cleanup of temporary directories and unmounting of images.

Which issue(s) this PR fixes:

Fixes # None

Requirements:
Build

Special notes for your reviewer:
Not sure if there is a way to write unit tests for this file.

Release note:

none

@SriHarsha001
Copy link
Collaborator Author

SriHarsha001 commented Mar 26, 2025

Manually tested both the functions on an AKS agent node.

./testCoreDnsBinaryExtractedAndCached.sh
CoreDnsBinaryExtractedAndCached: Checking for existence of coredns binary at /opt/azure/containers/localdns/binary/coredns
CoreDnsBinaryExtractedAndCached: Expected CoreDNS version (n-1 latest revision): 1.9.4-5
CoreDnsBinaryExtractedAndCached: Verify extracted CoreDNS version: 1.9.4
CoreDnsBinaryExtractedAndCached: Expected version: 1.9.4-5 of coredns binary is extracted and cached at /opt/azure/containers/localdns/binary/coredns

and

./extractAndCacheCoreDnsBinary.sh

cat /opt/azure/vhd-install.complete | grep coredns
  - mcr.microsoft.com/oss/v2/kubernetes/coredns:v1.11.3-6
  - mcr.microsoft.com/oss/v2/kubernetes/coredns:v1.9.4-5
Copied coredns binary of v1.9.4-5 to /opt/azure/containers/localdns/binary/coredns
Successfully copied coredns binary of v1.9.4-5

Copy link
Contributor

No changes to cached containers or packages on Windows VHDs

@SriHarsha001 SriHarsha001 merged commit 4a0092e into master Mar 27, 2025
21 checks passed
@SriHarsha001 SriHarsha001 deleted the sharsha/extractAndCacheCoreDNSBinaries branch March 27, 2025 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants