# Kubelet CredentialProvider (v1)

Kubelet CredentialProvider (v1)Resource TypesCredentialProviderRequestCredentialProviderResponseCredentialProviderRequestCredentialProviderRequest includes the image that the kubelet requires authentication for. Kubelet will pass this request object to the plugin via stdin. In general, plugins should prefer responding with the same apiVersion they were sent.FieldDescriptionapiVersionstringcredentialprovider.kubelet.k8s.io/v1kindstringCredentialProviderRequestimage [Required]stringimage is the container image that is being pulled as part of the credential provider plugin request. Plugins may optionally parse the image to extract any information required to fetch credentials.serviceAccountToken [Required]stringserviceAccountToken is the service account token bound to the pod for which the image is being pulled. This token is only sent to the plugin if the tokenAttributes.serviceAccountTokenAudience field is configured in the kubelet's credential provider configuration.serviceAccountAnnotations [Required]map[string]stringserviceAccountAnnotations is a map of annotations on the service account bound to the pod for which the image is being pulled. The list of annotations in the service account that need to be passed to the plugin is configured in the kubelet's credential provider configuration.CredentialProviderResponseCredentialProviderResponse holds credentials that the kubelet should use for the specified image provided in the original request. Kubelet will read the response from the plugin via stdout. This response should be set to the same apiVersion as CredentialProviderRequest.FieldDescriptionapiVersionstringcredentialprovider.kubelet.k8s.io/v1kindstringCredentialProviderResponsecacheKeyType [Required]PluginCacheKeyTypecacheKeyType indicates the type of caching key to use based on the image provided in the request. There are three valid values for the cache key type: Image, Registry, and Global. If an invalid value is specified, the response will NOT be used by the kubelet.cacheDurationmeta/v1.DurationcacheDuration indicates the duration the provided credentials should be cached for. The kubelet will use this field to set the in-memory cache duration for credentials in the AuthConfig. If null, the kubelet will use defaultCacheDuration provided in CredentialProviderConfig. If set to 0, the kubelet will not cache the provided AuthConfig.authmap[string]AuthConfigauth is a map containing authentication information passed into the kubelet. Each key is a match image string (more on this below). The corresponding authConfig value should be valid for all images that match against this key. A plugin should set this field to null if no valid credentials can be returned for the requested image.Each key in the map is a pattern which can optionally contain a port and a path. Globs can be used in the domain, but not in the port or the path. Globs are supported as subdomains like '*.k8s.io' or 'k8s.*.io', and top-level-domains such as 'k8s.*'. Matching partial subdomains like 'app*.k8s.io' is also supported. Each glob can only match a single subdomain segment, so *.io does not match *.k8s.io.The kubelet will match images against the key when all of the below are true:Both contain the same number of domain parts and each part matches.The URL path of an imageMatch must be a prefix of the target image URL path.If the imageMatch contains a port, then the port must match in the image as well.When multiple keys are returned, the kubelet will traverse all keys in reverse order so that:longer keys come before shorter keys with the same prefixnon-wildcard keys come before wildcard keys with the same prefix.For any given match, the kubelet will attempt an image pull with the provided credentials, stopping after the first successfully authenticated pull.Example keys:123456789.dkr.ecr.us-east-1.amazonaws.com*.azurecr.iogcr.io*.*.registry.ioregistry.io:8080/pathAuthConfigAppears in:CredentialProviderResponseAuthConfig contains authentication information for a container registry. Only username/password based authentication is supported today, but more authentication mechanisms may be added in the future.FieldDescriptionusername [Required]stringusername is the username used for authenticating to the container registry An empty username is valid.password [Required]stringpassword is the password used for authenticating to the container registry An empty password is valid.PluginCacheKeyType(Alias of string)Appears in:CredentialProviderResponseThis page is automatically generated.If you plan to report an issue with this page, mention that the page is auto-generated in your issue description. The fix may need to happen elsewhere in the Kubernetes project.