Kubernetes Integration
Meshery provides deep integration with Kubernetes, enabling you to manage, configure, and operate Kubernetes clusters and workloads across any infrastructure. Whether running on-premises, in the cloud, or at the edge, Meshery serves as your unified control plane for Kubernetes.Overview
Meshery’s Kubernetes integration enables:- Multi-cluster management: Connect and manage multiple Kubernetes clusters from a single interface
- Visual design: Drag-and-drop Kubernetes resources in Kanvas
- Real-time sync: Continuous discovery of cluster state with MeshSync
- GitOps workflows: Version control and automated deployment
- Configuration validation: Policy enforcement and best practice checks
- Dry-run deployments: Simulate changes before applying to live clusters
Supported Kubernetes Platforms
Amazon EKS
Elastic Kubernetes Service on AWS
Google GKE
Google Kubernetes Engine
Azure AKS
Azure Kubernetes Service
Docker Desktop
Kubernetes on Docker Desktop
Minikube
Local Kubernetes development
kind
Kubernetes in Docker
OpenShift
Red Hat OpenShift Container Platform
Rancher
Rancher Kubernetes Engine
K3s
Lightweight Kubernetes
Connecting Kubernetes Clusters
Prerequisites
- A running Kubernetes cluster
kubectlconfigured with cluster access- Meshery installed and running
Connection Methods
- Meshery UI
- mesheryctl
- Kubernetes API
- Navigate to Settings > Connections
- Click + to add a new connection
- Select Kubernetes as the connection type
- Choose connection method:
- In-cluster: Meshery running inside the cluster
- Out-of-cluster: Use kubeconfig file
- Upload kubeconfig or paste contents
- Click Connect to establish the connection
- Verify connection status shows as Connected
Multi-Cluster Setup
Manage multiple clusters simultaneously:- Add Multiple Connections: Connect each cluster following the steps above
- Create Environment: Group clusters into logical environments
- Assign to Workspace: Control access to clusters by workspace
- Deploy Across Clusters: Use the same design pattern on multiple clusters
Kubernetes Resources
Meshery provides comprehensive support for Kubernetes resources:Workload Resources
Pods
Pods
Description: The smallest deployable unit in KubernetesOperations:
- View pod status and details
- Access logs and events
- Execute commands in containers
- Port forwarding
- Delete and recreate
Deployments
Deployments
Description: Declarative updates for Pods and ReplicaSetsOperations:
- Create and update deployments
- Scale replicas up or down
- Rollout and rollback versions
- Set resource requests and limits
- Configure update strategy
StatefulSets
StatefulSets
Description: Manages stateful applications with stable network identitiesOperations:
- Deploy stateful applications (databases, caches)
- Ordered pod creation and deletion
- Persistent volume management
- Stable network identifiers
DaemonSets
DaemonSets
Description: Ensures a pod runs on all (or selected) nodesUse Cases:
- Node monitoring agents
- Log collection
- Storage daemons
- Network plugins
Jobs and CronJobs
Jobs and CronJobs
Description: Run batch processes and scheduled tasksOperations:
- One-time batch jobs
- Scheduled recurring jobs
- Parallel processing
- Completion tracking
Service Resources
Services
Services
Description: Exposes applications running on PodsService Types:
- ClusterIP: Internal cluster access (default)
- NodePort: Exposes on each node’s IP at a static port
- LoadBalancer: Cloud provider load balancer
- ExternalName: Maps to a DNS name
Ingress
Ingress
Description: HTTP/HTTPS routing to servicesFeatures:
- Path-based routing
- Host-based routing
- TLS termination
- Load balancing
Configuration Resources
ConfigMaps
ConfigMaps
Description: Store non-confidential configuration dataUsage:
- Environment variables
- Command-line arguments
- Configuration files
Secrets
Secrets
Description: Store sensitive informationTypes:
- Opaque (generic)
- TLS certificates
- Docker registry credentials
- Service account tokens
Storage Resources
- PersistentVolumes (PV): Cluster-level storage resources
- PersistentVolumeClaims (PVC): User requests for storage
- StorageClasses: Dynamic provisioning of PVs
RBAC Resources
- ServiceAccounts: Identity for processes running in pods
- Roles/ClusterRoles: Define permissions
- RoleBindings/ClusterRoleBindings: Grant permissions to users/service accounts
MeshSync: Continuous Discovery
MeshSync is a Meshery component that continuously discovers and synchronizes the state of your Kubernetes clusters.How MeshSync Works
- Discovery: Scans cluster for all Kubernetes resources
- Synchronization: Updates Meshery’s database with current state
- Change Detection: Identifies configuration drift
- Event Publishing: Publishes changes to NATS message broker
- Real-time Updates: UI reflects cluster state in real-time
Deployment
MeshSync is deployed as part of the Meshery Operator:Configuration
MeshSync can be configured to:- Include/Exclude Namespaces: Focus on specific namespaces
- Resource Filters: Limit discovery to certain resource types
- Sync Interval: Adjust discovery frequency
- Event Filtering: Control which events are published
Meshery Operator
The Meshery Operator manages the lifecycle of Meshery components in Kubernetes.Components Managed
- MeshSync: Cluster discovery and synchronization
- Meshery Broker: NATS-based event streaming
- Adapters: Service mesh adapter deployments (optional)
Installation
Custom Resources
The operator defines these CRDs:- Broker: Configures NATS message broker
- MeshSync: Configures cluster discovery
Visual Design with Kanvas
Creating Kubernetes Designs
Open Kanvas
Navigate to Extensions > Kanvas or visit kanvas.new
Add Components
Drag Kubernetes components from the left panel onto the canvas:
- Deployments
- Services
- ConfigMaps
- Secrets
- Ingress
Configure Components
Click each component to edit properties:
- Container images
- Environment variables
- Resource limits
- Labels and annotations
Define Relationships
Meshery automatically infers relationships:
- Service → Deployment (selector matching)
- ConfigMap → Pod (volume mount)
- Secret → Pod (volume mount)
- Ingress → Service (backend reference)
Validate Design
Click Validate to check for:
- Missing required fields
- Invalid configurations
- Policy violations
Example: Three-Tier Application
Create a complete web application:- Frontend Deployment + Service: React/Angular/Vue app
- Backend Deployment + Service: REST API or GraphQL server
- Database StatefulSet + Service: PostgreSQL or MongoDB
- Ingress: External access to frontend
- ConfigMaps: Application configuration
- Secrets: Database credentials
Dry-Run Deployments
Meshery leverages Kubernetes’ dry-run capabilities to validate deployments before applying them.How to Use Dry-Run
- Design Your Application: Create a design in Kanvas
- Enable Dry-Run: Toggle “Dry-run” option before deploying
- Review Results: Meshery shows what would be created/modified
- Identify Issues: Catch errors before they impact your cluster
- Apply Confidently: Deploy with confidence after validation
Benefits
- Validate YAML syntax
- Check API version compatibility
- Detect missing fields or invalid values
- Preview object changes
- Integrate with CI/CD pipelines
Configuration Validation
Meshery validates Kubernetes configurations against:Built-in Policies
- Resource requests and limits set
- Liveness and readiness probes configured
- Security contexts defined
- Image pull policies specified
- Non-root users enforced
OPA Policies
Define custom policies using Open Policy Agent (OPA):Relationship Policies
Meshery enforces relationship-based policies:- Services must have matching Deployments
- Ingress must reference existing Services
- ConfigMaps/Secrets must be referenced by Pods
GitOps with Kubernetes
Meshery supports GitOps workflows for Kubernetes:Workflow
- Design in Kanvas: Create infrastructure designs
- Export to Git: Push designs to GitHub repository
- CI/CD Pipeline: GitHub Actions deploys on commit
- Meshery Snapshots: Preview changes in pull requests
- Automated Deployment: Merge triggers deployment
GitHub Integration
Performance and Monitoring
Meshery collects metrics from Kubernetes clusters:Cluster Metrics
- Node CPU and memory utilization
- Pod resource consumption
- Network I/O
- Storage usage
Integration with Prometheus
Connect Meshery to Prometheus running in your cluster:- Navigate to Settings > Metrics
- Add Prometheus URL (e.g.,
http://prometheus.monitoring:9090) - Meshery queries cluster and application metrics
- View metrics in performance test results
Troubleshooting
Connection Failed
Connection Failed
Problem: Cannot connect to Kubernetes clusterSolutions:
- Verify kubeconfig is valid:
kubectl cluster-info - Check network connectivity to API server
- Ensure Meshery has necessary RBAC permissions
- Review Meshery logs for authentication errors
MeshSync Not Discovering Resources
MeshSync Not Discovering Resources
Problem: Cluster resources not appearing in MesherySolutions:
- Check MeshSync pod status:
kubectl get pods -n meshery -l app=meshsync - Review MeshSync logs:
kubectl logs -n meshery <meshsync-pod> - Verify NATS broker is running
- Restart MeshSync:
kubectl rollout restart deployment/meshsync -n meshery
Deployment Validation Errors
Deployment Validation Errors
Problem: Design validation fails in MesherySolutions:
- Check Kubernetes API version compatibility
- Verify required fields are populated
- Review OPA policy violations
- Use dry-run to identify specific errors
Next Steps
Service Meshes
Add service mesh capabilities to your Kubernetes clusters
Cloud Providers
Integrate AWS, GCP, and Azure services
Design Patterns
Explore pre-built Kubernetes patterns
Observability
Monitor cluster and application performance