Connect a Kubernetes cluster running Velero to the backup profile
- graal Agentic Platform
- Version 0.30 (actuelle)
- Open source · Apache 2.0
- Source : graalsystems/tranibor-agents@983db67
For an organisation administrator. Procedure connector.mcp.backup-velero, version 1, reviewed 2026-11-25 against the vendor’s own pages. It applies to the connector type mcp/backup-velero.
It ships with the plugin backup-velero 0.1.0: its source. In the console, once the plugin is installed, it opens with How to set this up on the connector of the plugin’s server, and on Library › Plugins.
Addresses are written <api_url>, <public_url> and <org> here: the console shows the same text with your deployment’s own.
Before you start
Section intitulée « Before you start »- A cluster where Velero runs, with at least one Schedule, and someone who can create a service account, a role and an admission policy on it.
- The
backupandbackup-veleroplugins installed in your organisation (Catalogue, Plugins). The server runs in the platform; there is nothing to host. A plugin that brings a server needs a second person’s approval. - The API server must be reachable from the platform, and you must allow its host (and the bucket’s, if you configure one) as the connector’s egress. A cluster API on a private address cannot be reached today: it needs ADR 0224 section 6 (private CIDRs or an outpost), which is not available yet. See the plugin’s README, “Reaching the system”. Do not expose the API server to the internet to get around it.
- Decide the restore prefix, for instance
restore-test-. Every namespace the connector may create or delete starts with it. Pick one no real namespace uses. - This procedure is written from the Velero, Kubernetes and Amazon S3 documentation above and the plugin’s
fake cluster. It has not been run against a live cluster or bucket. Not confirmed in the
documentation, so read defensively by the server and to check on first run: the Restore’s
status.progressfields, a BackupStorageLocation’sstatus.phaseandstatus.lastValidationTime, thevelero.io/schedule-nameandvelero.io/backup-namelabels, the phasesFinalizingandWaitingForPluginOperations, and above all that a Backup created from a Schedule’s template bytrigger_backupis handled by Velero like the one its schedule would have made (it replicatesvelero backup create --from-schedule; only the CLI’s behaviour was relied on).
What the connector does, and where the guard is
Section intitulée « What the connector does, and where the guard is »It reads the velero.io/v1 resources (Schedule, Backup, Restore, BackupStorageLocation) in Velero’s
namespace, and it may list the bucket. It writes in three ways only: it creates a Backup from a Schedule’s own template
(trigger_backup), it creates a Restore that restores one namespace of a backup into a new namespace
(run_restore_test, always after a person’s approval), and it deletes a namespace it created
(cleanup_restore_test).
The prefix is enforced by the connector’s server, not by Kubernetes. Kubernetes RBAC cannot grant “create
namespaces whose name starts with restore-test-”: a rule can name resources, verbs and exact
resourceNames, but it cannot match a name by prefix. So the service account below necessarily holds the
right to create and delete namespaces, and the server is what refuses everything else. It checks, before any
write, that the target namespace:
- starts with the configured prefix;
- is not a reserved namespace (
default,kube-system,kube-public,kube-node-lease, the Velero namespace); - for a delete, carries the label
tranibor.io/test-restore=truethat the server put on it when it created it, so a namespace that happens to share the prefix is never deleted.
That is a control in the connector, so a second one in the cluster is worth having: an admission policy (below) that applies the same rule to this service account, whatever the server does.
At Kubernetes
Section intitulée « At Kubernetes »- Create the service account in a namespace of your choice, for instance
tranibor-system:kubectl create serviceaccount tranibor-backup-velero -n tranibor-system.
Permissions
Section intitulée « Permissions »-
Read access in Velero’s namespace (a Role bound there):
apiVersion: rbac.authorization.k8s.io/v1kind: Rolemetadata: {name: tranibor-backup-velero, namespace: velero}rules:- apiGroups: ["velero.io"]resources: ["schedules", "backups", "restores", "backupstoragelocations", "volumesnapshotlocations", "podvolumebackups"]verbs: ["get", "list"]# The two writes in this namespace: a Restore (run_restore_test) and a Backup (trigger_backup).- apiGroups: ["velero.io"]resources: ["restores", "backups"]verbs: ["create"] -
Namespace access, cluster-wide (a ClusterRole, because namespaces are cluster-scoped). It needs
createanddeleteonnamespacesand cannot be narrowed by name prefix; this is why step 5 matters:apiVersion: rbac.authorization.k8s.io/v1kind: ClusterRolemetadata: {name: tranibor-backup-velero-namespaces}rules:- apiGroups: [""]resources: ["namespaces"]verbs: ["get", "list", "create", "delete"]Bind both to the service account (a RoleBinding in
velero, a ClusterRoleBinding for the ClusterRole). -
Create a token. For a quick test,
kubectl create token tranibor-backup-velero -n tranibor-system --duration=24h. For production, a time-bound token expires: use a long-lived token Secret of typekubernetes.io/service-account-token(see the service-accounts page above), keep it in your secret manager, and rotate it. Hand it to the platform administrator through the secret manager, never by mail or chat. -
Restrict the account to the prefix with an admission policy. Kubernetes can express it as a ValidatingAdmissionPolicy (Kubernetes 1.30 and later,
admissionregistration.k8s.io/v1):apiVersion: admissionregistration.k8s.io/v1kind: ValidatingAdmissionPolicymetadata: {name: backup-velero-namespace-prefix}spec:failurePolicy: FailmatchConstraints:resourceRules:- apiGroups: [""]apiVersions: ["v1"]operations: ["CREATE", "DELETE"]resources: ["namespaces"]validations:- expression: >-request.userInfo.username != "system:serviceaccount:tranibor-system:tranibor-backup-velero"|| (request.operation == "DELETE" ? oldObject.metadata.name : object.metadata.name).startsWith("restore-test-")message: "the backup-velero server may only create or delete namespaces named restore-test-*"---apiVersion: admissionregistration.k8s.io/v1kind: ValidatingAdmissionPolicyBindingmetadata: {name: backup-velero-namespace-prefix}spec:policyName: backup-velero-namespace-prefixvalidationActions: ["Deny"]The same, as a Kyverno policy:
apiVersion: kyverno.io/v1kind: ClusterPolicymetadata: {name: backup-velero-namespace-prefix}spec:validationFailureAction: Enforcerules:- name: only-prefixed-namespacesmatch:any:- resources: {kinds: ["Namespace"], operations: ["CREATE", "DELETE"]}subjects: [{kind: ServiceAccount, name: tranibor-backup-velero, namespace: tranibor-system}]validate:message: "the backup-velero server may only create or delete namespaces named restore-test-*"deny:conditions:all:- key: "{{ request.object.metadata.name || request.oldObject.metadata.name }}"operator: NotEqualsvalue: "restore-test-*"Both snippets are examples written from the documentation above and not run on a cluster: test them on a scratch cluster, and adapt the account name and the prefix to your own.
-
Restoring needs Velero’s own rights, not this account’s: Velero (with its own service account) creates the objects in the target namespace.
At the bucket (optional)
Section intitulée « At the bucket (optional) »The bucket listing is an extra check: it shows whether the newest backup’s objects are in the bucket, which the cluster’s resources alone do not prove. Create a read-only identity on the backup bucket (list and get on that bucket only, no write, no delete), and give its access key and secret key to the platform administrator through your secret manager. The server signs a path-style ListObjectsV2 with Signature Version 4. It was checked against the AWS signing test vector, not against a live bucket.
In Tranibor
Section intitulée « In Tranibor »- Catalogue, Plugins, install
backupandbackup-velero(a second person approves the server). - Organisation, Connectors, configure the
backup-veleroconnector with the fields above. The token and the bucket keys are secrets: type them once. - Add the project’s
schedulesentry from the template’s README, and a group namedplatform-owner. - Approval.
run_restore_testalways waits for a person (the profile’s floor, never lowered).trigger_backupis governed by default; an administrator may let it run automatically.
- Run the template once by hand with
scheduleset to one schedule. The report should name that schedule, its backups and the storage location. - Approve the restore. Look in the cluster for a namespace
<prefix><schedule namespace>-<date>labelledtranibor.io/test-restore=true, and check it is deleted at the end of the run. - Try, by hand, to create a namespace named outside the prefix with the service account’s token: the admission policy must refuse it.
- If you want proof the bucket path works, give an object listing a prefix you know holds a backup.
When it fails
Section intitulée « When it fails »| Symptom | Likely cause |
|---|---|
401 or 403 from the API server |
the token expired or the Role/ClusterRole is not bound; check kubectl auth can-i --as=system:serviceaccount:tranibor-system:tranibor-backup-velero list backups.velero.io -n velero |
Every schedule Red, location Unavailable |
Velero cannot reach the bucket: read the location’s message in the report |
| A restore never finishes | Velero itself is unhealthy or the cluster lacks capacity: look at the Velero pod’s log |
refused: ... outside the allow-list |
working as intended; the target did not start with the configured prefix |
trigger_backup answers but no backup ever completes |
the Backup was created and Velero did not pick it up: not confirmed against a live cluster, read the Velero pod’s log |
| Test namespaces left behind | a run stopped before cleanup; delete those labelled tranibor.io/test-restore=true |
| Field | What to put in it |
|---|---|
kube_api_url |
https://kubernetes.example.com:6443, the API server, without a trailing slash |
kube_ca_cert |
the cluster’s CA certificate (PEM); leave empty when the API server’s certificate chains to a public CA |
kube_token |
the bearer token of the service account created below, typed once |
restore_namespace_prefix |
the prefix every test namespace must start with, for instance restore-test- (a dash at the end, 5 to 30 characters) |
s3_access_key |
optional: the access key of a read-only identity on the bucket, typed once |
s3_bucket |
optional: the bucket’s name |
s3_endpoint |
optional: the backup bucket’s S3-compatible endpoint, https://s3.example.com, path-style |
s3_prefix |
optional: the prefix Velero writes under, with a trailing slash (default empty) |
s3_region |
optional: the bucket’s region (default us-east-1) |
s3_secret_key |
optional: its secret key, typed once |
velero_namespace |
the namespace Velero runs in (default velero) |
Network egress
Section intitulée « Network egress »Hosts the platform must be allowed to reach:
<the Kubernetes API server host><the S3 endpoint host, when a bucket is configured>
Vendor documentation
Section intitulée « Vendor documentation »- Velero: how Velero works
- Velero: restore reference
- Velero: backup reference
- Velero: API types (Backup, Restore, Schedule, BackupStorageLocation)
- Kubernetes: using RBAC authorization
- Kubernetes: managing service accounts (long-lived and bound tokens)
- Kubernetes: validating admission policy
- Kubernetes API concepts: chunking with limit and continue
- Kyverno: validate rules
- Amazon S3: ListObjectsV2
- Amazon S3: authenticating requests (Signature Version 4)