Skip to content

Commit

Permalink
fixing ingress support + add readme doc
Browse files Browse the repository at this point in the history
  • Loading branch information
edevosc2c committed Jun 20, 2023
1 parent c0bc273 commit a62bea9
Show file tree
Hide file tree
Showing 5 changed files with 123 additions and 43 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Helm charts for the geonetwork organization

## Datahub

Readme: https://github.com/geonetwork/geonetwork-helm-charts/tree/main/datahub
5 changes: 4 additions & 1 deletion datahub/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@ apiVersion: v2
name: datahub
description: A Helm chart to deploy the datahub application
type: application
version: 0.4.0
version: 0.4.1
appVersion: "1.16.0"
maintainers:
- name: geOrchestra
url: https://www.georchestra.org
87 changes: 87 additions & 0 deletions datahub/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# Datahub

UI of the web application `datahub`.

`datahub` is an application to provide a default, pure and simple UI for metadata and dataset search.

Inspire by Opendata catalogs (CKAN, Opendatasoft), the Hub will host geo and non-geo dataset. It will provide dataviz tool and focuses the experience on the dataset instead of on the metadata.

## Source Code

* https://github.com/geonetwork/geonetwork-ui/tree/main/apps/datahub

## Requirements

Kubernetes: `>=1.14.0-0`

## Dependencies

None

## Installing the Chart

To install the chart with the release name `searxng`

```console
helm repo add geonetwork https://helm-charts.geonetwork-opensource.org
helm repo update
helm install datahub geonetwork/datahub
```

## Uninstalling the Chart

To uninstall the `datahub` deployment

```console
helm uninstall datahub
```

The command removes all the Kubernetes components associated with the chart **including persistent volumes** and deletes the release.

## Configuration

Read through the [values.yaml](./values.yaml) file. It has several commented out suggested values.

Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`.

```console
helm install datahub \
--set replicaCount="2" \
geonetwork/datahub
```

Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart.

```console
helm install datahub geonetwork/datahub -f values.yaml
```

## Datahub configuration

Through the parameter `configuration.git`, you can set a git repository that will be used for configuring datahub.

Both `configuration.config_directory_override` and `configuration.assets_directory_override` are available to specify the directory where datahub should find the configuration.

The default values are `/conf` for the configuration and `/assets` for the assets.

Please refer to the docker documentation for more explanations about this custom configuration: https://github.com/geonetwork/geonetwork-ui/tree/main/apps/datahub#specifying-a-custom-configuration-file

## Values

**Important**: Some values here are not documented because those are obvious parameters that you can find the meaning and the usuability through the Kubernetes configuration: https://kubernetes.io/docs/home/

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| image | object | See values.yaml | Set the docker image to use. |
| configuration | object | See values.yaml | [See above](#datahub-configuration) |
| ingress | object | See values.yaml | Configurations for configuring ingress |

## Changelog

### Version 0.4.1

Fixing ingress support

### Version 0.4.0

Initial version
51 changes: 9 additions & 42 deletions datahub/templates/datahub-ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "helm-datahub.fullname" . -}}
{{- $svcPort := .Values.service.port -}}
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
Expand Down Expand Up @@ -32,59 +33,25 @@ spec:
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts | default (list "") }}
{{- if $.Values.ingress.hosts }}
{{- range .Values.ingress.hosts }}
- host: {{ .host | quote }}
{{- else }}
- host: {{ $.Values.fqdn | quote }}
{{- end }}
http:
paths:
- path: /
{{- range .paths }}
- path: {{ . }}
{{- if semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion }}
pathType: Prefix
{{- end }}
backend:
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
service:
name: {{ include "helm-datahub.fullname" $ }}-sp-svc
name: {{ $fullName }}-datahub-svc
port:
number: 8080
number: {{ $svcPort }}
{{- else }}
serviceName: {{ include "helm-datahub.fullname" $ }}-sp-svc
servicePort: 8080
{{- end }}
{{- if $.Values.helm-datahub.webapps.cas.enabled }}
- path: /cas
{{- if semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion }}
pathType: Prefix
{{- end }}
backend:
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
service:
name: {{ include "helm-datahub.fullname" $ }}-cas-svc
port:
number: 8080
{{- else }}
serviceName: {{ include "helm-datahub.fullname" $ }}-cas-svc
servicePort: 8080
{{- end }}
{{- end }}
{{- if and $.Values.helm-datahub.webapps.geonetwork.enabled $.Values.helm-datahub.webapps.geonetwork.ogc_api_records.enabled }}
- path: /ogc-api-records
{{- if semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion }}
pathType: Prefix
{{- end }}
backend:
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
service:
name: {{ include "helm-datahub.fullname" $ }}-gn4-ogc-api-records-svc
port:
number: 8080
{{- else }}
serviceName: {{ include "helm-datahub.fullname" $ }}-gn4-ogc-api-records-svc
servicePort: 8080
serviceName: {{ $fullName }}
servicePort: {{ $svcPort }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
18 changes: 18 additions & 0 deletions datahub/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,23 @@ configuration:
ref: {}
ssh_secret: {}

ingress:
enabled: true
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
- host: mydatahub.org
paths:
- "/datahub"
tls: []
# - secretName: chart-example-tls
# hosts:
# - mydatahub.org

# define a custom incressClassName, like "traefik" or "nginx"
className: ""

extra_environment: []
# - name: GN4_API_URL
# value: "https://gn4.custom/geonetwork/srv/api"
Expand All @@ -36,6 +53,7 @@ securityContext: {}
service:
type: ClusterIP
port: 80
annotations: {}

#lifecycle:
# postStart:
Expand Down

0 comments on commit a62bea9

Please sign in to comment.