# Install APISIX on ROSA

[Red Hat OpenShift Service on AWS (ROSA)](https://aws.amazon.com/rosa/) is a fully managed service that provides a simplified way to deploy and manage OpenShift clusters on AWS.

## Prerequisite(s)[​](#prerequisites "Direct link to Prerequisite(s)")

* Have an AWS account

* Have a Red Hat account

* Follow the [Getting started with ROSA](https://cloud.redhat.com/learn/getting-started-red-hat-openshift-service-aws-rosa) learning path to

  <!-- -->

  * Set up AWS with OpenShift
  * Deploy a cluster
  * Grant the cluster admin rights to a user

* Install [ROSA CLI](https://console.redhat.com/openshift/downloads)

* Install [OpenShift CLI](https://docs.redhat.com/en/documentation/openshift_container_platform/4.11/html/cli_tools/openshift-cli-oc#cli-installing-cli_cli-developer-commands) and [log in](https://docs.redhat.com/en/documentation/openshift_container_platform/4.11/html/cli_tools/openshift-cli-oc#cli-logging-in_cli-developer-commands) with the credentials of the user with cluster admin rights

* Install [Helm CLI](https://helm.sh/docs/intro/install/)

* Install [cURL](https://curl.se/) to verify the gateway through a local port-forward

## Create an OpenShift Project and Service Account[​](#create-an-openshift-project-and-service-account "Direct link to Create an OpenShift Project and Service Account")

Log in OpenShift CLI using the user account with cluster admin rights:

```
oc login <cluster-url> --username <username> --password <password>
```

Create an OpenShift project for APISIX:

```
oc new-project apisix
```

Switch the default project to `apisix`:

```
oc project apisix
```

Create a service account `apisix-sa` for APISIX deployment:

```
oc create sa apisix-sa
```

Add the [security context constraint (SCC)](https://docs.openshift.com/container-platform/4.16/authentication/managing-security-context-constraints.html) `nonroot-v2` to the service account:

```
oc adm policy add-scc-to-user nonroot-v2 -z apisix-sa
```

## Install with Helm[​](#install-with-helm "Direct link to Install with Helm")

Add APISIX Helm repository and update:

```
helm repo add apisix https://apache.github.io/apisix-helm-chart

helm repo update
```

Install the APISIX Helm chart with the release image:

```
helm install apisix apisix/apisix \

  --version 2.18.3 \

  --set image.tag=3.20.0-ubuntu \

  --set service.type=NodePort \

  --set etcd.podSecurityContext.enabled=false \

  --set etcd.containerSecurityContext.enabled=false \

  --set serviceAccount.name=apisix-sa
```

❶ Disable `podSecurityContext` and `containerSecurityContext` for etcd to avoid running into [issues related to SCC](https://github.com/bitnami/charts/issues/12215).

❷ Deploy with the service account `apisix-sa` to grant APISIX the required permissions.

If successful, you should see a response similar to the following:

```
NAME: apisix

LAST DEPLOYED: Wed May 24 07:56:25 2023

NAMESPACE: apisix

STATUS: deployed
```

## Verify Installation[​](#verify-installation "Direct link to Verify Installation")

Check pod statuses to make sure all pods are up and running:

```
oc get pod
```

The response should be similar to the following with all pods `Running`:

```
NAME                      READY   STATUS    RESTARTS   AGE

apisix-5899557df4-5wgcn   1/1     Running   0          6m33s

apisix-etcd-0             1/1     Running   0          6m33s

apisix-etcd-1             1/1     Running   0          6m33s

apisix-etcd-2             1/1     Running   0          6m33s
```

Forward the gateway Service's HTTP port to your local machine:

```
oc port-forward service/apisix-gateway 9080:80
```

Keep the port-forward running. In another terminal, send a request to APISIX:

```
curl -sI "http://127.0.0.1:9080" | grep Server
```

You should see the configured APISIX version in the response:

```
Server: APISIX/3.20.0
```

You have now successfully installed APISIX on ROSA.
