Skip to content

Commit

Permalink
update templates/test/ci/prow-ci-version/patches/oot-credential-provi…
Browse files Browse the repository at this point in the history
…der.yaml and templates
  • Loading branch information
nawazkh committed Sep 12, 2024
1 parent bafa6ab commit 4dc7cf5
Show file tree
Hide file tree
Showing 5 changed files with 97 additions and 63 deletions.
33 changes: 19 additions & 14 deletions templates/test/ci/cluster-template-prow-ci-version-dual-stack.yaml

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

33 changes: 19 additions & 14 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.

33 changes: 19 additions & 14 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.

Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,26 @@
set -o errexit
[[ $(id -u) != 0 ]] && SUDO="sudo" || SUDO=""
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"
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"
chmod 644 /var/lib/kubelet/credential-provider-config.yaml
# Run the az login command with managed identity
output=$(az login --identity 2>&1)
status=$?
if [ $status -eq 0 ]; then
echo "Logged in Azure with managed identity"
az login --identity
echo "Use OOT credential provider"
mkdir -p /var/lib/kubelet/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
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
else
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"
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"
chmod 644 /var/lib/kubelet/credential-provider-config.yaml
fi
path: /tmp/oot-cred-provider.sh
owner: "root:root"
permissions: "0744"
Expand All @@ -29,4 +43,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
33 changes: 19 additions & 14 deletions templates/test/dev/cluster-template-custom-builds.yaml

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

0 comments on commit 4dc7cf5

Please sign in to comment.