Skip to main content
Version: 1.47

Backup and Restore

An Okteto backup holds what you need to recover your instance after an unexpected failure, and to prepare for disaster recovery: the Okteto metadata and, optionally, your users' Namespaces.

Okteto Metadata​

The most important resources to back up to recover an Okteto instance are:

  • Service Accounts: Okteto creates a Kubernetes service account for every user who logs in. Back up all the service accounts in the okteto namespace with the label dev.okteto.com: "true", so your users don't need to recreate their Okteto accounts.
  • Secrets: Kubernetes secrets in the okteto namespace store Okteto variables, tokens, certificates, SSH key pairs, and other secrets. Backing them up saves you from reconfiguring all of them during a recovery.
  • Custom Resources: the custom resources in the okteto namespace for the Okteto CRDs, which have the label app.kubernetes.io/part-of: okteto. Okteto uses CRDs to store your Catalog, container registry credentials, and more.

Okteto recommends backing up these resources every 24 hours.

Recovery Process​

There are two recovery processes:

  • Okteto Metadata recovery process: recovers all the users’ metadata, tokens, variables, secrets, and custom resources mentioned in the section above. It doesn’t recover users’ namespaces, preview environments and volumes.
  • Okteto Metadata and Users' Namespaces recovery process: recovers the Okteto metadata, namespaces, preview environments, and volumes for all users. This is a full and complete recovery of the Okteto instance

Namespaces are ephemeral in Okteto, so Okteto recommends the Okteto Metadata recovery process: your developers recreate their Namespaces as they need them.

Okteto Metadata Recovery Process​

This is the fastest and simplest recovery process. It does not restore users' Namespaces or application data.

  1. Back up the Okteto Metadata in your okteto namespace.
  2. Create a new cluster.
  3. Reinstall the Okteto Helm chart in the new cluster, with the same configuration as your previous Okteto instance.
  4. Restore the Okteto Metadata in the okteto namespace of the new cluster.
  5. The new cluster exposes Okteto through a new load balancer, the one of your ingress controller or your Gateway. Point your DNS records to its address.
  6. Once the restore is complete and you've verified that the new cluster works correctly, delete the old cluster.

Okteto Metadata and Users' Namespaces Recovery Process​

This option takes more time and needs an external tool to back up all your Namespaces:

  1. Back up users' Namespaces with a tool like Velero. All these Namespaces have the label dev.okteto.com: "true".
  2. Back up the Okteto Metadata in your okteto namespace.
  3. Create a new cluster.
  4. Restore users' Namespaces in the new cluster with a tool like Velero, before you reinstall Okteto.
  5. Reinstall the Okteto Helm chart in the new cluster, with the same configuration as your previous Okteto instance.
  6. Restore the Okteto Metadata in the okteto namespace of the new cluster.
  7. The new cluster exposes Okteto through a new load balancer, the one of your ingress controller or your Gateway. Point your DNS records to its address.
  8. Once the restore is complete and you've verified that the new cluster works correctly, delete the old cluster.
note

Private registry configurations aren't restored until you reinstall the Helm chart. Until then, some pods may fail to pull images from the Okteto Registry.