Infrastructure Registry (FREE)
Introduced in GitLab 14.0.
With the GitLab Infrastructure Registry, you can use GitLab projects as a private registry for infrastructure packages. You can create and publish packages with GitLab CI/CD, which can then be consumed from other private projects.
View packages
To view packages within your project:
- Go to the project.
- Go to Packages and registries > Infrastructure Registry.
You can search, sort, and filter packages on this page.
For information on how to create and upload a package, view the GitLab documentation for your package type:
Use GitLab CI/CD to build packages
To use GitLab CI/CD to build packages, you can
authenticate with the CI_JOB_TOKEN
predefined variable.
CI/CD templates, which you can use to get started, are in this repository.
Learn more about using CI/CD to build:
If you use CI/CD to build a package, you can find extended activity information when you view the package details:
You can see the pipeline that published the package as well as the commit and the user who triggered it. However, the history is limited to five updates per package.
Download a package
To download a package:
- Go to Packages and registries > Infrastructure Registry.
- Select the name of the package you want to download.
- In the Activity section, select the name of the package you want to download.
Delete a package
You cannot edit a package after you publish it in the Infrastructure Registry. Instead, you must delete and recreate it.
To delete a package, you must have suitable permissions.
You can delete packages by using the API or the UI.
To delete a package in the UI, from your project:
- Go to Packages and registries > Infrastructure Registry.
- Find the name of the package you want to delete.
- Select Delete.
The package is permanently deleted.
Disable the Infrastructure Registry
The Infrastructure Registry is automatically enabled.
For self-managed instances, a GitLab administrator can disable Packages and registries, which removes this menu item from the sidebar.
You can also remove the Infrastructure Registry for a specific project:
- In your project, go to Settings > General.
- Expand the Visibility, project features, permissions section and toggle Packages off (in gray).
- Select Save changes.
To enable it back, follow the same steps above and toggle it on (in blue).
How module resolution works
When you upload a new module, GitLab generates a path for the module, for example, https://gitlab.example.com/parent-group/my-infra-package
.
- This path conforms with the Terraform spec.
- The name of the path must be unique within the namespace.
For projects in subgroups, GitLab checks that the module name does not already exist anywhere in the namespace, including all subgroups and the parent group.
For example, if:
- The project is
gitlab.example.com/parent-group/sub-group/my-project
. - The infrastructure package is
my-infra-package
.
The project name must be unique in all projects in all groups under parent-group
.