Skip to content

Commit 22dce33

Browse files
committed
feat(docs): add enterprise install guide
Signed-off-by: Fatih Acar <[email protected]>
1 parent b9fd448 commit 22dce33

File tree

5 files changed

+211
-2
lines changed

5 files changed

+211
-2
lines changed

.vale/styles/spelling-exceptions.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,9 @@ order_weight
9696
openconfig
9797
opentelemetry
9898
order_by
99+
pg_dump
99100
Postgress
101+
Postgresql
100102
Prefetch
101103
profile_name
102104
pseudocode

development/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ COPY docs/package.json docs/package-lock.json /docs/
5858
COPY backend/infrahub/config.py /backend/infrahub/
5959
COPY models/ /models/
6060
COPY python_sdk/docs/docs/python-sdk/examples/ /python_sdk/examples/
61+
COPY development/ /development/
6162
WORKDIR /docs
6263

6364
RUN npm install --omit=dev
Lines changed: 204 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,204 @@
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)

docs/docs/guides/installation.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,13 +223,14 @@ The default devcontainer `.devcontainer/devcontainer.json` launches Infrahub wit
223223

224224
A first version of our K8S helm-chart is available in our repository.
225225

226-
<ReferenceLink title="Infrahub Helm Chart" url="https://github.com/opsmill/infrahub/tree/stable/helm" openInNewTab />
226+
<ReferenceLink title="Infrahub Helm Chart" url="https://github.com/opsmill/infrahub-helm/tree/stable/charts/infrahub" openInNewTab />
227+
<ReferenceLink title="ArtifactHub" url="https://artifacthub.io/packages/helm/infrahub/infrahub" openInNewTab />
227228

228229
The following are required for production deployments using Helm:
229230

230231
* data persistence for the database must be enabled
231232
* 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
232-
* S3 storage should be configured for the Infrahub API Server
233+
* S3 storage should be configured for the Infrahub API Server, it is required if you have multiple replicas
233234

234235
:::warning
235236

docs/sidebars.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ const sidebars: SidebarsConfig = {
6464
},
6565
items: [
6666
'guides/installation',
67+
'guides/installation-enterprise',
6768
'guides/create-schema',
6869
'guides/import-schema',
6970
'guides/menu',

0 commit comments

Comments
 (0)