EnterpriseBeta
Preview Environments in CI
How to automate preview environments in your CI pipeline with PR-based keys and header propagation
Flow Overview
Cluster Access for CI
1. Create a ServiceAccount, bind the role, mint a token
# The identity CI authenticates as.
apiVersion: v1
kind: ServiceAccount
metadata:
name: preview-ci
namespace: staging
---
# Grants that identity the operator chart's CI role.
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: preview-ci-mirrord
subjects:
- kind: ServiceAccount
name: preview-ci
namespace: staging
roleRef:
kind: ClusterRole
name: mirrord-operator-ci
apiGroup: rbac.authorization.k8s.io
---
# A long-lived token for the ServiceAccount, consumed in step 2.
apiVersion: v1
kind: Secret
metadata:
name: preview-ci-token
namespace: staging
annotations:
kubernetes.io/service-account.name: preview-ci
type: kubernetes.io/service-account-token2. Build a kubeconfig from the token
3. Store it as a CI secret
Choosing the Preview Key
Automating the PR Comment
Field
Example
Header Propagation for Backend Testing
1. Configure the Header Filter in mirrord
2. Propagate the Header in Your Application
Registry Authentication
mirrord Configuration
CI Workflow Best Practices
Troubleshooting
Symptom
Cause and fix
Last updated
Was this helpful?

