Skip to content

Commit

Permalink
set up helm release (#912)
Browse files Browse the repository at this point in the history
* set up helm release

* update GH

* syntax

* try again

* update on part of the action

* switch bitnami repo

* add readme

* use env to replace set output which will be deprecated soon

* fix typos

* more changes

* debugging

* enable default so helm template can build correctly on the GH action sever

* more defaults

* remove release to github part since we are manually release clowder for now

* test release

* experimenting current folder

* point to working directory

* hardcode

* add condition back

* switch to release published

* Update helm-release.yaml

only keep the release part
  • Loading branch information
longshuicy authored Feb 8, 2024
1 parent 962010a commit 64afb8d
Show file tree
Hide file tree
Showing 4 changed files with 215 additions and 12 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/helm-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Release Helm Charts

defaults:
run:
working-directory: deployments/kubernetes/charts/clowder2

on:
release:
types: [published]

env:
MAIN_REPO: clowder-framework/clowder2

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Get dependencies
run: |
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo add ncsa https://opensource.ncsa.illinois.edu/charts
helm dep build
- name: Get release info
id: release_info
run: |
version="$(awk '/^version:/ { print $2} ' Chart.yaml)"
changelog="$(sed -e "1,/^### ${version}/d" -e "/^###/,\$d" -e '/^$/d' README.md)"
changelog="${changelog//'%'/'%25'}"
changelog="${changelog//$'\n'/'%0A'}"
changelog="${changelog//$'\r'/'%0D'}"
echo "version=${version}" >> $GITHUB_ENV
echo "changelog=${changelog}" >> $GITHUB_ENV
echo "version: ${version}"
echo "changelog: ${changelog}"
- name: Print Github Info
run: |
echo "github.event_name: ${{ github.event_name }}"
echo "github.repository: ${{ github.repository }}"
echo "github.ref: ${{ github.ref }}"
- name: run helm template
run: helm template .

- name: Publish to NCSA OpenSource
if: |
github.event_name != 'pull_request'
&& github.repository == env.MAIN_REPO
uses: bsord/[email protected]
with:
username: ${{ secrets.HELM_USERNAME }}
password: ${{ secrets.HELM_PASSWORD }}
registry-url: "https://opensource.ncsa.illinois.edu/charts"
chart-folder: "deployments/kubernetes/charts/clowder2"
force: true
4 changes: 2 additions & 2 deletions deployments/kubernetes/charts/clowder2/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ description: >
# 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.1
version: 1.9.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"
appVersion: "v2.0.0-beta.1"

# List of people that maintain this helm chart.
maintainers:
Expand Down
141 changes: 141 additions & 0 deletions deployments/kubernetes/charts/clowder2/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
# Clowder v2 Helm Charts

Helm charts depend 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; you can overwrite with your own values following below examples:

```yaml
# helm upgrade --namespace clowder2 --values clowder2-software-dev.yaml clowder2 clowder2

hostname: { your hostname. E.g. clowder2.software-dev.ncsa.illinois.edu }

frontend:
image:
repository: clowder/clowder2-frontend
tag: 2.0.0-beta.1
pullPolicy: Always

backend:
image:
repository: clowder/clowder2-backend
tag: 2.0.0-beta.1
pullPolicy: Always

geoserver:
enabled: true
username: { your geoserver username }
password: { your geoserver password }
persistence:
storageClass: { your storage class name }
size: { your geoserver storage size e.g. 8Gi }
ingress:
hostname: { your hostname }

minio:
auth:
rootUser: { your minio username }
rootPassword: { your minio password }
persistence:
storageClass: { your storage class name }
size: { your minio storage size e.g. 20Gi }
ingress:
hostname: { "minio."+ hostname }
apiIngress:
hostname: { "minio-api." + hostname }

rabbitmq:
# login
auth:
username: { your rabbitmq username }
password: { your rabbitmq password }
erlangCookie: { your rabbitmq cookie }
ingress:
hostname: { "rabbitmq." + hostname }
persistence:
storageClass: { your storage class name e.g.csi-cinder-sc-delete }
size: { your rabbitmq storage size e.g. 8Gi }

mongodb:
persistence:
storageClass: { your storage class name e.g. csi-cinder-sc-delete }
size: { your mongodb storage size e.g. 8Gi }

elasticsearch:
master:
persistence:
storageClass: { your storage class name e.g. csi-cinder-sc-delete }
size: { your elasticsearch storage size e.g. 8Gi }
data:
persistence:
storageClass: { your storage class name e.g. csi-cinder-sc-delete }
size: { your elasticsearch storage size e.g. 8Gi }

keycloak:
auth:
adminUser: { your keycloak admin username }
adminPassword: { your keycloak admin password }
ingress:
hostname: { hostname }
postgresql:
auth:
password: { your postgresql password }
postgresPassword: { your postgresql password }
primary:
persistence:
storageClass: { your storage class name e.g. csi-cinder-sc-delete }
size: { your postgresql storage size e.g. 8Gi }

message:
image:
repository: clowder/clowder2-messages
tag: main

heartbeat:
image:
repository: clowder/clowder2-heartbeat
tag: main
```
Now you can install (or upgrade) clowder using:
```bash
helm upgrade --install --namespace clowder2 --create-namespace --values local.yaml clowder2 .
```

## Ingress Controller

You will need an ingress controller. Traefik works well as ingress controller. You can install it 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.illinois.edu`)
kind: Rule
services:
- name: api@internal
kind: TraefikService
```
and apply it using:
```bash
kubectl -n traefik apply -f dashboard.yaml
```

21 changes: 11 additions & 10 deletions deployments/kubernetes/charts/clowder2/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ minio:
size: 20Gi

# where to store data, can be network storage
#storageClass: nfs-taiga
storageClass: nfs-taiga

service:
type: ClusterIP

Expand All @@ -143,10 +144,10 @@ mongodb:
# storage
persistence:
# storage size for database
#size: 8Gi
size: 8Gi

# pick fast non network storage
#storageClass: csi-cinder-sc-retain
storageClass: csi-cinder-sc-retain

# ----------------------------------------------------------------------
# RABBITMQ
Expand All @@ -171,7 +172,7 @@ rabbitmq:

persistence:
# pick fast storage
#storageClass: csi-cinder-sc-retain
storageClass: csi-cinder-sc-retain

# ----------------------------------------------------------------------
# DEFAULT EXTRACTOR SERVICES
Expand Down Expand Up @@ -220,12 +221,12 @@ elasticsearch:

master:
persistence:
# storageClass: csi-cinder-sc-retain
# size: 8Gi
storageClass: csi-cinder-sc-retain
size: 8Gi
data:
persistence:
# storageClass: csi-cinder-sc-retain
# size: 8Gi
storageClass: csi-cinder-sc-retain
size: 8Gi

# ----------------------------------------------------------------------
# KEYCLOAK
Expand Down Expand Up @@ -254,8 +255,8 @@ keycloak:

primary:
persistence:
# storageClass: csi-cinder-sc-retain
# size: 8Gi
storageClass: csi-cinder-sc-retain
size: 8Gi

# Mount configmap with theme and untar
initContainers:
Expand Down

0 comments on commit 64afb8d

Please sign in to comment.