|
| 1 | +--- |
| 2 | +title: Installing Infrahub Enterprise |
| 3 | +--- |
| 4 | + |
| 5 | +import Tabs from '@theme/Tabs'; |
| 6 | +import TabItem from '@theme/TabItem'; |
| 7 | +import ReactPlayer from 'react-player/youtube' |
| 8 | +import ReferenceLink from "../../src/components/Card"; |
| 9 | + |
| 10 | +# Installing Infrahub Enterprise |
| 11 | + |
| 12 | +## Infrahub Enterprise |
| 13 | + |
| 14 | +Enterprise is based off the Community version, with several changes for: |
| 15 | + |
| 16 | +- enterprise features |
| 17 | +- high availability |
| 18 | +- better performance |
| 19 | +- security hardening (Docker image, etc) |
| 20 | + |
| 21 | +Infrahub Enterprise can be deployed the same way as Infrahub Community, using the curl method or using Helm: |
| 22 | + |
| 23 | +- [Quick start via curl](#quick-start-via-curl) |
| 24 | +- [K8s with Helm charts](#k8s-with-helm-charts) |
| 25 | + |
| 26 | +## Hardware requirements |
| 27 | + |
| 28 | +Please ensure the systems on which you want to install Infrahub Enterprise meet the [hardware requirements](../topics/hardware-requirements). |
| 29 | + |
| 30 | +Allocating more CPU cores to the Neo4j database can improve performance since Infrahub Enterprise leverages parallel query execution. |
| 31 | + |
| 32 | +## Quick start via curl |
| 33 | + |
| 34 | +To quickly spin up the latest Infrahub locally, you can retrieve the Docker Compose file from [infrahub.opsmill.io/enterprise](https://infrahub.opsmill.io/enterprise). |
| 35 | + |
| 36 | +### To spin up an Infrahub environment |
| 37 | + |
| 38 | +<Tabs> |
| 39 | +<TabItem value="MacOS" default> |
| 40 | + |
| 41 | +```shell |
| 42 | +curl https://infrahub.opsmill.io/enterprise | docker compose -p infrahub -f - up -d |
| 43 | +``` |
| 44 | + |
| 45 | +</TabItem> |
| 46 | +<TabItem value="Ubuntu"> |
| 47 | + |
| 48 | +```shell |
| 49 | +curl https://infrahub.opsmill.io/enterprise | sudo docker compose -p infrahub -f - up -d |
| 50 | +``` |
| 51 | + |
| 52 | +</TabItem> |
| 53 | +</Tabs> |
| 54 | + |
| 55 | +### To spin down and remove an Infrahub environment |
| 56 | + |
| 57 | +<Tabs> |
| 58 | +<TabItem value="MacOS" default> |
| 59 | + |
| 60 | +```shell |
| 61 | +curl https://infrahub.opsmill.io/enterprise | docker compose -p infrahub -f - down -v |
| 62 | +``` |
| 63 | + |
| 64 | +</TabItem> |
| 65 | +<TabItem value="Ubuntu"> |
| 66 | + |
| 67 | +```shell |
| 68 | +curl https://infrahub.opsmill.io/enterprise | sudo docker compose -p infrahub -f - down -v |
| 69 | +``` |
| 70 | + |
| 71 | +</TabItem> |
| 72 | +</Tabs> |
| 73 | + |
| 74 | +## K8s with Helm charts |
| 75 | + |
| 76 | +Enterprise Helm chart is based of the original Infrahub chart and using it as a Helm dependency. |
| 77 | +Thus most of the configuration related to Infrahub goes inside the `infrahub` top-level key. |
| 78 | + |
| 79 | +<ReferenceLink title="Infrahub Helm Chart" url="https://github.com/opsmill/infrahub-helm/tree/stable/charts/infrahub-enterprise" openInNewTab /> |
| 80 | +<ReferenceLink title="ArtifactHub" url="https://artifacthub.io/packages/helm/infrahub-enterprise/infrahub-enterprise" openInNewTab /> |
| 81 | + |
| 82 | +The following are required for production deployments using Helm: |
| 83 | + |
| 84 | +- data persistence for the database must be enabled |
| 85 | +- multiple replicas of the Infrahub API Server and Infrahub Task workers should be deployed: you can make use of the `affinity` variable to define the affinity policy for the pods |
| 86 | +- S3 storage should be configured for the Infrahub API Server, it is required if you have multiple replicas |
| 87 | + |
| 88 | +:::warning |
| 89 | + |
| 90 | +We do not recommend using the included dependencies (Neo4j, RabbitMQ, Redis) for production. |
| 91 | +They are present to ease deployment on non-production environments. |
| 92 | + |
| 93 | +::: |
| 94 | + |
| 95 | +You can use the following values example: |
| 96 | + |
| 97 | +```yaml |
| 98 | +infrahub: |
| 99 | + infrahubServer: |
| 100 | + replicas: 3 |
| 101 | + affinity: |
| 102 | + podAntiAffinity: |
| 103 | + requiredDuringSchedulingIgnoredDuringExecution: |
| 104 | + - labelSelector: |
| 105 | + matchExpressions: |
| 106 | + - key: service |
| 107 | + operator: In |
| 108 | + values: |
| 109 | + - infrahub-server |
| 110 | + topologyKey: topology.kubernetes.io/zone |
| 111 | + persistence: |
| 112 | + enabled: false |
| 113 | + ingress: |
| 114 | + enabled: true |
| 115 | + infrahubServer: |
| 116 | + env: |
| 117 | + INFRAHUB_ALLOW_ANONYMOUS_ACCESS: "true" |
| 118 | + INFRAHUB_CACHE_PORT: 6379 |
| 119 | + INFRAHUB_CONFIG: /config/infrahub.toml |
| 120 | + INFRAHUB_DB_TYPE: neo4j |
| 121 | + INFRAHUB_LOG_LEVEL: INFO |
| 122 | + INFRAHUB_PRODUCTION: "true" |
| 123 | + INFRAHUB_INITIAL_ADMIN_TOKEN: 06438eb2-8019-4776-878c-0941b1f1d1ec |
| 124 | + INFRAHUB_SECURITY_SECRET_KEY: 327f747f-efac-42be-9e73-999f08f86b92 |
| 125 | + INFRAHUB_STORAGE_DRIVER: s3 |
| 126 | + AWS_ACCESS_KEY_ID: xxxx |
| 127 | + AWS_SECRET_ACCESS_KEY: xxxx |
| 128 | + AWS_S3_BUCKET_NAME: infrahub-data |
| 129 | + AWS_S3_ENDPOINT_URL: https://s3 |
| 130 | + |
| 131 | + infrahubTaskWorker: |
| 132 | + replicas: 3 |
| 133 | + affinity: |
| 134 | + podAntiAffinity: |
| 135 | + requiredDuringSchedulingIgnoredDuringExecution: |
| 136 | + - labelSelector: |
| 137 | + matchExpressions: |
| 138 | + - key: service |
| 139 | + operator: In |
| 140 | + values: |
| 141 | + - infrahub-task-worker |
| 142 | + topologyKey: topology.kubernetes.io/zone |
| 143 | + |
| 144 | + neo4j: |
| 145 | + services: |
| 146 | + admin: |
| 147 | + enabled: true |
| 148 | + volumes: |
| 149 | + data: |
| 150 | + mode: dynamic |
| 151 | + dynamic: |
| 152 | + storageClassName: premium-rwo |
| 153 | + requests: |
| 154 | + storage: 100Gi |
| 155 | +``` |
| 156 | +
|
| 157 | +```shell |
| 158 | +helm install infrahub -f values.yml path/to/infrahub-enterprise/chart |
| 159 | +``` |
| 160 | + |
| 161 | +You can also install the chart using the OpsMill registry. |
| 162 | + |
| 163 | +```shell |
| 164 | +helm install infrahub -f values.yml oci://registry.opsmill.io/opsmill/chart/infrahub-enterprise |
| 165 | +``` |
| 166 | + |
| 167 | +## Backup and Restore Infrahub Enterprise |
| 168 | + |
| 169 | +Backing Infrahub Enterprise up consists of: |
| 170 | + |
| 171 | +1. Backup the Neo4j database |
| 172 | + |
| 173 | + You can use the following tools to backup the Neo4j database: [Database Backup](./database-backup) |
| 174 | + Thanks to Neo4j Enterprise, you can leverage the online backup feature that does not require stopping the database. |
| 175 | + |
| 176 | +2. Backup the artifact store |
| 177 | + |
| 178 | + Either the S3 bucket or the local filesystem, accordingly. |
| 179 | + |
| 180 | +3. Backup the Prefect database (task logs, etc) |
| 181 | + |
| 182 | + You can use standard Postgresql tools like pg_dump |
| 183 | + For example, when running using docker compose: |
| 184 | + |
| 185 | +`docker exec -it infrahub-task-manager-db-1 pg_dump -Fc -d prefect -U postgres > prefect.dump` |
| 186 | + |
| 187 | +Restoring Infrahub Enterprise consists of: |
| 188 | + |
| 189 | +1. Starting Infrahub |
| 190 | +2. Restoring the Neo4j database ([Database Restore](./database-backup#restore-a-backup-on-a-non-default-cypher-port)) |
| 191 | +3. Restoring the artifact store |
| 192 | +4. Restoring the Prefect database |
| 193 | + |
| 194 | + For example, when running using docker compose: |
| 195 | + |
| 196 | + `docker exec -it infrahub-task-manager-db-1 pg_restore -d prefect -U postgres --clean --create prefect.dump` |
| 197 | + |
| 198 | + Then restart the task manager (Prefect server) |
| 199 | + |
| 200 | +5. Restarting Infrahub (API servers, then task workers) |
| 201 | + |
| 202 | +## High Availability |
| 203 | + |
| 204 | +[High Availability Architecture](../topics/architecture#infrahub-high-availability-deployment) |
0 commit comments