Upgrade and roll back Zeabur Identity
Back up and record your current deployment, review version differences, upgrade Zeabur Identity, and use data compatibility to decide whether to roll back to an older version or restore a backup.
Back up and record your current deployment, then review version differences, apply the new configuration, and verify sign-in and permissions. If you need to roll back, use data compatibility to decide whether to switch to the old image or restore the pre-upgrade backup.
Upgrade risks
Section titled “Upgrade risks”Resource versions are still v1alpha1, and there's no conversion mechanism between versions. A newer version can change how it stores data, as the upgrade notes below list, so don't assume that switching versions in either direction will succeed. Record the full commit and image that's actually running. Don't record only a reusable tag such as zeabur-identity:dev.
kubectl rollout undo only restores the Pod template. It doesn't restore CRDs, users, signing keys, Secrets, RBAC, Services, Ingresses, or kube-apiserver files. After a newer version of Zeabur Identity writes data, there's no guarantee that an older version can read it.
Zeabur Identity runs a single replica. Updates replace that replica rather than perform a rolling update. An upgrade briefly interrupts service, and users who are signing in at that time must sign in again. Don't add replicas to hide the interruption.
Upgrade notes
Section titled “Upgrade notes”Each version below lists what you must do before you upgrade to it. If you skip versions, read every section from the version you run now to the version you're moving to. The newest version is at the top.
v0.3.0 → v0.4.0
Section titled “v0.3.0 → v0.4.0”v0.4.0 adds passwords for regular accounts and admin accounts, and replaces the admin-aal3 setting with admin-sign-in.
1. Choose how admins sign in
Section titled “1. Choose how admins sign in”v0.4.0 no longer reads admin-aal3. Its default, two-factor, lets admins sign in with any passkey, or with a password and a code from an authenticator app. If the first command below prints true, keep the device-bound restriction with the second command. To keep admins on any passkey but no password, use admin-sign-in=passkey instead. The second command replaces the ConfigMap's data, so add --from-literal=teams=multiple if you set teams:
kubectl -n "$NS" get configmap zeabur-identity-settings -o jsonpath='{.data.admin-aal3}{"\n"}' --ignore-not-foundkubectl -n "$NS" create configmap zeabur-identity-settings --from-literal=admin-sign-in=device-bound-passkey \ --dry-run=client -o yaml | kubectl apply -f -See Choose how admins sign in.
2. Create the password key before the new Deployment
Section titled “2. Create the password key before the new Deployment”v0.4.0 keeps the key it mixes into password hashes in the Secret zeabur-identity-password-key. Installing Zeabur Identity creates it empty and Zeabur Identity fills it at startup, but Zeabur Identity can't create the Secret itself and doesn't start without it. The upgrade files below leave out Secrets, so create this one in the Review and apply the manifests step, before the new Deployment. The command does nothing when the Secret already exists:
kubectl -n "$NS" get secret zeabur-identity-password-key || jq '.items[] | select(.kind == "Secret" and .metadata.name == "zeabur-identity-password-key")' \ upgrade-record/manifests.next.json | kubectl create -f -Back it up with the signing keys. See Back up and restore.
Roll back to v0.3.0
Section titled “Roll back to v0.3.0”v0.3.0 has no passwords. Restore the pre-upgrade backup. Passwords and authenticator apps set after the upgrade are lost, and users who signed up with only a password need a new setup link.
v0.2.0 → v0.3.0
Section titled “v0.2.0 → v0.3.0”v0.3.0 changes the form of UpstreamProvider and Credential. Stored credentials keep working as they are. Stored providers don't: the server doesn't start while a provider in the v0.2.0 form is stored, so write each one again in the new form.
1. Check the Secret's keys
Section titled “1. Check the Secret's keys”v0.3.0 reads each provider's client secret from the key with the provider's name in the Secret zeabur-identity-upstream. clientSecretKey is gone. If a provider's clientSecretKey differs from its name, add the secret under the name as well:
kubectl -n "$NS" get upstreamproviders.identity.zeabur.com \ -o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.spec.clientSecretKey}{"\n"}{end}'2. Save the providers and v0.2.0's CRDs
Section titled “2. Save the providers and v0.2.0's CRDs”Do this before you apply the new CRDs. After that, the API server drops the fields v0.3.0 doesn't have, and the old values can't be read.
kubectl -n "$NS" get upstreamproviders.identity.zeabur.com -o json \ | jq '.items |= map({apiVersion, kind, metadata: (.metadata | {name, namespace, labels}), spec})' \ > upgrade-record/upstreamproviders.before.jsonjq '.items |= map(.spec |= ({clientId} + if .type == "GitHub" then {github: {}} else {openid: ({issuer, displayName} + if .scopes then {scopes} else {} end)} end))' \ upgrade-record/upstreamproviders.before.json > upgrade-record/upstreamproviders.next.json/path/to/old/zeabur-identityctl crds > upgrade-record/crds.before.jsonRead upstreamproviders.next.json, then apply it right after the new CRDs in the Review and apply the manifests step, before the new Deployment:
kubectl apply --server-side -f upgrade-record/crds.next.jsonkubectl apply -f upgrade-record/upstreamproviders.next.jsonCredentials
Section titled “Credentials”Nothing to do. A Credential is a passkey when it has passkey and a linked account when it has external. The type and provider fields that v0.1 and v0.2.0 wrote are ignored. A Credential manifest of your own that sets type or provider fails kubectl apply until you remove them.
Roll back to v0.2.0
Section titled “Roll back to v0.2.0”v0.2.0 can't read a Credential or a provider without type. Restore the pre-upgrade backup, or export the credentials, delete them, apply v0.2.0's CRDs and create them again with their v0.2.0 type. Do this with Zeabur Identity stopped. Each linked account gets the provider with the same issuer in upstreamproviders.before.json. If no provider there has an account's issuer, the account can't be written in the v0.2.0 form and is deleted. First export the credentials:
kubectl -n "$NS" get credentials.identity.zeabur.com -o json \ | jq --slurpfile p upgrade-record/upstreamproviders.before.json ' ($p[0].items | map({key: (if .spec.type == "GitHub" then "https://github.com" else .spec.issuer end), value: .metadata.name}) | from_entries) as $provider | .items |= map( {apiVersion, kind, metadata: (.metadata | {name, namespace, labels, ownerReferences}), spec} | if .spec.passkey then .spec.type = "Passkey" else .spec.type = "Upstream" | .spec.provider = $provider[.spec.external.issuer] end | select(.spec.type == "Passkey" or .spec.provider != null))' \ > upgrade-record/credentials.v0.2.0.jsonRead credentials.v0.2.0.json and check what it leaves out, then delete and recreate:
kubectl -n "$NS" delete credentials.identity.zeabur.com --allkubectl -n "$NS" delete upstreamproviders.identity.zeabur.com --allkubectl apply --server-side -f upgrade-record/crds.before.jsonkubectl create -f upgrade-record/credentials.v0.2.0.jsonkubectl create -f upgrade-record/upstreamproviders.before.jsonkubectl create doesn't restore status, so passkeys lose the names users gave them after enrollment and their last sign-in time. Providers added or changed after the upgrade are gone too; add them again in the v0.2.0 form. Then switch back to the v0.2.0 image and manifests.
v0.1 → v0.2
Section titled “v0.1 → v0.2”Upgrade from v0.1 straight to v0.3.0 or later, and skip the v0.2.0 section above. v0.2 sets up GitHub and Google sign-in with UpstreamProvider objects instead of server options and removes several server options. Passkeys and linked accounts keep working without a migration.
1. Remove the options v0.2 doesn't have
Section titled “1. Remove the options v0.2 doesn't have”Leave these options and their ZEABUR_IDENTITY_* variables out of every --serve-arg when you generate the upgrade files, and delete any you added to the Deployment's args or env yourself. An option that is still set stops the server with an unknown-argument error:
--github-client-id,--github-client-secret-file,--google-client-id,--google-client-secret-file: replaced byUpstreamProviderobjects (step 3).--store: the server always keeps its state in Kubernetes objects.--upstream-ca-file: the image's CA bundle already trusts GitHub and Google. If your cluster reaches them through a proxy that re-signs TLS with its own CA, mount that CA into a directory and set bothSSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crtandSSL_CERT_DIR=<that directory>on the Deployment.--key-rotation-period,--key-publish-ahead,--key-retain-after,--metadata-max-age,--key-secret: the server always uses the former defaults.--worker-threads: the server starts one worker thread per CPU.
2. Allow Google's discovery address
Section titled “2. Allow Google's discovery address”If you use Google sign-in and your cluster limits outgoing traffic, also allow HTTPS to accounts.google.com. Zeabur Identity now reads Google's endpoints from https://accounts.google.com/.well-known/openid-configuration before each sign-in.
3. Create the sign-in providers before the new Deployment
Section titled “3. Create the sign-in providers before the new Deployment”If you use GitHub or Google sign-in, do this after you apply the new CRDs and before you apply the new manifests in the Review and apply the manifests step. Otherwise the Continue with GitHub and Continue with Google buttons disappear until you do.
Store each client secret in the Secret zeabur-identity-upstream, under the provider's name, github or google. Use the same client secrets as v0.1. Leave out a provider you don't use:
read -rs GITHUB_SECRET # paste the GitHub client secret, then Enterread -rs GOOGLE_SECRET # paste the Google client secret, then Enterkubectl -n "$NS" create secret generic zeabur-identity-upstream \ --from-file=github=<(printf %s "$GITHUB_SECRET") \ --from-file=google=<(printf %s "$GOOGLE_SECRET")unset GITHUB_SECRET GOOGLE_SECRETThen create one UpstreamProvider for each, with the client IDs you passed to --github-client-id and --google-client-id. Keep the names github and google: they are part of the callback URLs registered at GitHub and Google, so those stay the same.
GITHUB_CLIENT_ID=Ov23li... # not a secretGOOGLE_CLIENT_ID=1234-abc.apps.googleusercontent.comkubectl apply -f - <<EOFapiVersion: identity.zeabur.com/v1alpha1kind: UpstreamProvidermetadata: {name: github, namespace: $NS}spec: {clientId: $GITHUB_CLIENT_ID, github: {}}---apiVersion: identity.zeabur.com/v1alpha1kind: UpstreamProvidermetadata: {name: google, namespace: $NS}spec: clientId: $GOOGLE_CLIENT_ID openid: {issuer: https://accounts.google.com, displayName: Google}EOF4. Keep v0.1's CRDs for a rollback
Section titled “4. Keep v0.1's CRDs for a rollback”Save v0.1's CRDs with the old zeabur-identityctl next to your upgrade record. A rollback needs them, see below.
/path/to/old/zeabur-identityctl crds > upgrade-record/crds.before.jsonLinked accounts
Section titled “Linked accounts”Nothing to do. Each linked GitHub or Google account, a Credential with type: GitHub or type: Google, signs in through the provider with its issuer: github for https://github.com, google for https://accounts.google.com. v0.3.0 doesn't change these objects.
Roll back to v0.1
Section titled “Roll back to v0.1”v0.1 can't read a Credential without type, and v0.3.0 writes credentials without it. Restore the pre-upgrade backup, as described under Roll back below, or export the credentials, delete them, apply the v0.1 CRDs and create them again with their v0.1 type. Do this with Zeabur Identity stopped. Accounts linked through a provider other than GitHub or Google have no v0.1 form, so they're deleted. First export the credentials:
kubectl -n "$NS" get credentials.identity.zeabur.com -o json | jq '.items |= map( {apiVersion, kind, metadata: (.metadata | {name, namespace, labels, ownerReferences}), spec: (.spec | del(.provider) | .type = (if .passkey then "Passkey" else {"https://github.com": "GitHub", "https://accounts.google.com": "Google"}[.external.issuer] end))} | select(.spec.type != null))' > upgrade-record/credentials.v0.1.jsonRead credentials.v0.1.json and check what it leaves out, then delete and recreate:
kubectl -n "$NS" delete credentials.identity.zeabur.com --allkubectl apply --server-side -f upgrade-record/crds.before.jsonkubectl create -f upgrade-record/credentials.v0.1.jsonkubectl create doesn't restore status, so passkeys lose the names users gave them after enrollment and their last sign-in time. Then switch back to the v0.1 image and manifests, with the options from step 1.
Before upgrading
Section titled “Before upgrading”Verify emergency access and create a backup
Section titled “Verify emergency access and create a backup”Confirm that access without Zeabur Identity works, then follow Backup and restore to create a full backup.
Record the backup time. If you restore this backup, you'll lose all data created after that time.
Record the current deployment
Section titled “Record the current deployment”Record the source commit, the zeabur-identityctl version, and every option you used during installation, including the Issuer, Namespace, image, each --serve-arg, --config-secret, and all overlays. Keep a usable copy of the old image on every node.
Run the following commands to save the current deployment information. Keep these files confidential.
umask 077NS=zeabur-identitymkdir -m 0700 upgrade-recordkubectl -n "$NS" get deployment zeabur-identity -o yaml > upgrade-record/deployment.before.yamlkubectl -n "$NS" get pods -l app.kubernetes.io/name=zeabur-identity \ -o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{range .status.containerStatuses[*]}{.name}{"\t"}{.image}{"\t"}{.imageID}{"\n"}{end}{end}' \ > upgrade-record/image-identities.before.txtkubectl -n "$NS" rollout history deployment/zeabur-identity > upgrade-record/rollout-history.before.txtThese files are deployment records, not backups.
Prepare the new image
Section titled “Prepare the new image”Use a digest or a non-reusable tag that points to a known commit. Load the image onto every node that can run Zeabur Identity.
Prepare the new manifests
Section titled “Prepare the new manifests”Use the new version of zeabur-identityctl with your original installation options to generate the new manifests into a file, then compare them with the current deployment. Don't pipe manifests generated with the new defaults directly into the cluster.
Review version differences and test the upgrade
Section titled “Review version differences and test the upgrade”Do what Upgrade notes above lists for each version you pass. Then read the release notes between the two versions, including the CRD schema, storage format, options, and token claims.
Test the exact upgrade procedure on a restored copy first. Also test signing in with an existing passkey.
Choose a rollback method
Section titled “Choose a rollback method”If you can't confirm that the old version can read the new data, restore the previous backup and accept the loss of data created after the backup.
If the data requires migration and no migration method exists, don't upgrade.
Upgrade
Section titled “Upgrade”Generate the upgrade files
Section titled “Generate the upgrade files”Replace the first four lines with your settings. The following manifests command matches the one in Install and sign in on k3s and enables invitations. Add every option you used during installation. If you didn't enable invitations in the original installation, remove --serve-arg=--invitations.
NS=zeabur-identityNEXT_ZEABUR_IDENTITYCTL=/path/to/new/zeabur-identityctlNEXT_IMAGE=registry.example.test/zeabur-identity@sha256:... # the new image, by digestZEABUR_IDENTITY_ISSUER=https://identity.example.test"$NEXT_ZEABUR_IDENTITYCTL" crds > upgrade-record/crds.next.json"$NEXT_ZEABUR_IDENTITYCTL" manifests --issuer "$ZEABUR_IDENTITY_ISSUER" --namespace "$NS" --image "$NEXT_IMAGE" \ --serve-arg=--invitations > upgrade-record/manifests.next.json# Leave out the empty Secrets: they're only for new installs.jq '.items |= map(select(.kind != "Secret"))' upgrade-record/manifests.next.json \ > upgrade-record/manifests.upgrade.jsonReview and apply the manifests
Section titled “Review and apply the manifests”Read upgrade-record/crds.next.json and upgrade-record/manifests.upgrade.json before applying them.
If a conflict occurs when you apply the manifests, find the cause first. Don't add --force-conflicts. Don't delete and recreate a CRD to resolve an error. That deletes every object of that type.
kubectl apply --server-side -f upgrade-record/crds.next.jsonkubectl apply --server-side -f upgrade-record/manifests.upgrade.jsonkubectl -n "$NS" rollout status deployment/zeabur-identity --timeout=5mkubectl -n "$NS" logs deployment/zeabur-identity --tail=200Keep the zeabur-identity Service, zeabur-identity-internal-ca, zeabur-identity-signing-keys, and zeabur-identity-password-key. Don't replace them. A new password key makes every password and authenticator app stop working. A new Service isn't guaranteed to retain the original IP, and every kube-apiserver's authentication file uses the old IP as a fixed value.
Don't replace the root CA, change the Issuer, or delete sessions during an upgrade. If the new version requires different kube-apiserver settings, treat that as a separate change and handle one machine at a time.
Verify the upgrade
Section titled “Verify the upgrade”Check the image that's actually running, readiness, and logs, then complete these checks:
- Sign in again with an existing passkey.
- Attempt one operation you have permission to perform and one you don't.
- Confirm that admin access works.
Sign-in can still fail after the Pod is ready, so complete every check above.
Roll back
Section titled “Roll back”Stop writes if the data state is uncertain
Section titled “Stop writes if the data state is uncertain”If you can't confirm what data the new version has written, stop Zeabur Identity first to prevent further writes:
kubectl -n zeabur-identity scale deployment/zeabur-identity --replicas=0Choose a rollback method based on data compatibility
Section titled “Choose a rollback method based on data compatibility”The old version can read the current data
Section titled “The old version can read the current data”Switch to the old image only after you confirm that the old version can read the current data.
If only the image changed, run:
kubectl -n zeabur-identity set image deployment/zeabur-identity zeabur-identity="$PREVIOUS_IMAGE"If the Pod template has other changes, inspect the revision history first:
kubectl rollout history deployment/zeabur-identity --revision=NThen roll back to the specified revision:
kubectl rollout undo deployment/zeabur-identity --to-revision=NManually revert the other changes, then restore the replica count.
You can't confirm that the old version can read the current data
Section titled “You can't confirm that the old version can read the current data”Follow the restore procedure in Backup and restore to restore the pre-upgrade backup, along with the old image, manifests, CRDs, and Secrets. Keep Zeabur Identity stopped throughout the restore.
You'll lose all changes made after the backup, including new passkeys and passwords, group changes, client updates, and key rotations.
Don't install an empty signing-key Secret, delete certificates, or issue new setup links to get the old version running.
Verify the rollback and record data loss
Section titled “Verify the rollback and record data loss”Check the image, readiness, and logs, then sign in again. Confirm that regular access, admin access, and emergency access all work.
Record what you restored and what data you lost.