Turn off validation for a supported registry
The NVCF API validates credentials and images for every supported registry. This guide shows how to turn off that validation for one registry. With validation off, you can run container functions without a registry credential in NVCF, or with a credential that the NVCF API cannot check. The example pulls from Amazon ECR with the EKS node IAM role instead of long-lived IAM user keys.
For a registry that NVCF does not support, use Allowlisting an Unsupported Registry instead. NVCF does not validate unsupported registries.
What each check does
Each supported registry has two checks in the NVCF API. Both checks are on by default.
Turn off artifact-validation when the cluster pulls images with its own identity. Turn off credential-validation only if the NVCF API cannot check a credential that you store.
Read these effects before you change a setting:
- Each setting applies to every account on the control plane and to every image hostname that maps to the same key.
- With artifact validation off, function create and deploy no longer check that the image exists. A wrong image path or tag fails at deployment, with
ErrImagePullon the function pod. - The settings apply to container functions and container tasks. Helm functions and Helm tasks do not support this setup.
Turn off the checks
-
Add this override to the values of the
apirelease. Replace<key>with the key for your image hostname:Keep only the check that you want to turn off:
In a Helmfile deployment, add the override to your environment file,
environments/<environment-name>.yaml. Withhelm upgrade, pass it in a values file with-f. -
Apply the values with the
helmfileorhelm upgradecommand that you use for the control plane. -
Confirm that the NVCF API configuration has the settings:
The output shows
enabled: falseunder each check that you turned off.
For container tasks, set artifact-validation for the NVCT API under nvctApi.remoteConfig.configData.nvct.registries.recognized.container.<key>.
ECR example with the EKS node IAM role
This example shows one way to pull from ECR without long-lived IAM user keys. The kubelet on each EKS GPU node pulls the image with the node IAM role. NVCF stores no ECR credential, so it sends no image pull secret for ECR. If you give the cluster access to ECR in another way, replace step 1 with your own setup. Steps 2 to 6 stay the same.
-
On the GPU nodes that run function pods, give the node IAM role read access to your ECR repositories. The AWS managed policy
AmazonEC2ContainerRegistryReadOnlygrants this access. For least privilege, attach the private ECR policy from Step 2: Create and Attach ECR Policy instead. If the repositories are in another AWS account, also add a repository policy in that account that allows the node IAM role to pull images. -
Delete any ECR credential that NVCF stores. If one exists, NVCF sends it to the cluster. Valid keys are then used for the pull, and expired or invalid keys make the deployment fail. Find it with
./nvcf-cli registry-credential list, then delete it as described in Deleting Registry Credentials. -
Leave ECR out of
api.accountBootstrap.registryCredentials. NVCF marks bootstrap credentials asSYSTEM, and you cannot delete them later. -
Turn off artifact validation for the
ecrentry, as described in Turn off the checks. Credential validation does not apply, because you store no ECR credential: -
Create a function with an ECR image. Set the inference and health values for your image:
The command returns a function ID and a version ID.
-
Deploy the function. Set the GPU and instance type for your cluster. The command uses the function ID and version ID from step 5:
The deployment becomes
ACTIVEwhen the GPU node has pulled the image and the function is healthy.
Troubleshoot validation settings
-
If function create returns
Missing CONTAINER registry credential for hostname '<hostname>', artifact validation is still on for the registry entry. Repeat step 3 of Turn off the checks. If the ConfigMap is correct, restart the NVCF API: -
If the function pod shows
ErrImagePullorImagePullBackOff, the cluster cannot pull the image. Runkubectl describe podon the function pod to see the registry error. Then check the image path and tag, and the identity or image pull secret that the cluster uses for the registry.