Skip to content

Service Visibility

Overview

Service visibility in Omnistrate allows you to control which services are internal and which are customer-facing. This configuration is essential when building multi-service applications.

Configuration

When defining multiple services in your compose file, you need to explicitly specify which services are internal using the x-omnistrate-mode-internal flag. This flag helps in managing service visibility and accessibility.

Usage

You can define service visibility in your compose file by adding the x-omnistrate-mode-internal flag to your service definition:

services:
  backend-service:
    x-omnistrate-mode-internal: true  # This service will be internal
    # ...other service configuration

  public-api:
    x-omnistrate-mode-internal: false  # This service will be customer-facing
    # ...other service configuration

Note

When you have multiple services in your compose file, you must define the x-omnistrate-mode-internal flag for at least one service to explicitly specify its visibility.

Configuration Rules

  • The flag accepts boolean values (true/false)
  • Required when defining multiple services in the compose file
  • At least one service must have this flag defined when multiple services are present
  • Helps in distinguishing between internal and customer-facing services

Example

Here's a complete example showing how to configure service visibility in a multi-service setup:

services:
  internal-backend:
    image: backend:latest
    x-omnistrate-mode-internal: true
    ports:
      - "8080"
    volumes:
      - internal-data:/data
    environment:
      - DB_CONNECTION=internal

  public-api-gateway:
    image: api-gateway:latest
    x-omnistrate-mode-internal: false
    ports:
      - "80:80"
    depends_on:
      - internal-backend

Best Practices

  1. Explicit Configuration: Always explicitly define the visibility of your services to maintain clarity.
  2. Security Considerations:
  3. Mark internal services that handle sensitive operations as x-omnistrate-mode-internal: true
  4. Only expose necessary services as customer-facing (x-omnistrate-mode-internal: false)
  5. Documentation: Document the purpose and visibility of each service in your architecture

Common Use Cases

Internal Services

Typically marked as x-omnistrate-mode-internal: true: - Database services - Cache services - Background workers - Internal APIs - Service meshes

Customer-Facing Services

Typically marked as x-omnistrate-mode-internal: false: - Public API endpoints - Customer-facing web applications - Load balancers - Gateway services