> For the complete documentation index, see [llms.txt](https://docs.wproofreader.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.wproofreader.com/v6.18.1/deployment/installation/kubernetes/install-admin-panel.md).

# Install Admin-panel

Install Admin-panel with Helm and check its health.

On this page, you install Admin-panel with the [admin-panel-helm](https://github.com/WebSpellChecker/admin-panel-helm) chart. Admin-panel runs as three parts from one image:

* **Web**: the web application.
* **Worker**: runs background jobs, for example invitation emails.
* **Scheduler**: runs maintenance tasks every hour.

Before each install and upgrade, the chart runs a migration Job. The Job creates or updates the tables in `admin_panel_db`.

Before you start, load the settings in your terminal:

```bash
cd ~/wproofreader-k8s
source wsc-stack.env
```

{% stepper %}
{% step %}

#### Create the Admin-panel Secret

```bash
kubectl -n wsc create secret generic admin-panel-secrets \
  --from-literal=APP_KEY="${APP_KEY}" \
  --from-literal=DB_PASSWORD="${ADMIN_PANEL_DB_PASSWORD}" \
  --from-literal=SERVICE_DB_PASSWORD="${SERVICE_DB_PASSWORD}"

kubectl -n wsc describe secret admin-panel-secrets
```

The output lists `APP_KEY`, `DB_PASSWORD`, and `SERVICE_DB_PASSWORD`. It does not show their values.
{% endstep %}

{% step %}

#### Create the values file

This command creates `admin-panel-values.yaml`. It connects Admin-panel to both databases and to WProofreader Server.

```bash
cat > admin-panel-values.yaml <<EOF
config:
  appUrl: http://127.0.0.1:8080
  appServerUrl: http://127.0.0.1:8081/wscservice/api
  appServerInternalUrl: http://wproofreader-app.wsc.svc.cluster.local/wscservice/api
  db:
    host: ${MYSQL_HOST}
    port: 3306
    database: admin_panel_db
    username: admin_panel
  serviceDb:
    host: ${MYSQL_HOST}
    port: 3306
    database: cloud_service
    username: app_service
  mail:
    mailer: log
secrets:
  existingSecret: admin-panel-secrets
EOF
```

The `127.0.0.1` addresses let you check the installation from your workstation. You change them to the public address in [Set up external access](/v6.18.1/deployment/installation/kubernetes/set-up-external-access.md).

With `mailer: log`, Admin-panel does not send email. You can share invitation links manually. To send email, see the SMTP settings in the [Admin-panel environment variables](https://github.com/WebSpellChecker/admin-panel-helm/blob/main/docs/ENVIRONMENT_VARIABLES.md).
{% endstep %}

{% step %}

#### Check the chart and values

```bash
helm lint ./admin-panel-helm/admin-panel \
  --values admin-panel-values.yaml
helm template admin-panel ./admin-panel-helm/admin-panel \
  --namespace wsc \
  --values admin-panel-values.yaml \
  > /tmp/admin-panel-rendered.yaml
helm install admin-panel ./admin-panel-helm/admin-panel \
  --namespace wsc \
  --values admin-panel-values.yaml \
  --dry-run=server \
  --hide-secret
```

The lint command shows `1 chart(s) linted, 0 chart(s) failed`. The dry run shows `STATUS: pending-install` and does not install Admin-panel.
{% endstep %}

{% step %}

#### Install Admin-panel

```bash
helm upgrade --install admin-panel ./admin-panel-helm/admin-panel \
  --namespace wsc \
  --values admin-panel-values.yaml \
  --atomic \
  --timeout 10m
```

The command shows `STATUS: deployed` when all parts are ready.

{% hint style="warning" %}
If the install fails, `--atomic` removes the release. It does not undo database migrations.
{% endhint %}
{% endstep %}

{% step %}

#### Check the installation

```bash
kubectl -n wsc get pods --selector app.kubernetes.io/instance=admin-panel
helm test admin-panel --namespace wsc
```

The three Pods show `Running` and `1/1`. The test shows `Phase: Succeeded`.
{% endstep %}
{% endstepper %}

### If the install fails

Read the log of the migration Job:

```bash
kubectl -n wsc logs job/admin-panel-migrate --all-containers
```

Common causes are an incorrect MySQL host or password, and a missing key in the `admin-panel-secrets` Secret. For more causes, see the [Admin-panel operator guide](https://github.com/WebSpellChecker/admin-panel-helm/blob/main/docs/README.md#failure-guide).

### Next step

[Create the first administrator](/v6.18.1/deployment/installation/kubernetes/create-the-first-administrator.md)
