You can add a local image registry to Tanzu Mission Control using the command line interface. It can be added in three different ways: (1) credentials in the command line arguments, (2) credentials with Docker config file, and (3) encoded credentials in dockerconfigjson format
Prerequisites
Make sure you have the appropriate permissions to add local image registries.
- To add local image registries you must be associated with the Tanzu Mission Control role cluster.admin role.
Note: You can use the TMC CLI commands as shown below, or you can use the Tanzu CLI command
tanzu mission-control account credential create --input-template image-registry --data-values-file <data_file>
.
Procedure
- Use the following command to create the local image registry with credentials:
tmc account credential create --template image-registry --access-id demouser
--access-secret demopassword --name test-registry --registry-url myregistry.io
--registry-namespace test-ns
- Use the following command to create the local image registry with credentials and CA cert:
tmc account credential create --template image-registry --access-id demouser
--access-secret demopassword --name test-registry --registry-url myregistry.io
--registry-namespace testns --ca-cert="$(cat /tmp/ca.crt)"
- Use the following command to create the local image registry with the credentials in dockerconfigjson format:
tmc account credential create --template image-registry --name test-registry
--registry-url myregistry.io --registry-namespace testns --dockerconfig-file
dockerconfig.json
The dockerconfig.json
can contain values like below:
{
"auths": {
"myregistry.io": {
"auth": "ZGVtb3VzZXI6ZGVtb3Bhc3N3b3Jk",
"password": "demopassword",
"username": "demouser"
}
}
}
- Use the following command to create the unauthenticated local image registry:
tmc account credential create --template image-registry --name test-registry
--registry-url myregistry.io --registry-namespace testns
- Use the following command to list image-registry credentials:
tmc account credential list --capability IMAGE_REGISTRY
- Use the following to get specific image-registry credentials:
tmc account credential get test-registry