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

OCPCLOUD-2462: Add Image Credential Provider flags for Kubelet on Azure #4222

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions pkg/controller/template/render.go
Expand Up @@ -469,6 +469,8 @@ func credentialProviderConfigFlag(cfg RenderConfig) interface{} {
return fmt.Sprintf("%s %s%s", credentialProviderBinDirFlag, credentialProviderConfigFlag, "ecr-credential-provider.yaml")
case configv1.GCPPlatformType:
return fmt.Sprintf("%s %s%s", credentialProviderBinDirFlag, credentialProviderConfigFlag, "gcr-credential-provider.yaml")
case configv1.AzurePlatformType:
return fmt.Sprintf("%s %s%s", credentialProviderBinDirFlag, credentialProviderConfigFlag, "acr-credential-provider.yaml")
default:
return ""
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/template/render_test.go
Expand Up @@ -311,7 +311,7 @@ func TestCredentialProviderConfigFlag(t *testing.T) {
},
{
platform: configv1.AzurePlatformType,
res: "",
res: "--image-credential-provider-bin-dir=/usr/libexec/kubelet-image-credential-provider-plugins --image-credential-provider-config=/etc/kubernetes/credential-providers/acr-credential-provider.yaml",
},
{
platform: configv1.GCPPlatformType,
Expand Down
@@ -0,0 +1,18 @@
mode: 0644
path: "/etc/kubernetes/credential-providers/acr-credential-provider.yaml"
contents:
inline: |
apiVersion: kubelet.config.k8s.io/v1
kind: CredentialProviderConfig
providers:
- name: acr-credential-provider
apiVersion: credentialprovider.kubelet.k8s.io/v1
defaultCacheDuration: "10m"
matchImages:
- "*.azurecr.io"
- "*.azurecr.cn"
- "*.azurecr.de"
- "*.azurecr.us"
args:
- /etc/kubernetes/cloud.conf