For the complete documentation index, see llms.txt. This page is also available as Markdown.

iai services sync

Sync services in a project from a stack config file

Synopsis

Sync services in a specific project from a stack configuration file.

The sync command will:

  • Create services that exist in the config but not in the project

  • Update services that exist in both the config and the project

  • Delete services that exist in the project but not in the config, only with --allow-delete=services; otherwise those deletions are refused and reported on stderr while creates and updates still apply

Updates replace the whole live spec of each service. For every service updated, the live revision being replaced is printed to stderr so a sync from a stale config file is visible before it lands. With --allow-delete=services, deletes run after service creates/updates.

The project is selected with --project or via 'iai projects select', and the config file with --cfg-file.

iai services sync [flags]

Example config file

organization: my-org
project: my-project
stack-id: my-stack-v1

services:
  my-service:
    servicePort: 8080
    image:
      type: external
      repository: kennethreitz
      name: httpbin
      tag: latest
    resources:
      memory: "512M"
      cpu: "1"
    env:
      - name: DATABASE_URL
        value: "postgres://db:5432/mydb"
      - name: LOG_LEVEL
        value: "info"
    secretRefs:
      - secretName: my-secret
    endpoint: true
    replicas: 2
    healthcheck:
      path: /health
      initialDelaySeconds: 10
    schedule:
      uptime: "Mon-Fri 07:30-20:30"
      timezone: "Europe/Berlin"

Note: replicas and autoscaling are mutually exclusive. To use autoscaling instead:

Options

Options inherited from parent commands

SEE ALSO

Last updated

Was this helpful?