> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ale.run/llms.txt
> Use this file to discover all available pages before exploring further.

# Environments

> Network isolation is configured on a per-namespace basis, and you can manage the following settings within the environment.

<AccordionGroup>
  <Accordion title="Service-to-service communication using service names as hostnames">
    <Frame>
      <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/developers/images/en/07_05.png" />
    </Frame>

    > Services shown together belong to the same environment and can communicate using the private network address, **service name and port number.** No firewall rules are needed, and latency is minimized.

    <Tip>
      For more details, see the [Service Connection page](/en/developers/connect).
    </Tip>
  </Accordion>

  <Accordion title="Multiple environments like Dev, QA, Staging, Prod within a single project">
    <Frame>
      <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/developers/images/en/04_03.png" />
    </Frame>

    > You can manage one or multiple environments (Dev, QA, Staging, Prod, etc.) within a single project.
  </Accordion>

  <Accordion title="Environment Replication via YAML File Drag & Drop">
    <video autoPlay muted loop playsInline className="w-full aspect-video" src="https://storage.googleapis.com/files.cloudtype.io/ale-docs/developers/images/en/clone_en.mp4" />

    > Download a YAML file containing deployment settings for all deployed services and apply it to a new environment via Drag & Drop.

    <Tip>
      For more details, see the [Environment Migration page.](/en/developers/migration)
    </Tip>
  </Accordion>

  <Accordion title="Manage secrets">
    <video autoPlay muted loop playsInline className="w-full aspect-video" src="https://storage.googleapis.com/files.cloudtype.io/ale-docs/developers/images/en/secret_en.mp4" />

    > Store common variables and secrets under the Settings tab and apply them to services in the selected environment.
  </Accordion>

  <Accordion title="Firewall settings">
    <Frame>
      <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/developers/images/en/03_11.png" />
    </Frame>

    > You can enable external TCP connections from other environments, projects, and external services via the firewall management section in the Settings tab. **When enabled, this allows access from all IP addresses - configure with caution.**
  </Accordion>
</AccordionGroup>

<Note>
  An environment corresponds to a namespace in a Kubernetes cluster.
</Note>

<Info>
  Learn more about `ale`'s work unit hierarchy, from spaces to services, in the following section.
</Info>

<Frame>
  <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/operations/images/en/02_01.png" />
</Frame>

<br />

