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

# Gravity Installation

Gravity is an open-source, containerized Kubernetes framework that allows containerized applications like Anaconda Enterprise to be delivered in a self-contained installer that includes a special containerized implementation of Kubernetes. Anaconda has shipped Data Science & AI Workbench in a Gravity package since its first release.

Due to changes in the business model of [Teleport](https://goteleport.com/), the original developers of Gravity, we are limiting the use of the Gravity-based installer to existing customers. For more information, see Anaconda’s [Gravity update policy](../reference/gravity-support).

New customers, and any existing customers who no longer want to use Gravity, are encouraged to explore our [Bring Your Own Kubernetes (BYOK8s)](./byok8s) option.

After you have verified that your [environment is prepared for installation](../environment-prep/gravity-prep) by completing the [pre-installation checklist](../environment-prep/gravity-prep#pre-installation-checklist), you’re ready to install the cluster!

<Note>
  The Gravity installation process only sets up a single control plane node. Once installation is complete, you can [add additional nodes](../admin/resources/add-remove-node) as necessary, including GPUs.
</Note>

1. Open a terminal on the master node and log in to a service account with sudo access.

2. Download the installer by running the following command:

   ```
   # Replace <INSTALLER_LOCATION> with the provided location of the installer
   curl -O <INSTALLER_LOCATION>
   ```

   <Note>
     If you are in an airgapped environment, you must deliver the installer to the master node in an alternate manner.
   </Note>

3. Decompress the installer and enter the top directory by running the following commands:

   ```
   # Replace <INSTALLER> with the installer file you just downloaded
   tar xzvf <INSTALLER>
   cd <INSTALLER>

   ```

4. Set up and initialize your conda environment by running the following command:

   ```
   ./conda-bootstrap.sh

   ```

5. Enter `yes` to allow the installer to initialize your `ae5-conda` environment by running `conda init` when prompted.

6. Verify your environment successfully created by running the following command:

   ```
   conda env list

   ```

   <Note>
     This command returns a list of existing conda environments. You should see a `base` environment present with an asterisk next to the directory to indicate it is currently active.
   </Note>

7. Perform the Anaconda preflight system check on the master node by running the following command:

   ```
   ae-preflight
   ```

   <Note>
     You will receive an overall `PASS` or `WARN` result from the script. The output is captured in a `results.txt` file for later reference, if necessary. If something goes wrong, you can view the results to determine the issue and correct it.
   </Note>

8. Create a file named `values.yaml` and populate it with the following content:

   ```yaml theme={null}
   # Replace <HOSTNAME> with the fully qualified domain name of the host server
   # Replace <GID> with the group ID with read-write access to the shared network file system (NFS) volume
   # Replace <SERVER_FQDN> with the address of the shared NFS volume
   # Replace <SERVER_PATH> with the path to the shared NFS volume
   apiVersion: v1
   kind: ConfigMap
   metadata:
     name: anaconda-enterprise-install
   data:
     values: |
       hostname: <HOSTNAME>
       persistence:
         groupID: <GID>
         nfs:
           server: <SERVER_FQDN>
           path: <SERVER_PATH>
   ```

   If you are installing a single-node cluster and you want to use the `/opt/anaconda/storage` volume for managed persistence, the `persistence:` section of the `values.yaml` can be entered as:

   ```yaml theme={null}
   persistence:
     pvc: anaconda-storage
   ```

   <Note>
     The direct use of `/opt/anaconda/storage` for managed persistence works *only* for single-node clusters. It must be replaced with a network file system (NFS) configuration *before* adding additional nodes to the cluster. Otherwise, sessions and deployments launched on the additional nodes will fail to start. For more information, see [managed persistence](/docs/data-science/5.7.1/reference/understanding-ae5#managed-persistence).
   </Note>

9. Run the gravity installation command:

   ```
   # Replace <ADVERTISE-ADDR> with the IP address you want to be visible to the other nodes. If you have a private network and all nodes can communicate on it, use the private IP address for the advertise address
   # Replace <CLUSTERNAME> with the name you're giving to your cluster. Alphanumeric characters and periods only
   # Replace <VALUES_PATH> with the filepath to the values.yaml file you just created
   sudo ./gravity install --advertise-addr=<ADVERTISE-ADDR> --cluster=<CLUSTERNAME> --config <VALUES_PATH> --service-uid=$(id -u) --cloud-provider=generic
   ```

   Here is an example of what the installation command looks like for a single-node cluster:

   ```
   sudo ./gravity install --advertise-addr=192.168.1.1 --cluster=MyCluster --config ./values.yaml --service-uid=$(id -u) --cloud-provider=generic

   ```

   If you are using an alternate `TMPDIR`, prepend the command with this new value. For example:

   ```
   sudo TMPDIR=/mytmp ./gravity install --advertise-addr=192.168.1.1 --cluster=MyCluster --config=./values.yaml --service-uid=$(id -u) --cloud-provider=generic
   ```

   <Warning>
     The `--service-uid` is the service account UID and cannot be a root user. If you are performing a reinstallation of Workbench, you must delete the previous `planet` user prior to setting the new `--service-uid`.
   </Warning>

10. Monitor the progress from the command line. Your output will look like this:

```
* [0/100] starting installer
* [0/100] preparing for installation... please wait
* [0/100] application: AnacondaEnterprise:5.5.x
* [0/100] starting non-interactive install
* [0/100] initializing the operation
* [20/100] configuring packages
* [50/100] installing software

```

1. Allow time for the process to complete (approximately 20-30 minutes).

2. Create a local user account and password to log in to the Gravity Operations Center. To do so, enter the Gravity environment from any of the nodes by running the following command:

   ```
   sudo gravity enter
   ```

3. Create a local user account and password by running the following command:

   ```
   # Replace <EMAIL> with the email address for the account
   # Replace <PASSWORD> with a password for the account. The password must be six characters long
   gravity --insecure user create --type=admin --email=<EMAIL> --password=<PASSWORD> --ops-url=https://gravity-site.kube-system.svc.cluster.local:3009
   ```

4. Inform gravity that you have completed the installation by running the following command from within the Gravity environment:

   ```
   gravity site complete
   ```

5. Proceed to the [post-install configuration steps](./config).

<Note>
  Workbench itself will likely require another 30 minutes or so to fully load. The post-install configuration steps describe how to confirm that this process is fully complete.
</Note>
