What is a Connection?
A Connection is a resource that Meshery uses to interact with external infrastructure. Examples include:- Kubernetes clusters - For deploying and managing workloads
- Prometheus instances - For metrics collection and monitoring
- Grafana servers - For visualization and dashboards
- Service mesh adapters - For Istio, Linkerd, Consul, etc.
- Container registries - For image storage
- Git repositories - For version control integration
Connections are managed resources that can be assigned to Environments, making them available across Workspaces for team collaboration.
Managed vs Unmanaged Connections
Managed Connections
Managed connections are discovered and actively monitored by MeshSync:- Automatic discovery: MeshSync finds resources in connected clusters
- Real-time sync: Changes are detected and propagated immediately
- Health monitoring: Connection status is continuously tracked
- Lifecycle management: Meshery can deploy, configure, and remove resources
Unmanaged Connections
Unmanaged connections are manually registered by users:- Manual entry: User provides connection details
- Limited monitoring: Basic reachability checks only
- External management: Resources managed outside Meshery
- Integration only: Used for querying or visualization
MeshSync can discover connections automatically, but they must be administratively approved (transitioned to Registered or Connected state) before Meshery can actively manage them.
Connection States
Meshery tracks connection status using a well-defined state machine. Understanding these states helps you manage connections effectively.State: Discovered
Description: Resource has been found but not yet validated for use.- MeshSync discovers the resource through multi-tier cluster scanning
- Connection appears in the Connections table
- No reachability test has been performed
- Meshery has not attempted to manage the connection
- →
Registered- User or system verifies the connection - →
Ignored- User marks connection to be ignored
State: Registered
Description: Connection has been verified as reachable and usable.- Reachability test passed successfully
- Connection credentials validated (if required)
- Awaiting administrative decision on usage
- Ready to transition to active management
- →
Connected- User chooses to actively manage the connection - →
Maintenance- Temporarily offline for updates - →
Not Found- Connection becomes unreachable
State: Connected
Description: Connection is actively managed by Meshery.- Full integration with Meshery features
- Can be used in designs and deployments
- Monitored for health and availability
- Actions can be invoked on the connection
- →
Disconnected- Connection becomes unreachable (automatic) - →
Maintenance- User schedules maintenance window - →
Ignored- User stops managing the connection
Certain connection types (like Meshery Server registration with remote providers) can automatically transition to Connected state.
State: Ignored
Description: Connection is administratively marked to be ignored.- Meshery will not attempt to manage this connection
- Will not be rediscovered in future scans
- Previous data retained but not updated
- Persists across user sessions
- Ignored: Intentional administrative decision
- Disconnected: Connectivity or authentication failure
State: Maintenance
Description: Connection is temporarily offline for planned maintenance.- Different from Disconnected or Ignored states
- Indicates scheduled downtime
- Prevents false alerts
- Can transition back to Connected when maintenance completes
- →
Connected- Maintenance window completed - →
Disconnected- Issues encountered during maintenance
State: Disconnected
Description: Previously connected resource is now unavailable.- Was previously in Discovered, Registered, or Connected state
- Failed reachability or authentication checks
- May be due to network issues, revoked credentials, or deletion
- Historical data preserved
- Disconnected: Resource unreachable but may return
- Deleted: Resource administratively removed from Meshery
State: Deleted
Description: Connection administratively removed from Meshery.- All collected data will be deleted
- Connection removed from environments and workspaces
- Cannot be recovered (must be re-registered)
State: Not Found
Description: Manually registered connection that cannot be reached.- User attempted manual registration
- Meshery unable to establish connectivity
- May be due to incorrect URL, credentials, or network issues
- Not Found: Never successfully connected
- Disconnected: Previously connected but now unreachable
Connection Lifecycle
Connection Types and Metadata
Kubernetes Connections
cluster- MeshSync deployed in each cluster (default)edge- Centralized MeshSync for edge/remote clusters
Prometheus Connections
Grafana Connections
Meshery Server Connection
Meshery Server registers itself as a connection:Working with Connections
Querying Connections
List all connections:page- Page number (default: 0)pagesize- Items per page (default: 10, max: 100)search- Search term for filteringorder- Sort field (default: “updated_at desc”)status- Filter by status:["connected", "disconnected"]kind- Filter by kind:["kubernetes", "prometheus"]type- Filter by type:["platform", "observability"]name- Partial name match
Creating Connections
Register a new connection:Updating Connections
Update connection details:- Change MeshSync deployment mode
- Update connection name or metadata
- Modify connection status
Deleting Connections
Remove a connection:- Connection record in database
- Environment assignments
- Collected metrics and data
Connection State Management
Connections use a state machine implementation for lifecycle management:Determining if Connection Should be Managed
State Notifications
When connection status changes, Meshery Server notifies the state machine:Connection Registration Process
For Kubernetes connections, registration follows a multi-step process:-
Init Event: Client requests connection schema
-
Server Response: Returns connection and credential schemas
-
Client Submission: Sends filled connection details
- State Machine: Connection enters state machine for validation
Best Practices
Connection Naming
Use descriptive, consistent names:Credential Management
- Rotate regularly: Update credentials on a schedule
- Least privilege: Use service accounts with minimal permissions
- Avoid sharing: Don’t reuse credentials across environments
- Secure storage: Leverage Meshery’s credential encryption
Monitoring Connection Health
- Watch status: Monitor connection state transitions
- Test regularly: Verify connectivity periodically
- Alert on failures: Set up notifications for disconnections
- Clean up: Remove unused connections
Environment Assignment
- Logical grouping: Assign connections to appropriate environments
- Avoid duplication: Reuse connections across environments when appropriate
- Clear purpose: Document why connections are in each environment
Integration with Other Concepts
Environments
Connections are assigned to Environments:- Group related connections together
- Make connections available in workspaces
- Share infrastructure access across teams
Credentials
Connections use Credentials for authentication:- Separate credential storage for security
- Multiple connections can share credentials
- Credential updates propagate automatically
Designs
Connections are deployment targets for Designs:- Designs specify which connections to deploy to
- Multiple connections can be targeted in one design
- Connection health affects deployment success
Related Concepts
- Environments - Grouping connections for team access
- Credentials - Secure authentication management
- MeshSync - Automatic connection discovery
- Workspaces - Team collaboration and resource sharing