<AccordionGroup>
  <Accordion title="Space">
    > A space is the top-level unit of the workspace hierarchy. [Space owners can invite team members](/en/developers/space#team-management) to collaborate on projects within the resources allocated by the operations system. Members can create and manage projects in a self-service manner.
  </Accordion>

  <Accordion title="Project">
    > **A project is a display name that represents a collection of environments.** It is designed for the management convenience of dashboard users, allowing them to manage one or more work-related environments (Dev, QA, Staging, Prod, and others) within a single project.
  </Accordion>

  <Accordion title="Environment">
    > **An environment corresponds to a namespace in a Kubernetes cluster.** Network isolation is configured on a per-namespace basis, and [services within the same environment (namespace) can communicate by referencing service names as hostnames.](/en/developers/connect#internal-service-connection) Frequently used [environment variables can be stored as secrets at the environment level](/en/developers/env) for management and application.
  </Accordion>

  <Accordion title="Service">
    > **A service corresponds to a Deployment in Kubernetes.** Each service can be [accessed via terminal](/en/developers/log) and [connected to custom domains.](/en/developers/domain) For more details on deploying services, see the [Deploying with ale page.](/en/developers/deploy)
  </Accordion>
</AccordionGroup>

***

## Create a New Environment

<Frame>
  <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/developers/images/en/04_01.png" />
</Frame>

> [When creating a project,](/en/developers/project#create-a-project) an environment named `main` is created simultaneously.

<Info>
  Environments can only be created as part of a project.
</Info>

## Environment Details

<Frame>
  <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/developers/images/en/03_03.png" />
</Frame>

> The header shows the parent project name of the current environment, with a selector in the top-right corner to switch environments. **In the Information tab below, you can view details of services within the selected environment and manage the services directly.**

<AccordionGroup>
  <Accordion title="Services">
    <Frame>
      <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/developers/images/en/03_04.png" />
    </Frame>

    > Each service is displayed as a card with controls for management and monitoring.

    * **Start( <Icon icon="play" size={15} color="000" /> ) / Stop( <Icon icon="stop" size={15} color="000" /> )** : Start or stop the service

    * **Log View/Terminal( <Icon icon="terminal" size={15} color="000" /> )** : View running logs, build logs, or access terminal

    * **Repository( <Icon icon="github" size={15} color="000" /> )** : open source code repository

    * **Access** : Open service URL(Web service)

    * **Copy Address** : Copy Host and Port address for TCP connection (database)

    * **User Profile** : View user who deployed the service

    * [Spot](/en/developers/resource#on-demand-spot) : Service running on spot resources

    * **<Icon icon="plus" size={15} color="9fa3a5" />** : Open deploy modal

    * **Service Status** : Display current service status such as building, running, etc.
  </Accordion>

  <Accordion title="Events">
    <Frame>
      <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/developers/images/en/03_07.png" />
    </Frame>

    > You can view Kubernetes cluster events generated by deployed services.

    <Info>
      Events are retained for a limited time period.
    </Info>
  </Accordion>

  <Accordion title="Settings">
    #### Project Information

    <Frame>
      <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/developers/images/en/03_08.png" />
    </Frame>

    * **Project Name** : Project names can be set using 2-20 lowercase English letters and numbers.

    * **Project ID** : A unique value used internally by the ale system for the project.

    * **Display Name** : A user-friendly name for project identification. Supports all characters and languages.

    #### Environment Information

    <Frame>
      <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/developers/images/en/03_09.png" />
    </Frame>

    * **Environment Name** : Name used to distinguish environments within a project. You can freely customize this name.

    * **Environment ID** : A unique system identifier for internal use.

    * **Cluster** : Information about the cluster where services are deployed.
  </Accordion>
</AccordionGroup>

## Add Environments

### Add as Empty Environment

<Frame>
  <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/developers/images/en/04_02.png" />
</Frame>

> Navigate to the environment selector (top right) and click "Create New Environment". Choose "Create as Empty Environment", configure your environment name and select a cluster, then click `Create` to complete the process.

### Add by Cloning

<video autoPlay muted loop playsInline className="w-full aspect-video" src="https://storage.googleapis.com/files.cloudtype.io/ale-docs/developers/images/en/addenv_en.mp4" />

> To clone an environment, select an environment with services as a source environment. The new environment will be created with all services cloned from the source environment.

<Info>
  Clone your source environment to easily create development, production, or QA environments. Newly cloned services are in a stopped state and can be launched all at once by clicking `Start All` in the evnironment selector.
</Info>

<Tip>
  When migrating an environment, secrets from the source environment are not copied over. See [the Secret Management page](/en/developers/env) to configure secrets for your new environment.
</Tip>

## Management

### Switch Environments

<Frame>
  <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/developers/images/en/04_03.png" />
</Frame>

> To switch between environments, click the environment selector in the top right corner.

<Info>
  Each environment (except for main) is assigned a distinct color indicator. These color codes help you quickly identify which environment you're working with when deploying or modifying services.
</Info>

### Deploy with YAML File

<video autoPlay muted loop playsInline className="w-full aspect-video" src="https://storage.googleapis.com/files.cloudtype.io/ale-docs/developers/images/en/clone_en.mp4" />

> You can download YAML configuration files containing all service deployment settings from your environment and apply them to a new environment using drag & drop.

<Info>
  YAML deployment scripts simplify cloning environments. For more information, See the [Environment Migration page](/en/developers/migration).
</Info>

### Set as Default Environment

<Frame>
  <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/developers/images/en/04_04.png" />
</Frame>

> To set a default environment, click `Set as Default Environment` in the environment information section of the Settings tab. Since the default environment is automatically loaded when you select a project, it's recommended to set your most frequently used environment as default.

### Delete Environment

<Frame>
  <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/developers/images/en/04_05.png" />
</Frame>

> Click `Delete a environment` at the bottom of the Settings tab.

<Info>
  If only one environment exists in the project, the button will show as `Delete a project`, and both the project and environment will be deleted.
</Info>

## Secret Management

<video autoPlay muted loop playsInline className="w-full aspect-video" src="https://storage.googleapis.com/files.cloudtype.io/ale-docs/developers/images/en/secret_en.mp4" />

> In the secret management section of the Settings tab, click the **<Icon icon="plus" size={15} color="9fa3a5" />** icon on the right to store common variables and secrets that can be **used by services in the environment**.

<Info>
  You can quickly configure secrets using drag & drop. For more details, see the [Environment Variable Management page](/en/developers/env).
</Info>

<Tip>
  Secrets can be stored and shared at the environment level.
</Tip>

## Firewall Settings

<Frame>
  <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/developers/images/en/03_11.png" />
</Frame>

> You can enable external TCP connections from other environments, projects, and external services via the firewall management section in the Settings tab. **When enabled, this allows access from all IP addresses - configure with caution.**

<Info>
  For more details on communication with other services, see the [Service Connections page](/en/developers/connect).
</Info>
