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

feat: cse support credential provider and vhd cache binary for Linux #4258

Merged
merged 11 commits into from
Apr 13, 2024

Conversation

mainred
Copy link
Member

@mainred mainred commented Apr 9, 2024

What type of PR is this?

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #

Requirements:

Special notes for your reviewer:

Release note:

none

EOF
}
# remove blank lines from the config file.
sed -i '/^$/d' ${CREDENTIAL_PROVIDER_CONFIG_FILE}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if L721 condition does not meet, there'll be a blank line left over.

@@ -503,6 +503,14 @@ EOF
# for DNS.
iptables -I FORWARD -d 168.63.129.16 -p tcp --dport 80 -j DROP
EOF

# check if kubelet flags contain image-credential-provider-config and image-credential-provider-bin-dir
if [[ $KUBELET_FLAGS == *"image-credential-provider-config"* && $KUBELET_FLAGS == *"image-credential-provider-bin-dir"* ]]; then
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

before 1.30 these two flags are optional

@@ -408,6 +408,15 @@ fi
stop_watch $capture_time "GPU Device plugin" false
start_watch

# Kubelet credential provider plugins
CREDENTIAL_PROVIDER_VERSIONS="
"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no release published yet.
Same case for Windows VHD packer script.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where is windows packer script?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mainred mainred force-pushed the qinhao/credential-provider branch from 019f1f7 to 57f9fef Compare April 9, 2024 08:03
@mainred mainred force-pushed the qinhao/credential-provider branch from 57f9fef to e213418 Compare April 10, 2024 04:06
# Kubelet credential provider
$global:CredentialProviderURL = "{{GetParameter "windowsCredentialProviderURL"}}"
$global:CredentialProviderBinDir = "c:\var\lib\kubelet\credential-provider"
$global:CredentialProviderConfDir = "c:\var\lib\kubelet"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should use c:\k instead because c:\k is the working folder of kuberentes for Windows node, and the other folder will bring error like access failure.
In my test, "c:\var\lib\kubelet" lead to access failure when writing the configure file.
|Access to the path 'C:\var\lib\kubelet\credential-provider-config.yaml' is denied.

AbelHu
AbelHu previously requested changes Apr 10, 2024
Copy link
Member

@AbelHu AbelHu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please follow staging/cse/windows/README to add the logic in aks windows cse scripts.

@mainred mainred force-pushed the qinhao/credential-provider branch 2 times, most recently from 7123bbd to ebbdb5d Compare April 11, 2024 08:51
@mainred mainred force-pushed the qinhao/credential-provider branch from ebbdb5d to f1bcfe6 Compare April 11, 2024 08:52
@mainred
Copy link
Member Author

mainred commented Apr 12, 2024

@AbelHu This change is basically for Linux side work, but include a few data model change, could you please take another look?

ping @feiskyer for another look.

Thank you.

@mainred mainred enabled auto-merge (squash) April 12, 2024 08:20
@AbelHu AbelHu disabled auto-merge April 12, 2024 10:44
@AbelHu AbelHu self-requested a review April 12, 2024 10:44

// Full path to the Windows credential provider (tar.gz) to use.
// For example: https://acs-mirror.azureedge.net/cloud-provider-azure/v1.29.4/binaries/azure-acr-credential-provider-windows-amd64-v1.29.4.tar.gz
WindowsCredentialProviderURL string
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are these specifically for ACR? if so can we reflect that in their names?

e.g. WindowsACRCredentialProviderURL

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CredentialProviderURL is enough, credentialprovider is an official indicating container registry credential provider and in our case acr.

@@ -503,6 +503,14 @@ EOF
# for DNS.
iptables -I FORWARD -d 168.63.129.16 -p tcp --dport 80 -j DROP
EOF

# check if kubelet flags contain image-credential-provider-config and image-credential-provider-bin-dir
if [[ $KUBELET_FLAGS == *"image-credential-provider-config"* && $KUBELET_FLAGS == *"image-credential-provider-bin-dir"* ]]; then
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: separate clauses with 2 separate [[ ]]'s

if [[ $KUBELET_FLAGS == *"image-credential-provider-config"* ]] && [[ $KUBELET_FLAGS == *"image-credential-provider-bin-dir"* ]]; then

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it makes no difference between these two if logic.

CREDENTIAL_PROVIDER_CONFIG_FILE=/var/lib/kubelet/credential-provider-config.yaml
mkdir -p "$(dirname "${CREDENTIAL_PROVIDER_CONFIG_FILE}")"
touch "${CREDENTIAL_PROVIDER_CONFIG_FILE}"
tee "${CREDENTIAL_PROVIDER_CONFIG_FILE}" > /dev/null <<EOF
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: just use cat instead of tee'ing and piping output to the null device

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tee is the common tool used in case to write files, so I it's good to keep it as it is.

CREDENTIAL_PROVIDER_CONFIG_FILE=/var/lib/kubelet/credential-provider-config.yaml
mkdir -p "$(dirname "${CREDENTIAL_PROVIDER_CONFIG_FILE}")"
touch "${CREDENTIAL_PROVIDER_CONFIG_FILE}"
tee "${CREDENTIAL_PROVIDER_CONFIG_FILE}" > /dev/null <<EOF
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
tee "${CREDENTIAL_PROVIDER_CONFIG_FILE}" > /dev/null <<EOF
cat > "${CREDENTIAL_PROVIDER_CONFIG_FILE}" <<EOF

@mainred mainred dismissed AbelHu’s stale review April 12, 2024 23:51

use a separate PR for windows work

@mainred mainred enabled auto-merge (squash) April 13, 2024 00:03
@mainred mainred merged commit f433ead into master Apr 13, 2024
20 checks passed
@mainred mainred deleted the qinhao/credential-provider branch April 13, 2024 00:31
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.

5 participants