Skip to content

Commit

Permalink
use az to download storage blobs for custom builds
Browse files Browse the repository at this point in the history
Signed-off-by: Jack Francis <jackfrancis@gmail.com>
  • Loading branch information
jackfrancis authored and k8s-infra-cherrypick-robot committed Apr 12, 2024
1 parent 7219290 commit a71385f
Show file tree
Hide file tree
Showing 14 changed files with 82 additions and 55 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions templates/test/ci/cluster-template-prow-ci-version-ipv6.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 9 additions & 6 deletions templates/test/ci/cluster-template-prow-ci-version.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@
set -o errexit
[[ $(id -u) != 0 ]] && SUDO="sudo" || SUDO=""
az login --identity
echo "Use OOT credential provider"
mkdir -p /var/lib/kubelet/credential-provider
curl --retry 10 --retry-delay 5 -w "response status code is %{http_code}" -Lo /var/lib/kubelet/credential-provider/acr-credential-provider "https://${AZURE_STORAGE_ACCOUNT}.blob.core.windows.net/${AZURE_BLOB_CONTAINER_NAME}/${IMAGE_TAG_ACR_CREDENTIAL_PROVIDER}/azure-acr-credential-provider"
az storage blob download --blob-url "https://${AZURE_STORAGE_ACCOUNT}.blob.core.windows.net/${AZURE_BLOB_CONTAINER_NAME}/${IMAGE_TAG_ACR_CREDENTIAL_PROVIDER}/azure-acr-credential-provider" -f /var/lib/kubelet/credential-provider/acr-credential-provider --auth-mode login
chmod 755 /var/lib/kubelet/credential-provider/acr-credential-provider
curl --retry 10 --retry-delay 5 -w "response status code is %{http_code}" -Lo /var/lib/kubelet/credential-provider-config.yaml "https://${AZURE_STORAGE_ACCOUNT}.blob.core.windows.net/${AZURE_BLOB_CONTAINER_NAME}/${IMAGE_TAG_ACR_CREDENTIAL_PROVIDER}/credential-provider-config.yaml"
az storage blob download --blob-url "https://${AZURE_STORAGE_ACCOUNT}.blob.core.windows.net/${AZURE_BLOB_CONTAINER_NAME}/${IMAGE_TAG_ACR_CREDENTIAL_PROVIDER}/credential-provider-config.yaml" -f /var/lib/kubelet/credential-provider-config.yaml --auth-mode login
chmod 644 /var/lib/kubelet/credential-provider-config.yaml
path: /tmp/oot-cred-provider.sh
owner: "root:root"
Expand All @@ -37,4 +38,4 @@
- op: add
path: /spec/kubeadmConfigSpec/joinConfiguration/nodeRegistration/kubeletExtraArgs/image-credential-provider-config
value:
/var/lib/kubelet/credential-provider-config.yaml
/var/lib/kubelet/credential-provider-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
content: |
$ErrorActionPreference = 'Stop'
az login --identity
echo "Use OOT credential provider"
mkdir C:\var\lib\kubelet\credential-provider
curl.exe --retry 10 --retry-delay 5 -L "https://${AZURE_STORAGE_ACCOUNT}.blob.core.windows.net/${AZURE_BLOB_CONTAINER_NAME}/${IMAGE_TAG_ACR_CREDENTIAL_PROVIDER}/azure-acr-credential-provider.exe" --output C:\var\lib\kubelet\credential-provider\acr-credential-provider.exe
az storage blob download --blob-url "https://${AZURE_STORAGE_ACCOUNT}.blob.core.windows.net/${AZURE_BLOB_CONTAINER_NAME}/${IMAGE_TAG_ACR_CREDENTIAL_PROVIDER}/azure-acr-credential-provider.exe" -f C:\var\lib\kubelet\credential-provider\acr-credential-provider.exe --auth-mode login
cp C:\var\lib\kubelet\credential-provider\acr-credential-provider.exe C:\var\lib\kubelet\credential-provider\acr-credential-provider
curl.exe --retry 10 --retry-delay 5 -L "https://${AZURE_STORAGE_ACCOUNT}.blob.core.windows.net/${AZURE_BLOB_CONTAINER_NAME}/${IMAGE_TAG_ACR_CREDENTIAL_PROVIDER}/credential-provider-config-win.yaml" --output C:\var\lib\kubelet\credential-provider-config.yaml
az storage blob download --blob-url "https://${AZURE_STORAGE_ACCOUNT}.blob.core.windows.net/${AZURE_BLOB_CONTAINER_NAME}/${IMAGE_TAG_ACR_CREDENTIAL_PROVIDER}/credential-provider-config-win.yaml" -f C:\var\lib\kubelet\credential-provider-config.yaml --auth-mode login
path: C:/oot-cred-provider.ps1
permissions: "0744"
- op: add
Expand All @@ -22,4 +23,4 @@
- op: add
path: /spec/template/spec/joinConfiguration/nodeRegistration/kubeletExtraArgs/image-credential-provider-config
value:
/var/lib/kubelet/credential-provider-config.yaml
/var/lib/kubelet/credential-provider-config.yaml
Loading

0 comments on commit a71385f

Please sign in to comment.