Skip to content
Merged
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,6 @@ dist

# keycloak mounted volume
scripts/keycloak/data/*

# ignore clowder chart deps
charts/clowder2/charts
62 changes: 62 additions & 0 deletions charts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Clowder 2

This depends on some subcharts, make sure to have them installed if you plan on modifying the helm chart:

```bash
helm repo add bitnami https://charts.bitnami.com/bitnami
helm dep build
```

The chart has some common values, if you want to run this on your local machine you can use the following values (*.clowder2.ncsa.cloud is an DNS record that points to 127.0.0.1):

```yaml
minio:
ingress:
hostname: minio.clowder2.ncsa.cloud
apiIngress:
hostname: minio.clowder2.ncsa.cloud

rabbitmq:
ingress:
hostname: rabbitmq.clowder2.ncsa.cloud
```

Now you can install (or upgrade) clowder using:
```bash
helm upgrade --install --namespace clowder2 --create-namespace --values local.yaml clowder2 .
```



# Docker Desktop

You will need an ingress controller, I like Traefik as my ingress controller. You install this with:

```bash
helm install --namespace traefik --create-namespace traefik traefik/traefik
```

If you want to enable the dashboard, you need the following file (dashboard.yaml):

```yaml
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: dashboard
spec:
entryPoints:
- web
routes:
- match: Host(`traefik.clowder2.ncsa.cloud`)
kind: Rule
services:
- name: api@internal
kind: TraefikService
```

and apply it using:

```bash
kubectl -n traefik apply -f dashboard.yaml
```

23 changes: 23 additions & 0 deletions charts/clowder2/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
18 changes: 18 additions & 0 deletions charts/clowder2/Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
dependencies:
- name: mongodb
repository: https://charts.bitnami.com/bitnami
version: 12.1.31
- name: minio
repository: https://charts.bitnami.com/bitnami
version: 11.10.3
- name: rabbitmq
repository: https://charts.bitnami.com/bitnami
version: 10.3.6
- name: elasticsearch
repository: https://charts.bitnami.com/bitnami
version: 19.4.2
- name: keycloak
repository: https://charts.bitnami.com/bitnami
version: 10.1.2
digest: sha256:0c0e022885173885dfd6097d9a39dc22082515c41b93cda8cf9756a5d019a84f
generated: "2022-09-30T15:19:12.308156-05:00"
57 changes: 57 additions & 0 deletions charts/clowder2/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
apiVersion: v2
type: application

# Information about clowder.
name: clowder2
icon: https://isda.ncsa.illinois.edu/~kooper/charts/images/clowder.png
home: https://clowderframework.org/
description: >
Open Source Data Management for Long Tail Data. Clowder is a customizable and
scalable data management framework to support any data format and multiple
research domains.

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "main"

# List of people that maintain this helm chart.
maintainers:
- name: Rob Kooper
email: [email protected]
- name: Chen Wang
email: [email protected]

# location of source code
sources:
- https://github.com/clowder-framework/clowder2

# Dependencies for clowder. Some of the dependencies are only installed if they
# are enabled.
dependencies:
- name: mongodb
version: ~12
repository: https://charts.bitnami.com/bitnami
condition: mongodb.enabled
- name: minio
version: ~11
repository: https://charts.bitnami.com/bitnami
condition: minio.enabled
- name: rabbitmq
version: ~10
repository: https://charts.bitnami.com/bitnami
condition: rabbitmq.enabled
- name: elasticsearch
version: ~19
repository: https://charts.bitnami.com/bitnami
condition: elasticsearch.enabled
- name: keycloak
version: ~10
repository: https://charts.bitnami.com/bitnami
condition: keycloak.enabled
14 changes: 14 additions & 0 deletions charts/clowder2/dashboard.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# dashboard.yaml
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: dashboard
spec:
entryPoints:
- web
routes:
- match: Host(`traefik.clowder2.ncsa.cloud`) && (PathPrefix(`/dashboard`) || PathPrefix(`/api`))
kind: Rule
services:
- name: api@internal
kind: TraefikService
Binary file added charts/clowder2/files/clowder-theme.tgz
Binary file not shown.
22 changes: 22 additions & 0 deletions charts/clowder2/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
1. Get the application URL by running these commands:
{{- if .Values.ingress.enabled }}
{{- range $host := .Values.ingress.hosts }}
{{- range .paths }}
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
{{- end }}
{{- end }}
{{- else if contains "NodePort" .Values.frontend.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "clowder2.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.frontend.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "clowder2.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "clowder2.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
echo http://$SERVICE_IP:{{ .Values.frontend.service.port }}
{{- else if contains "ClusterIP" .Values.frontend.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "clowder2.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
{{- end }}
62 changes: 62 additions & 0 deletions charts/clowder2/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "clowder2.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "clowder2.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "clowder2.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "clowder2.labels" -}}
helm.sh/chart: {{ include "clowder2.chart" . }}
{{ include "clowder2.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "clowder2.selectorLabels" -}}
app.kubernetes.io/name: {{ include "clowder2.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "clowder2.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "clowder2.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
90 changes: 90 additions & 0 deletions charts/clowder2/templates/backend/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "clowder2.fullname" . }}-backend
labels:
{{- include "clowder2.labels" . | nindent 4 }}
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
selector:
matchLabels:
app.kubernetes.io/name: {{ include "clowder2.name" . }}-backend
app.kubernetes.io/instance: {{ .Release.Name }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
app.kubernetes.io/name: {{ include "clowder2.name" . }}-backend
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "clowder2.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: backend
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.backend.image.repository }}:{{ .Values.backend.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.backend.image.pullPolicy }}
env:
- name: WEB_CONCURRENCY
value: "4"
- name: MINIO_SERVER_URL
value: {{ include "clowder2.name" . }}-minio-headless:9000
- name: MONGODB_URL
value: mongodb://{{ include "clowder2.name" . }}-mongodb:27017
- name: CLOWDER2_URL
value: http://{{ .Values.hostname }}
- name: auth_base
value: $(CLOWDER2_URL)
- name: auth_url
value: $(CLOWDER2_URL)/keycloak/realms/clowder/protocol/openid-connect/auth?client_id=clowder2-backend&response_type=code
- name: oauth2_scheme_auth_url
value: http://{{ include "clowder2.name" .}}-keycloak-headless:8080/keycloak/realms/clowder/protocol/openid-connect/auth?client_id=clowder2-backend&response_type=code
- name: auth_register_url
value: $(CLOWDER2_URL)/keycloak/realms/clowder/protocol/openid-connect/registrations?client_id=clowder2-backend&response_type=code
- name: auth_token_url
value: http://{{ include "clowder2.name" .}}-keycloak-headless:8080/keycloak/realms/clowder/protocol/openid-connect/token
- name: auth_server_url
value: http://{{ include "clowder2.name" .}}-keycloak-headless:8080/keycloak/
- name: keycloak_base
value: $(CLOWDER2_URL)/api
- name: frontend_url
value: $(CLOWDER2_URL)
- name: elasticsearch_url
value: http://{{ include "clowder2.name" . }}-elasticsearch:9200
ports:
- name: http
containerPort: 80
protocol: TCP
livenessProbe:
httpGet:
path: /
port: http
readinessProbe:
httpGet:
path: /
port: http
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
Loading