Architecture Overview
The flow works like this:- You push code to your GitHub application repository
- GitHub Actions builds and pushes a container image to your registry
- GitHub Actions updates the GitOps repo with the new image tag
- Ankra detects the change and triggers a deployment
- Ankra Agent deploys the updated manifest to your cluster
What You’ll Build
A complete CI/CD pipeline with:Prerequisites
- A cluster imported into Ankra with the agent connected
- A container registry (GitHub Container Registry, Google Artifact Registry, AWS ECR, Docker Hub, etc.)
- An application repository on GitHub with a Dockerfile
Step 1: Connect a GitHub Repository
First, connect a GitHub repository to your cluster. This enables GitOps and installs the necessary components on your cluster.Navigate to Integration Settings
Add a GitHub Credential
Select a Repository
Confirm Installation
- ArgoCD - GitOps continuous delivery
- Ankra Stack Builder - Declarative infrastructure management
- Ankra Resource Engine - Intelligent resource orchestration
- GitOps Monitoring - Continuous deployment from your repository
Step 2: Create a Stack for Your Application
In Ankra, manifests are organized into Stacks. A Stack is a collection of related Kubernetes resources that are deployed together.Open the Stacks Page
Create a New Stack
Name Your Stack
backend-services or production-apps.Add a Manifest Using AI
⌘+J (or Ctrl+J) to open the AI Assistant and describe your deployment:Create the Stack
Step 3: Set Up CI Deploy Key
Your GitHub Actions workflow needs write access to the GitOps repository to update image tags when new builds complete.Generate an SSH Key
deploy_key (private) and deploy_key.pub (public).Add Public Key to GitOps Repo
deploy_key.pub and check Allow write access.Add Private Key to App Repo
GITOPS_DEPLOY_KEY with the contents of deploy_key.Step 4: Create the GitHub Actions Workflow
Add a GitHub Actions workflow to your application repository that builds your container and updates the GitOps repo.Create the Workflow File
.github/workflows/deploy.yml.Use the AI to Generate the Workflow
⌘+J) and describe your pipeline:Add Registry Secrets
Example Workflow: GitHub Container Registry
Example Workflow: GitHub Container Registry
Example Workflow: Google Artifact Registry
Example Workflow: Google Artifact Registry
Example Workflow: AWS ECR
Example Workflow: AWS ECR
Step 5: Configure Registry Access in Your Cluster
If your container registry is private, your cluster needs credentials to pull images.Open the AI Assistant
⌘+J to open the AI Assistant.Ask for an Image Pull Secret
Add the Secret Value
- For GHCR: Use a Personal Access Token with
read:packagesscope - For GCP: Use a service account JSON key with
Artifact Registry Readerrole - For AWS ECR: Use an IAM access key
- For Docker Hub: Use your username and access token
Link to Your Deployment
Step 6: Test the Pipeline
Push a Code Change
Monitor CI Progress
Verify GitOps Update
Watch the Deployment
Step 7: Monitor GitOps Sync Status
Ankra provides visibility into your GitOps sync status.View GitOps Status
- Current sync status
- Recent sync history
- Any sync errors
Trigger Manual Sync
View in Operations
Adding More Services
To add CI/CD for additional services, use the AI Assistant to scaffold everything:Add to Existing Stack or Create New
Generate the Deployment Manifest
⌘+J) and describe your service:Generate the CI Workflow
.github/workflows/deploy.yml or ask the AI:Add the Secrets
GITOPS_DEPLOY_KEY, registry credentials) to the new repository.Common AI Prompts
Use these prompts with the AI Assistant (⌘+J) to set up your CI/CD:
Create a Deployment
Create a Deployment
Create a Complete Service Stack
Create a Complete Service Stack
Add Image Pull Secret
Add Image Pull Secret
Generate GitHub Actions Workflow
Generate GitHub Actions Workflow
Add Canary Deployment
Add Canary Deployment
Troubleshoot Deployment
Troubleshoot Deployment
Best Practices
Use GITHUB_TOKEN for GHCR
Use GITHUB_TOKEN for GHCR
GITHUB_TOKEN automatically - no need to create a Personal Access Token for pushing to GHCR. Just add packages: write to your job permissions.Leverage GitHub Actions Cache
Leverage GitHub Actions Cache
cache-from: type=gha and cache-to: type=gha,mode=max with docker/build-push-action to speed up builds using GitHub’s built-in Actions cache.Add Health Checks
Add Health Checks
Set Resource Limits
Set Resource Limits
Use SOPS for Secrets
Use SOPS for Secrets
Use Environment Protection Rules
Use Environment Protection Rules
Troubleshooting
Having issues? Open the AI Assistant (⌘+J) and describe your problem:
Workflow Can't Push to GitOps Repo
Workflow Can't Push to GitOps Repo
- Deploy key doesn’t have write access on the GitOps repo
GITOPS_DEPLOY_KEYsecret is not set or has extra whitespace- The
webfactory/ssh-agentaction is missing from the workflow
Image Not Updating
Image Not Updating
Pods Can't Pull Image
Pods Can't Pull Image
read:packages scope, or make the package public in your repository’s package settings.Workflow Permission Errors
Workflow Permission Errors
permission denied errors when pushing to GHCR, ensure your workflow has the correct permissions:`denied: permission_denied: write_package` on the first build
`denied: permission_denied: write_package` on the first build
GITHUB_TOKEN - it is not an Ankra GitHub App permission. The build succeeds but the image push to ghcr.io/<owner>/<repo> is rejected.Ankra surfaces this for you: open the application’s CI/CD tab. Ankra runs a GHCR publishing readiness check during onboarding and after each run, and turns a failed push into a fix card with the exact remediation. The most common fixes, in order:- Grant the repository write on the package. If a package with that name already exists (created manually or by another repo), open its settings and add this repository with the Write role under Manage Actions access.
- Set the workflow token to read/write. Ankra can do this in one click when its GitHub App has the optional Administration permission; otherwise change Settings → Actions → General → Workflow permissions to Read and write permissions.
- Check the organisation Actions policy. Some organisations cap the
GITHUB_TOKENor restrict Actions from creating packages.
Deployment Rollout Stuck
Deployment Rollout Stuck
GitOps Sync Not Triggering
GitOps Sync Not Triggering
- Verify the GitHub repository is still connected in Settings → Integration
- Check that your commit was pushed to the correct branch
- Look for webhook configuration issues in the GitOps status