Automate deployments by connecting your application repos to Ankra GitOps
This guide shows you how to build a CI/CD pipeline that automatically deploys your applications to Kubernetes when you push code. Your CI builds container images and updates the GitOps repository. Ankra handles the rest.
First, connect a GitHub repository to your cluster. This enables GitOps and installs the necessary components on your cluster.
1
Navigate to Integration Settings
Go to your cluster → Settings → Integration tab.
2
Add a GitHub Credential
If you haven’t connected GitHub yet, you’ll see a prompt to connect a repository.Select an existing GitHub credential from the dropdown, or click to add a new one. This authorizes Ankra to access your repositories.
3
Select a Repository
Choose the repository that will store your GitOps configuration. This can be an existing repo or a new one.
We recommend creating a dedicated repository (e.g., infrastructure-gitops) to keep your cluster configurations separate from application code.
4
Confirm Installation
When you connect for the first time, Ankra will install:
In Ankra, manifests are organized into Stacks. A Stack is a collection of related Kubernetes resources that are deployed together.
1
Open the Stacks Page
Navigate to your cluster → Stacks.
2
Create a New Stack
Click Create to open the Stack Builder.
3
Name Your Stack
Give your stack a descriptive name, like backend-services or production-apps.
4
Add a Manifest Using AI
Press ⌘+J (or Ctrl+J) to open the AI Assistant and describe your deployment:
Copy
Create a deployment manifest for my backend service:- Image: europe-west1-docker.pkg.dev/my-project/docker-images/backend:latest- Namespace: production- 2 replicas- Port 8080- Health check on /health- 256Mi memory, 100m CPU requests
The AI will provide a manifest you can add to your stack.
5
Create the Stack
Review your configuration in the Builder tab, then click Create Stack.Ankra will commit the manifests to your GitOps repository and deploy them to your cluster.
You can view your stack’s manifests in the GitOps repository under clusters/{cluster-name}/manifests/.
This creates deploy_key (private) and deploy_key.pub (public).
2
Add Public Key to GitOps Repo
Go to your GitOps repository on GitHub → Settings → Deploy keys → Add deploy key.Paste the contents of deploy_key.pub and check Allow write access.
3
Add Private Key to App Repo
Go to your application repository → Settings → Secrets and variables → Actions.Create a new secret called GITOPS_DEPLOY_KEY with the contents of deploy_key.
Add a GitHub Actions workflow to your application repository that builds your container and updates the GitOps repo.
1
Create the Workflow File
In your application repository, create .github/workflows/deploy.yml.
2
Use the AI to Generate the Workflow
Open the AI Assistant (⌘+J) and describe your pipeline:
Copy
Generate a GitHub Actions workflow that:- Triggers on push to main branch- Builds a Docker image from my Dockerfile- Pushes to Google Artifact Registry at europe-west1-docker.pkg.dev/my-project/docker-images/backend- Tags with the git SHA- Updates my GitOps repo at github.com/my-org/infrastructure-gitops- Updates the image tag in clusters/my-cluster/manifests/backend-deployment.yaml
The AI will generate a complete workflow tailored to your setup.
3
Add Registry Secrets
Add these secrets to your application repository under Settings → Secrets and variables → Actions:
Secret
Description
REGISTRY_USERNAME
Registry username (or _json_key for GCP)
REGISTRY_PASSWORD
Registry password or service account key
GITOPS_DEPLOY_KEY
The SSH private key from Step 3
Example Workflow Reference
Here’s what a typical workflow looks like. Use the AI to customize it for your specific setup:
To add CI/CD for additional services, use the AI Assistant to scaffold everything:
1
Add to Existing Stack or Create New
Either edit your existing stack or create a new one for the service.
2
Generate the Deployment Manifest
Open the AI Assistant (⌘+J) and describe your service:
Copy
Add a deployment for my frontend service:- Image: europe-west1-docker.pkg.dev/my-project/docker-images/frontend- Namespace: production- 3 replicas- Port 3000- Expose via a Service on port 80
3
Generate the CI Workflow
In your frontend app repo, ask the AI to generate the workflow:
Copy
Generate a GitHub Actions workflow to build and deploy my frontend:- Build from ./frontend/Dockerfile- Push to europe-west1-docker.pkg.dev/my-project/docker-images/frontend- Update clusters/my-cluster/manifests/frontend-deployment.yaml in my GitOps repo
4
Add the Secrets
Copy the same secrets (GITOPS_DEPLOY_KEY, registry credentials) to the new repository.
Use these prompts with the AI Assistant (⌘+J) to set up your CI/CD:
Create a Deployment
Copy
Create a deployment manifest for my backend service:- Image: my-registry.io/backend:latest- Namespace: production- 2 replicas with rolling update strategy- Port 8080- Health checks on /health and /ready- Resource requests: 256Mi memory, 100m CPU- Resource limits: 512Mi memory, 500m CPU- Environment variables from a ConfigMap called backend-config
Create a Complete Service Stack
Copy
Set up a complete service stack for my API:- Deployment with 3 replicas- Service exposing port 80- Ingress with TLS using cert-manager- HorizontalPodAutoscaler scaling 2-10 replicas at 70% CPU- PodDisruptionBudget allowing 1 unavailable
Add Image Pull Secret
Copy
Create a docker registry secret for pulling images from:- Registry: europe-west1-docker.pkg.dev- Namespace: productionThen update my backend deployment to use this secret.
Generate CI Workflow
Copy
Generate a GitHub Actions workflow that:- Builds my Docker image on push to main- Pushes to AWS ECR at 123456789.dkr.ecr.us-east-1.amazonaws.com/my-app- Updates clusters/prod/manifests/app-deployment.yaml in my GitOps repo- Only builds when files in src/ or Dockerfile change
Add Canary Deployment
Copy
Modify my deployment to support canary releases:- Create a canary deployment with 1 replica- Use labels to route 10% of traffic to canary- Add a Service that selects both stable and canary pods
Troubleshoot Deployment
Copy
My backend deployment isn't updating after CI pushed a new image.Help me troubleshoot why the pods aren't rolling out.
The AI Assistant has full context of your cluster. It can see your existing resources, logs, and events. Describe what you want to achieve and it will generate the right configuration.
Always use unique, immutable tags like git SHA or build number. The AI will help you set this up correctly.Ask the AI: “Ensure my deployment uses immutable image tags and imagePullPolicy IfNotPresent”
Add Health Checks
Let the AI configure proper health checks for your deployments.Ask the AI: “Add appropriate liveness and readiness probes to my backend deployment for a Node.js app”
Set Resource Limits
Prevent runaway resource usage with proper limits.Ask the AI: “Review my deployment and suggest appropriate resource requests and limits based on a typical web API”
Use SOPS for Secrets
Encrypt sensitive values in your GitOps repository.Ask the AI: “Help me encrypt my database password using SOPS”