Configure the artifact registry and bucket¶
What you will end up with¶
A registry and a bucket in your own infrastructure, named on an installation, with the rendered Terraform granting your node's runtime and build identities access to them, and a confirmed reading of what the control plane records.
Prerequisites¶
- Cloud credentials that can create a container registry and an object store.
- An organization and a pool, and a prepared installation directory. See Self-hosted deployment.
jq, and the CLI for your cloud.
1. Create the two resources¶
Terraform in the bundle creates identities and grants, not storage. Create both in your own infrastructure first.
export REGION=europe-west2
export GCP_PROJECT=<gcp-project-id>
export REPO=xratu
export BUCKET=<bucket>
gcloud artifacts repositories create ${REPO} \
--repository-format=docker \
--location=${REGION} \
--project=${GCP_PROJECT}
gcloud storage buckets create gs://${BUCKET} \
--location=${REGION} \
--project=${GCP_PROJECT} \
--uniform-bucket-level-access
export REGION=eu-west-1
export AWS_ACCOUNT=<aws-account-id>
export REPO=xratu
export BUCKET=<bucket>
aws ecr create-repository \
--repository-name ${REPO} \
--region ${REGION}
aws s3api create-bucket \
--bucket ${BUCKET} \
--region ${REGION} \
--create-bucket-configuration LocationConstraint=${REGION}
export LOCATION=westeurope
export RESOURCE_GROUP=<resource-group>
export ACR=<acr-name>
export STORAGE_ACCOUNT=<storage-account>
export CONTAINER=<container>
az acr create \
--name ${ACR} \
--resource-group ${RESOURCE_GROUP} \
--location ${LOCATION} \
--sku Standard
az storage account create \
--name ${STORAGE_ACCOUNT} \
--resource-group ${RESOURCE_GROUP} \
--location ${LOCATION}
az storage container create \
--name ${CONTAINER} \
--account-name ${STORAGE_ACCOUNT}
export ARTIFACT_REGISTRY=${ACR}.azurecr.io/xratu
export ARTIFACT_BUCKET=azblob://${STORAGE_ACCOUNT}/${CONTAINER}/xratu
export ARTIFACT_REGISTRY_SCOPE=$(az acr show --name ${ACR} \
--resource-group ${RESOURCE_GROUP} --query id -o tsv)
Azure needs the registry twice: as a path for pushes, and as a resource ID, because role assignments are scoped by resource.
2. Confirm both exist before preparing¶
Preparation does not reach your cloud, so a name that does not exist is accepted at prepare and fails at apply.
3. Prepare the installation with both paths¶
xratu dataplane install prepare ${ORG} ${POOL} ${DP_INSTALL} \
--provider aws \
--dp-count 2 \
--artifact-registry ${ARTIFACT_REGISTRY} \
--artifact-bucket ${ARTIFACT_BUCKET} \
--account-id ${AWS_ACCOUNT} \
--region ${REGION} \
--cluster-oidc-issuer https://oidc.eks.${REGION}.amazonaws.com/id/<cluster-oidc-id> \
--cluster-oidc-provider-arn arn:aws:iam::${AWS_ACCOUNT}:oidc-provider/oidc.eks.${REGION}.amazonaws.com/id/<cluster-oidc-id>
xratu dataplane install prepare ${ORG} ${POOL} ${DP_INSTALL} \
--provider azure \
--dp-count 2 \
--artifact-registry ${ARTIFACT_REGISTRY} \
--artifact-bucket ${ARTIFACT_BUCKET} \
--artifact-registry-scope ${ARTIFACT_REGISTRY_SCOPE} \
--subscription-id <subscription-id> \
--tenant-id <tenant-id> \
--location ${LOCATION} \
--resource-group ${RESOURCE_GROUP} \
--aks-oidc-issuer https://${LOCATION}.oic.prod-aks.azure.com/<aks-oidc-path>/
Expected state. The bundle is written, and the normalised spec carries both paths in canonical form:
A scheme that does not match the provider is refused here rather than at apply:
4. Read the grants before applying¶
The bundle's Terraform is readable, and this is where you confirm what your nodes will be allowed to do:
resource "google_service_account" "runtime" {
resource "google_service_account" "build" {
resource "google_service_account" "publish_delegate" {
resource "google_project_iam_member" "runtime_artifact_registry_writer" {
resource "google_artifact_registry_repository_iam_member" "publish_delegate_repository_writer" {
resource "google_storage_bucket_iam_member" "runtime_bucket_object_admin" {
resource "google_storage_bucket_iam_member" "build_bucket_object_admin" {
resource "google_service_account_iam_member" "runtime_workload_identity" {
resource "google_service_account_iam_member" "build_workload_identity" {
resource "azurerm_user_assigned_identity" "runtime" {
resource "azurerm_user_assigned_identity" "build" {
resource "azurerm_federated_identity_credential" "runtime" {
resource "azurerm_federated_identity_credential" "build" {
resource "azurerm_role_assignment" "runtime_acr_push" {
resource "azurerm_role_assignment" "build_acr_push" {
resource "azurerm_role_assignment" "runtime_bucket_blob_data_contributor" {
resource "azurerm_role_assignment" "build_bucket_blob_data_contributor" {
Exit gate. No resource in the list creates a repository or a bucket. If one
does, it was added by hand and the next prepare will regenerate the file
without it, leaving Terraform holding state for an object its configuration no
longer declares.
5. Apply and verify the identities can reach both¶
A node that enrolled has pulled its runtime image from the registry, which is the registry grant proven end to end. The bucket grant is exercised the first time a run produces an observability body or a build publishes an artifact.
6. Verify the boundary holds¶
The control plane should hold references, never credentials or bytes.
curl -fsS -H "Authorization: Bearer $(xratu config view | jq -r '.token')" \
"${CP_CLI_ENDPOINT}/v1/builds/<build_id>" | jq '{image_digest, artifact_digest}'
Digests, not locations with credentials attached. An artifact operation that never reported a digest leaves the control plane with nothing to pin, and it refuses rather than inferring one:
When it fails¶
| Symptom | Cause | Fix |
|---|---|---|
artifact_registry.path must be a full registry root path |
A host with no repository root | Append the repository root |
artifact_bucket.path must be a supported full bucket path |
Missing scheme, bucket or container | Use gcs://, s3:// or azblob:// with the full shape |
artifact_bucket.path scheme must match provider |
Bucket scheme and --provider disagree |
Correct one of the two |
| Apply fails granting on the bucket | The bucket does not exist | Create it, then re-run apply |
| Node starts but cannot pull its image | Registry grant not applied, or the wrong registry root | Check the runtime identity's grant and runtime.image in the spec |
bucket provider must match infra identity provider |
The bucket is on a different cloud from the node | Use a bucket on the node's own cloud |
| Azure role assignment fails | artifact_registry_scope missing or wrong |
Set it to the registry's resource ID |
What changed¶
A registry and a bucket exist and are named on the installation. The node's runtime and build identities hold scoped grants to them through the cluster's workload identity federation, and the control plane records them as the installation's destinations. See The tenant byte boundary.