-
Notifications
You must be signed in to change notification settings - Fork 212
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
Changes from all commits
f1bcfe6
012b633
84896cc
b71d0ea
360fe89
66c892d
1646a1c
aaffa7f
2faa9b4
40d44d0
8267ad9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -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 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: separate clauses with 2 separate
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it makes no difference between these two if logic. |
||||||
echo "Configure credential provider for both image-credential-provider-config and image-credential-provider-bin-dir flags are specified in KUBELET_FLAGS" | ||||||
logs_to_events "AKS.CSE.ensureKubelet.configCredentialProvider" configCredentialProvider | ||||||
logs_to_events "AKS.CSE.ensureKubelet.installCredentalProvider" installCredentalProvider | ||||||
fi | ||||||
|
||||||
systemctlEnableAndStart kubelet || exit $ERR_KUBELET_START_FAIL | ||||||
} | ||||||
|
||||||
|
@@ -696,4 +704,44 @@ disableSSH() { | |||||
systemctlDisableAndStop ssh || exit $ERR_DISABLE_SSH | ||||||
} | ||||||
|
||||||
configCredentialProvider() { | ||||||
CREDENTIAL_PROVIDER_CONFIG_FILE=/var/lib/kubelet/credential-provider-config.yaml | ||||||
mkdir -p "$(dirname "${CREDENTIAL_PROVIDER_CONFIG_FILE}")" | ||||||
touch "${CREDENTIAL_PROVIDER_CONFIG_FILE}" | ||||||
if [[ -n "$AKS_CUSTOM_CLOUD_CONTAINER_REGISTRY_DNS_SUFFIX" ]]; then | ||||||
tee "${CREDENTIAL_PROVIDER_CONFIG_FILE}" > /dev/null <<EOF | ||||||
apiVersion: kubelet.config.k8s.io/v1 | ||||||
kind: CredentialProviderConfig | ||||||
providers: | ||||||
- name: acr-credential-provider | ||||||
matchImages: | ||||||
- "*.azurecr.io" | ||||||
- "*.azurecr.cn" | ||||||
- "*.azurecr.de" | ||||||
- "*.azurecr.us" | ||||||
- "*$AKS_CUSTOM_CLOUD_CONTAINER_REGISTRY_DNS_SUFFIX" | ||||||
defaultCacheDuration: "10m" | ||||||
apiVersion: credentialprovider.kubelet.k8s.io/v1 | ||||||
args: | ||||||
- /etc/kubernetes/azure.json | ||||||
EOF | ||||||
else | ||||||
tee "${CREDENTIAL_PROVIDER_CONFIG_FILE}" > /dev/null <<EOF | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: just use There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
apiVersion: kubelet.config.k8s.io/v1 | ||||||
kind: CredentialProviderConfig | ||||||
providers: | ||||||
- name: acr-credential-provider | ||||||
matchImages: | ||||||
- "*.azurecr.io" | ||||||
- "*.azurecr.cn" | ||||||
- "*.azurecr.de" | ||||||
- "*.azurecr.us" | ||||||
defaultCacheDuration: "10m" | ||||||
apiVersion: credentialprovider.kubelet.k8s.io/v1 | ||||||
args: | ||||||
- /etc/kubernetes/azure.json | ||||||
EOF | ||||||
fi | ||||||
} | ||||||
|
||||||
#EOF |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1620,6 +1620,14 @@ type K8sComponents struct { | |
// Full path to the Linux package (tar.gz) to use. | ||
// For example: url=https://acs-mirror.azureedge.net/kubernetes/v1.25.6-hotfix.20230612/binaries/v1.25.6-hotfix.20230612.tar.gz | ||
LinuxPrivatePackageURL string | ||
|
||
// 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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
|
||
// Full path to the Linux credential provider (tar.gz) to use. | ||
// For example: "https://acs-mirror.azureedge.net/cloud-provider-azure/v1.29.4/binaries/azure-acr-credential-provider-linux-amd64-v1.29.4.tar.gz" | ||
LinuxCredentialProviderURL string | ||
mainred marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
|
||
// GetLatestSigImageConfigRequest describes the input for a GetLatestSigImageConfig HTTP request. | ||
|
There was a problem hiding this comment.
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