# Provisioner installation

After completing all cluster prerequisites, you can proceed with executing the PerfectScale provisioner, which will install all PerfectScale's services and infrastructure elements in your Kubernetes cluster. Follow the steps below to install the Provisioner and start leveraging PerfectScale’s insights within your environment.

## Installation

### Step 1: Get installation files

To provision the self-hosted environment, you'll need the **provisioner binary**, **helmfile.yaml**, **config.yaml**, and **tenant\_id**. To obtain the needed files, please contact us at <support@perfectscale.io>.

{% hint style="info" %}
Make sure to save both the **provisioner binary,** **helmfile.yaml**, and **config.yaml** in the same directory on your system.
{% endhint %}

### Step 2: Create a dedicated namespace

Create a namespace for the on-premises installation:

```yaml
kubectl create ns <namespace_name> # replace "namespace_name" with your namespace name
```

### Step 3: Configure installation parameters

Create a *config.yaml* file in the same directory as your Binary installation file and Helmfile

<pre class="language-yaml"><code class="lang-yaml">access_key: 
secret_key: 
suffix_url: "DNS name"
tenant_id: "vendor_tenant_id" # provided by PerfectScale
namespace: &#x3C;namespace_name>
kube_context: &#x3C;k8s_cluster_context>
kube_config: &#x3C;path_to_kubeconfig_file>
<strong>helmfile: "helmfile.yaml" # provided by PerfectScale
</strong></code></pre>

{% hint style="info" %}
Other configuration provisioning options include:

* [Installing the provisioner with FluxCD](https://docs.perfectscale.io/2.0-self-hosted-or-perfectscale-documentation/getting-started/provisioner-installation-with-fluxcd)
* [Installing the provisioner with Managed Postgres](https://docs.perfectscale.io/2.0-self-hosted-or-perfectscale-documentation/getting-started/provisioner-installation-with-managed-postgres)
  {% endhint %}

### Step 4: Run the Provisioner install sub-command

Navigate to the directory where your config.yaml, Binary installation file, and Helmfile  are located, and execute the following installation command:

```yaml
./provisioner install
```

After completing these steps, the installation process will begin in your terminal.

{% hint style="info" %}
The process can take about half an hour. If there are any issues, environment provisioning will stop. Check the logs for the reason of failure and either resolve it or reach out to support at <support@perfectscale.io>.
{% endhint %}

## Accessing PerfectScale WebApp UI <a href="#accessing-perfectscale-webapp-ui" id="accessing-perfectscale-webapp-ui"></a>

In order to access PerfectScale WebApp, you need to get the WebApp URL. Run the following command to retrieve the WebApp URL and get the credentials:

```yaml
./provisioner get-login
```

You now possess all the necessary data to access your PerfectScale account, including the ingress URL, username, password, etc.

## Advanced configuration options

The following advanced configurations are available:

* [SSO integration](https://docs.perfectscale.io/2.0-self-hosted-or-perfectscale-documentation/administration/security/sso)
* [SMTP server configuration](https://docs.perfectscale.io/2.0-self-hosted-or-perfectscale-documentation/administration/smtp-provider-configuration)

## Troubleshooting

If you encounter a `403 Forbidden` error during installation, run the following command:

```
helm registry logout public.ecr.aws
```

## Uninstall PerfectScale

There may be situations where you need to uninstall the PerfectScale provisioner. In order to remove all provisioned components, run the provisioner uninstall command using the same `kubeconfig` and `kubecontext` as the original cluster.

```
./provisioner uninstall
```
