This repository demonstrates modern GitOps practices for Kubernetes cluster management using the Ankra platform. It showcases how to structure and manage Kubernetes environments using Ankra's Stack-based architecture, providing reusable and versioned cluster configurations.
Ankra is a modern GitOps platform that enables teams to manage Kubernetes clusters through a stack-based approach. This repository contains example cluster configurations that demonstrate:
- Stack-based Architecture: Grouping related services and controlling deployment order
- GitOps Workflow: Managing cluster state through Git repositories
- Dependency Management: Automatic resolution of stack dependencies
- Reusable Components: Versioned, shareable cluster configurations
ankra-gitops-examples/
├── README.md
└── clusters/
└── monitoring-stack/ # Complete observability solution
├── cluster.yaml # Cluster definition and stack configuration
├── add-ons/ # Helm chart configurations
│ ├── kube-prometheus-stack/
│ │ └── values.yaml
│ └── loki-distributed/
│ └── values.yaml
└── manifests/ # Raw Kubernetes YAML files
The monitoring-stack example demonstrates a complete observability stack for Kubernetes clusters, including:
- Prometheus: Metrics collection and alerting
- Grafana: Data visualization and dashboards
- Loki: Log aggregation and querying
- Tempo: Distributed tracing
- Fluent Bit: Log shipping and processing
- Grafana Alloy: Telemetry data collection
The cluster configuration uses Ankra's stack concept to organize services:
stacks:
- name: monitoring
# Monitoring-related servicesServices are deployed in the correct order using parent-child relationships:
addons:
- name: prometheus
parents:
- name: prometheus-namespace
kind: manifestClean separation of concerns using from_file references:
configuration:
from_file: add-ons/prometheus/values.yamlProper namespace isolation with dedicated manifest files:
manifests:
- name: prometheus-namespace
from_file: manifests/prometheus-namespace.yaml- Ankra Platform Access: Sign up at platform.ankra.app
- Git Repository: Fork or clone this repository
- Kubernetes Cluster: A target cluster registered with Ankra
-
Connect Repository to Ankra:
- Update the
git_repositorysection incluster.yaml - Set your GitHub credentials in Ankra
- Update the
-
Customize Configuration:
- Modify Helm values in
add-ons/directories - Update ingress hostnames and TLS settings
- Adjust resource limits and requests
- Modify Helm values in
-
Deploy the Stack:
- Use Ankra's WebUI or CLI to deploy the cluster configuration
- Monitor deployment progress in the Ankra dashboard
# Install Ankra CLI
bash <(curl -sL https://github.com/ankraio/ankra-cli/releases/latest/download/install.sh)
# Set API token
export ANKRA_API_TOKEN=your-token-here
# Select cluster and deploy
ankra select cluster
ankra apply -f cluster.yamlThe kube-prometheus-stack is configured with:
- Persistence: 50GB storage for metrics data
- Grafana Integration: Pre-configured dashboards and datasources
- Service Monitoring: Automatic service discovery
- Ingress: HTTPS access via
monitoring.seferon
The distributed Loki deployment includes:
- Gateway: NGINX proxy with authentication
- Scalability: Distributed architecture for high availability
- Ingress: Secure log access via
logs.seferon - OAuth2 Integration: Centralized authentication
- Environment Separation: Use different cluster directories for dev/staging/prod
- Version Control: All configurations are tracked in Git
- Security: TLS certificates and authentication configured
- Monitoring: Complete observability stack deployment
- Scalability: Distributed services with proper resource management
- Create Helm values file in
add-ons/service-name/values.yaml - Add service configuration to
cluster.yaml - Define dependencies and namespaces as needed
- Update Helm values in the respective
add-ons/directory - Commit changes to trigger GitOps sync
- Monitor deployment in Ankra dashboard
This repository integrates with Ankra's advanced features:
- Stack Builder: Visual management of stacks and dependencies
- AI Editor: Intelligent suggestions for configurations
- WebUI: Real-time monitoring and management
- Multi-cluster Support: Deploy to multiple environments
- Explore the Examples: Review the monitoring stack configuration
- Read the Documentation: Check out the comprehensive Ankra documentation
- Join the Community: Connect with other users on Ankra Slack
- Get Support: Contact support at hello@ankra.io
This repository demonstrates the power of GitOps with Ankra's stack-based approach to Kubernetes cluster management. Start with the monitoring stack example and customize it for your specific needs!