Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/documentation #1

Draft
wants to merge 4 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions README-Kubernetes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

1. [Docker credentials](#docker-credentials)
2. [Routing](#routing)
2. [Instance setup](#instance-setup)
3. [Instance setup](#instance-setup)

## Pre-requisites

Expand Down Expand Up @@ -33,7 +33,7 @@ web:

## Routing

Before installing you need to configure a few things in a
Before installing, you need to configure a few things in a
`values-overrides.yaml` file.

```yaml
Expand All @@ -43,11 +43,11 @@ ingress:

The ingress is configured using the following variables:

Parameter | Description | Default
----------|-------------|--------
`ingress.enabled` | Whether to enable ingress | `true`
`ingress.class` | Class of the ingress if enabled | `nginx-internal`
`ingress.sslSecretName` | The ingress ssl secret for HTTPS | `your-ssl-secret`
| Parameter | Description | Default |
|-------------------------|----------------------------------|-------------------|
| `ingress.enabled` | Whether to enable ingress | `true` |
| `ingress.class` | Class of the ingress if enabled | `nginx-internal` |
| `ingress.sslSecretName` | The ingress ssl secret for HTTPS | `your-ssl-secret` |

## Instance setup

Expand All @@ -58,15 +58,15 @@ kubectl get pods --namespace invenio
kubectl exec -it <web-pod> bash --namespace invenio # <web-pod> is found with the previous command
```

Then you can run invenio commands and setup your instance
Then you can run invenio commands and set up your instance

```bash
. scl_source enable rh-python36
invenio db init # If the db does not exist already
invenio db create
invenio index init
invenio index queue init purge
invenio files location --default 'default-location' $(invenio shell --no-term-title -c "print(app.instance_path)")'/data'
invenio files location --default 'default-location' $(invenio shell --no-term-title -c "print(app.instance_path)")'/data'
invenio roles create admin
invenio access allow superuser-access role admin
invenio rdm-records demo
Expand Down
35 changes: 20 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# [Beta] Invenio Helm Chart
# [Beta] Invenio Helm Chart v. 0.2.1

This repository contains the helm chart to deploy an Invenio instance.

Expand All @@ -21,6 +21,16 @@ change.
- [Kubernetes](README-Kubernetes.md)
- [OpenShift](README-OpenShift.md)

## Dependencies
This Helm chart uses Bitnami charts as [dependencies](https://helm.sh/docs/chart_best_practices/dependencies/)
for the following exact pinned versions:
* Opensearch 1.0.0 ([values.yaml](https://github.com/bitnami/charts/blob/opensearch/1.0.0/bitnami/opensearch/values.yaml))
* PostgreSQL 14.0.1 ([values.yaml](https://github.com/bitnami/charts/blob/postgresql/14.0.1/bitnami/postgresql/values.yaml))
* RabbitMQ 12.9.3 ([values.yaml](https://github.com/bitnami/charts/blob/rabbitmq/12.9.3/bitnami/rabbitmq/values.yaml))
* Redis 18.12.0 ([values.yaml](https://github.com/bitnami/charts/blob/redis/18.12.0/bitnami/redis/values.yaml))

Each one of them has a persistent volume claim for 8gb by default. Note that by default Redis will spin up 3 replicas.

## Configuration

:warning: Before installing you need to configure two things in your
Expand All @@ -30,7 +40,7 @@ change.
- The web/worker docker images. If you need credentials you can see how to set
them up in [Kubernetes](README-Kubernetes/#docker-credentials).

``` yaml
```yaml
host: yourhost.localhost

web:
Expand All @@ -52,21 +62,16 @@ invenio:
demo_data: true # for a demo set of records
default_users: # for creating users on install
"[email protected]": "password"
secret-key: "my-very-safe-secret"
secret_key: "my-very-safe-secret"

rabbitmq:
default_password: "mq_password"
# Edit the following URI with the values from just above
celery_broker_uri: "amqp://guest:mq_password@mq:5672/"
auth:
password: "mq_password"

postgresql:
user: "invenio"
password: "db_password"
host: "db"
port: "5432"
database: "invenio"
# Edit the following URI with the values from just above
sqlalchemy_db_uri: "postgresql+psycopg2://invenio:db_password@db:5432/invenio"
auth:
password: "db_password"

```

It's however **strongly advised** to override them either through a value file
Expand All @@ -80,8 +85,8 @@ flags can be used in the same command.
```bash
DB_PASSWORD=$(openssl rand -hex 8)
helm install -f safe-values.yaml \
--set search.password=$SEARCH_PASSWORD \
--set postgresql.password=$DB_PASSWORD \
--set rabbitmq.auth.password=$RABBITMQ_PASSWORD \
--set postgresql.auth.password=$DB_PASSWORD \
invenio ./invenio-k8s --namespace invenio
```

Expand Down
8 changes: 6 additions & 2 deletions charts/invenio/templates/install-init-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,17 @@ metadata:
"helm.sh/hook": post-install
"helm.sh/hook-weight": "1"
{{/* "helm.sh/hook-delete-policy": hook-succeeded*/}}
{{- $cmd := "invenio db init && invenio db create && invenio index init && invenio index queue init purge && invenio files location --default 'default-location' $(invenio shell --no-term-title -c \"print(app.instance_path)\")'/data' && invenio roles create admin && invenio access allow superuser-access role admin" -}}
{{- $cmd := "invenio db init && invenio db create && invenio index init && invenio index queue init purge && invenio files location --default 'default-location' $(invenio shell --no-term-title -c \"print(app.instance_path)\")'/data' && invenio roles create admin && invenio access allow superuser-access role admin" -}}
{{- range $usr, $pass := .Values.invenio.default_users -}}
{{- $cmd = printf "%s && invenio users create --active --password=%s %s" $cmd $pass $usr -}}
{{- $cmd = printf "%s && invenio users create --active --confirm --password=%s %s" $cmd $pass $usr -}}
{{- end -}}
{{- if and .Values.invenio.demo_data .Values.invenio.default_users -}}
{{- $cmd = cat $cmd "&& invenio rdm-records demo" -}}
{{- end -}}
{{- if .Values.invenio.create_fixtures -}}
{{- $cmd = cat $cmd "&& invenio rdm-records fixtures" -}}
{{- end -}}


spec:
template:
Expand Down
9 changes: 9 additions & 0 deletions charts/invenio/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ invenio:
init: false
default_users: [] # Requires invenio.init=true
demo_data: false # Setting invenio.demo_data=true requires also setting default_users!
create_fixtures: false # Also requires invenio.init=true. Indexing can take several minutes!!
sentry:
enabled: false
existing_secret: false
Expand Down Expand Up @@ -185,6 +186,8 @@ redis:
requests:
cpu: 500m
memory: 500Mi
persistence:
size: 8Gi

rabbitmq:
enabled: true
Expand All @@ -197,6 +200,8 @@ rabbitmq:
requests:
cpu: "1"
memory: 2Gi
persistence:
size: 8Gi

rabbitmqExternal: {}

Expand All @@ -220,11 +225,15 @@ postgresql:
auth:
username: invenio
database: invenio
persistence:
size: 8Gi

postgresqlExternal: {}

opensearch:
enabled: true
persistence:
size: 8Gi

externalOpensearch: {}

Expand Down