---
title: "Install Calico Enterprise on an OpenShift HCP cluster"
description: "Install Calico Enterprise on an OpenShift Hosted Control Planes (HCP) cluster."
product: "Calico Enterprise"
version: "3.21"
section: "Install and upgrade"
canonical_url: "https://docs.tigera.io/calico-enterprise/3.21/getting-started/install-on-clusters/openshift/hostedcontrolplanes"
---

# Install Calico Enterprise on an OpenShift HCP cluster

## Big picture

Install Calico Enterprise on an OpenShift Hosted Control Planes (HCP) cluster.

## Value

Provides steps to install Calico Enterprise in [OpenShift Hosted Control Planes (HCP)](https://docs.redhat.com/en/documentation/openshift_container_platform/latest/html/hosted_control_planes/index) clusters on AWS. The steps follow the Red Hat procedure for [deploying hosted control planes on AWS](https://docs.redhat.com/en/documentation/openshift_container_platform/latest/html/hosted_control_planes/deploying-hosted-control-planes#hcp-deploy-aws), with the changes that Calico Enterprise needs.

## Before you begin

- Ensure that your environment meets the Calico Enterprise [system requirements](https://docs.tigera.io/calico-enterprise/3.21/getting-started/install-on-clusters/openshift/requirements.md).

- Ensure that you have a [Red Hat account](https://cloud.redhat.com/). You need it to get the pull secret that is required to provision an OpenShift cluster. The OpenShift installer supports a subset of AWS regions.

- Ensure that you have an AWS account that is configured for OpenShift 4.

- Install the [AWS CLI](https://aws.amazon.com/cli/) and configure it with credentials for your AWS account.

## How to

### Create the hosting cluster

Deploy an [OpenShift cluster](https://docs.tigera.io/calico-enterprise/3.21/getting-started/install-on-clusters/openshift/installation.md) with Calico Enterprise. This will be the hosting cluster with control-plane nodes for all hosted clusters you deploy with the steps below. Set up your `KUBECONFIG` environment variable to your hosting cluster's kubeconfig file:

```text
export KUBECONFIG=/path/to/kubeconfig
```

### Prepare the hosting cluster for hosted control planes

Set up the hosted control planes feature on the hosting cluster and create the AWS resources that hosted clusters need. Red Hat documents each of these steps.

1. Install the multicluster engine for Kubernetes operator, version 2.5 or later, on the hosting cluster. The multicluster engine operator runs the HyperShift operator for you. If the hosted control planes feature is turned off, [turn it on](https://docs.redhat.com/en/documentation/openshift_container_platform/latest/html/hosted_control_planes/preparing-to-deploy-hosted-control-planes#hcp-enable-manual_hcp-enable-disable).

2. Verify that the `local-cluster` managed cluster exists:

   ```text
   oc get managedclusters local-cluster
   ```

3. [Create the S3 bucket and S3 OIDC secret](https://docs.redhat.com/en/documentation/openshift_container_platform/latest/html/hosted_control_planes/deploying-hosted-control-planes#hcp-aws-create-secret-s3_hcp-deploy-aws).

4. [Create a routable public zone](https://docs.redhat.com/en/documentation/openshift_container_platform/latest/html/hosted_control_planes/deploying-hosted-control-planes#hcp-aws-create-public-zone_hcp-deploy-aws) for the base domain of your hosted clusters.

5. [Create an AWS IAM role and STS credentials](https://docs.redhat.com/en/documentation/openshift_container_platform/latest/html/hosted_control_planes/deploying-hosted-control-planes#hcp-aws-create-role-sts-creds_hcp-deploy-aws). You need the role ARN and the `sts-creds.json` file when you create the hosted cluster. STS credentials expire, so get new ones if yours have expired.

6. Install the `hcp` CLI from the hosting cluster:

   ```text
   oc get consoleclidownload hcp-cli-download -o jsonpath='{range .spec.links[*]}{.text}{"\t"}{.href}{"\n"}{end}'
   ```

   Download the archive for your platform from a link in the output, then extract the `hcp` binary and add it to your `PATH`. For more options, see [Installing the hosted control planes command-line interface](https://docs.redhat.com/en/documentation/openshift_container_platform/latest/html/hosted_control_planes/preparing-to-deploy-hosted-control-planes#hcp-cli).

### Create a hosted cluster

Create a hosted cluster with no default CNI, so that you can install Calico Enterprise on it.

1. Create a HostedCluster and set its HostedCluster.spec.networking.networkType to Other:

> **NOTE:** Make sure to adjust the variables for the command below to the correct values for your cluster, credentials and environment.

```text
HOSTED_CLUSTER_NAME=my-os-hosted-cluster
HOSTED_CLUSTER_NS=clusters
REGION=us-west-2
BASE_DOMAIN=www.example.com
PULL_SECRET="$HOME/.secrets/redhat-pull-secret.txt"
STS_CREDS="$HOME/sts-creds.json"
ROLE_ARN="arn:aws:iam::123456789012:role/hcp-cli-role"

hcp create cluster aws \
  --name $HOSTED_CLUSTER_NAME \
  --infra-id $HOSTED_CLUSTER_NAME \
  --namespace $HOSTED_CLUSTER_NS \
  --node-pool-replicas 3 \
  --base-domain $BASE_DOMAIN \
  --pull-secret $PULL_SECRET \
  --sts-creds $STS_CREDS \
  --role-arn $ROLE_ARN \
  --region $REGION \
  --generate-ssh \
  --network-type Other
```

Wait until the hosted cluster reports `Available`:

```text
oc wait --for=condition=Available --timeout=30m -n $HOSTED_CLUSTER_NS hostedcluster/$HOSTED_CLUSTER_NAME
```

Then use the `hcp` CLI to generate the `kubeconfig` file. Create a separate directory for the hosted cluster, so that you do not mix up configuration and manifests from the hosting and hosted clusters:

```text
mkdir my_hosted_cluster && cd my_hosted_cluster
hcp create kubeconfig --namespace $HOSTED_CLUSTER_NS --name $HOSTED_CLUSTER_NAME > hosted_kubeconfig && export KUBECONFIG=$(pwd)/hosted_kubeconfig
```

Nodes join the hosted cluster over the next few minutes. They show as `NotReady` in `oc get nodes` until you install Calico Enterprise. This is expected.

Then, copy the `aws-creds` secret from the hosting cluster to the hosted cluster. Run this using the hosting cluster kubeconfig to extract the secret to a `yaml` file:

```text
oc get secrets --kubeconfig /path/to/hosting/kubeconfig -n kube-system aws-creds -o yaml > aws-creds.yaml
```

Then import it in the hosted cluster:

```text
oc apply --kubeconfig /path/to/hosted/kubeconfig -f aws-creds.yaml
```

> **NOTE:** There is no need to specify the `--kubeconfig` CLI argument if the hosted cluster's kubeconfig file is configured as the `KUBECONFIG` environment variable in your shell.

### Create a storage class

Calico Enterprise requires storage for logs and reports. Before finishing the installation, you must [create a StorageClass for Calico Enterprise](https://docs.tigera.io/calico-enterprise/3.21/operations/logstorage/create-storage.md).

### Download the Calico Enterprise install manifests

Download the Calico Enterprise manifests for OpenShift:

```bash
mkdir calico
wget -qO- https://downloads.tigera.io/ee/v3.21.9/manifests/ocp.tgz | tar xvz --strip-components=1 -C calico
```

### Add an image pull secret

Update the contents of the secret with the image pull secret provided to you by a Tigera support representative.

For example, if the secret is located at \~/.docker/config.json, run the following commands.

```text
SECRET=$(cat ~/.docker/config.json | tr -d '\n\r\t ' | base64 -w 0)
sed -i "s/SECRET/${SECRET}/" calico/02-pull-secret.yaml
```

### Optionally provide additional configuration

You may want to provide Calico with additional configuration at install-time. For example, BGP configuration or peers. You can use a Kubernetes ConfigMap with your desired Calico resources to set configuration as part of the installation. If you do not need to provide additional configuration, you can skip this section.

To include [Calico resources](https://docs.tigera.io/calico-enterprise/3.21/reference/resources.md) during installation, edit `calico_hosted/02-configmap-calico-resources.yaml` to add your own configuration.

> **NOTE:** If you have a directory with the Calico resources, you can create the file with the command:
>
> ```text
> oc create configmap -n tigera-operator calico-resources \
> --from-file=<resource-directory> --dry-run -o yaml \
> calico/02-configmap-calico-resources.yaml
> ```
>
> With recent versions of oc it is necessary to have a kubeconfig configured or add `--server='127.0.0.1:443'` even though it is not used.

> **NOTE:** If you have provided a `calico-resources` configmap and the tigera-operator pod fails to come up with `Init:CrashLoopBackOff`, check the output of the init-container with `oc logs -n tigera-operator -l k8s-app=tigera-operator -c create-initial-resources`.

### Apply the Calico Enterprise install manifests

Apply the install manifests paying attention to the required order. First apply all necessary manifests to install the Tigera Operator:

```text
cd calico/
ls 00* | xargs -n1 oc apply -f
ls 01* | xargs -n1 oc apply -f
ls 02* | xargs -n1 oc apply -f
```

Then wait until the Tigera Operator has created the CustomResourceDefinitions (CRDs) that the `03*` files need, and the API server has established them. Only then apply the custom resources that install Calico Enterprise on your cluster:

```text
timeout --foreground 600 bash -c "while ! oc get crd installations.operator.tigera.io apiservers.operator.tigera.io; do sleep 5; done"
oc wait --for=condition=Established --timeout=120s crd/installations.operator.tigera.io crd/apiservers.operator.tigera.io
ls 03* | xargs -n1 oc apply -f
```

> **NOTE:** You can safely ignore any `ls: cannot access '0X*': No such file or directory` errors if there's no yaml files with that prefix to be applied.

### Install the Calico Enterprise license

In order to use Calico Enterprise, you must install the license provided to you by Tigera support representative. Before applying the license, wait until the Tigera API server is ready with the following command:

```text
watch oc get tigerastatus
```

Wait until the `apiserver` shows a status of `Available`.

After the Tigera API server is ready, apply the license:

```text
oc create -f </path/to/license.yaml>
```

### Install Calico Enterprise resources

Apply the custom resources for enterprise features.

```bash
oc create -f https://downloads.tigera.io/ee/v3.21.9/manifests/ocp/tigera-enterprise-resources.yaml
```

Apply the Calico Enterprise manifests for the Prometheus operator.

> **NOTE:**
>
> Complete this step only if you are using the Calico Enterprise Prometheus operator (including adding your own Prometheus operator). Skip this step if you are using
>
> [BYO Prometheus](https://docs.tigera.io/calico-enterprise/3.21/operations/monitor/prometheus/support.md)
>
>  that you manage yourself.

```bash
oc create -f https://downloads.tigera.io/ee/v3.21.9/manifests/ocp/tigera-prometheus-operator.yaml
```

You can now monitor progress with the following command:

```text
watch oc get tigerastatus
```

When it shows all components with status `Available`, proceed to the next step.

(Optional) Apply the full CRDs including descriptions.

```bash
oc apply --server-side --force-conflicts -f https://downloads.tigera.io/ee/v3.21.9/manifests/operator-crds.yaml
```

## Next steps

**Recommended**

- [Configure access to the Calico Enterprise web console](https://docs.tigera.io/calico-enterprise/3.21/operations/cnx/access-the-manager.md)
- [Authentication quickstart](https://docs.tigera.io/calico-enterprise/3.21/operations/cnx/authentication-quickstart.md)
- [Configure your own identity provider](https://docs.tigera.io/calico-enterprise/3.21/operations/cnx/configure-identity-provider.md)

**Recommended - Networking**

- The default networking uses IP in IP encapsulation with BGP routing. For all networking options, see [Determine best networking option](https://docs.tigera.io/calico-enterprise/3.21/networking/determine-best-networking.md).

**Recommended - Security**

- [Get started with Calico Enterprise tiered network policy](https://docs.tigera.io/calico-enterprise/3.21/network-policy/policy-tiers/tiered-policy.md)
