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

Merge main branch to dev #344

Closed
wants to merge 68 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
2feed03
Updated charts
keyvaann Oct 9, 2024
14915a1
Merge pull request #332 from RADAR-base/chart-updates
keyvaann Oct 11, 2024
4f3d471
Security related chart updates
pvannierop Oct 11, 2024
2c966e0
Merge pull request #334 from RADAR-base/version/security-chart-updates
keyvaann Oct 11, 2024
b99c3a1
Up chart version of s3-proxy to 0.4.2
pvannierop Oct 11, 2024
5b1f630
Merge pull request #335 from RADAR-base/version/s3-proxy-0.4.2
pvannierop Oct 11, 2024
dcb6f96
Up chart version of data-dashboard-backend to 0.2.0
pvannierop Oct 14, 2024
5f6f00f
Up chart version of data-dashboard-backend to 0.3.3
pvannierop Oct 14, 2024
77e425d
Activate data dashboard backend MP client when service deployed
pvannierop Oct 15, 2024
a22c54a
Up chart version of data-dashboard-backend to 0.3.4
pvannierop Oct 15, 2024
113f655
Add file upload config to appserver
pvannierop Oct 16, 2024
9f67231
Up chart version of appserver to 0.6.0
pvannierop Oct 16, 2024
7a43f99
Up chart version of appconfig to 2.0.2
pvannierop Oct 17, 2024
6b6c7fc
Up chart version of catalog-server to 0.6.3
pvannierop Oct 17, 2024
56d3693
Up chart version of jdbc-connector to 0.5.5
pvannierop Oct 17, 2024
d76332c
Management Portal needs catalog-server
pvannierop Oct 18, 2024
95b2296
Chart updates
pvannierop Oct 18, 2024
cd9842d
Up postgresql version to 11.22.0
pvannierop Oct 18, 2024
b233825
Up cp-kafka to app version 7.2.9
pvannierop Oct 18, 2024
3910049
Up chart version of rest-sources-backend to 1.1.8
pvannierop Oct 18, 2024
48a600f
Up chart version of rest-sources-authorizer to 2.0.5
pvannierop Oct 21, 2024
3b4f43e
Up chart version of management-portal to 1.2.6
pvannierop Oct 21, 2024
ac48595
Fix chart reference used for development
pvannierop Oct 22, 2024
51965d2
Up chart version of radar-home to 0.3.3
pvannierop Oct 22, 2024
a1afc09
Allow turning off TLS in ingress and leave advertised URL to https
pvannierop Oct 22, 2024
70f491a
Up chart version of appserver to 0.7.1
pvannierop Oct 22, 2024
28d2871
Up chart version of graylog to 2.2.2
pvannierop Oct 22, 2024
ced2ea7
Remove hard-coded image tags from confluence components
pvannierop Oct 22, 2024
96c1689
Updated kube-prometheus-stack CRDs
keyvaann Oct 22, 2024
bffe687
Merge branch 'release-1.2' of github.com:RADAR-base/RADAR-Kubernetes …
keyvaann Oct 22, 2024
4447939
User older version of radar-gateway due to deployment bug
keyvaann Oct 23, 2024
a578f3e
Disable gateway autoscaling in minimal setup
pvannierop Oct 24, 2024
e0906ad
Up cp-kafka to chart version 0.3.4
pvannierop Oct 24, 2024
291d9ed
Up cp-kafka to chart version 0.3.5
pvannierop Oct 24, 2024
a3dbfb3
Fix redirect URIs for local development
pvannierop Oct 28, 2024
3b5dc70
Fixed radar-grafana login issue
keyvaann Oct 30, 2024
5511e1c
Updated cert-manager CRDs
keyvaann Oct 30, 2024
45fc396
PreferDualStack for Nginx
keyvaann Oct 30, 2024
1595b3c
Fix replication factor for monitoring topics
pvannierop Oct 28, 2024
6d317b2
Up chart versions
pvannierop Oct 31, 2024
0fea6d5
Removed IPv6 from Nginx
keyvaann Oct 31, 2024
47b04cb
Merge branch 'release-1.2' of github.com:RADAR-base/RADAR-Kubernetes …
keyvaann Oct 31, 2024
779425f
Up chart versions
pvannierop Oct 31, 2024
7bd5c1e
Moved upgrade information to a separate file and added notes for 1.2 …
keyvaann Nov 5, 2024
39eb0bc
Moved Development automation to CONTRIBUTING.md
keyvaann Nov 5, 2024
1025ee0
Updated upgrade doc headers
keyvaann Nov 5, 2024
50328d5
Updated upload connector backend chart version
keyvaann Nov 14, 2024
7e6adee
Fixed radar upload backend PostgreSQL configuration
keyvaann Nov 15, 2024
e93a99c
Added needs to upload connector components
keyvaann Nov 15, 2024
0463b2b
Up radar-gateway to chart version 0.7.5
pvannierop Nov 15, 2024
a55ba32
Up radar-gateway to chart version 1.2.8
pvannierop Nov 15, 2024
c6d4d0e
Fixed needs for upload connector backend
keyvaann Nov 15, 2024
39085bb
Updated Kubernetes version in CI
keyvaann Nov 15, 2024
b3218ef
Remove resource limits from redis
keyvaann Nov 22, 2024
a82a686
Up radar-gateway to chart version 1.2.9
pvannierop Nov 27, 2024
d93cf9a
Removed rate limit configuration
keyvaann Dec 2, 2024
a0e27d9
Disable services that should not run in a default deployment
pvannierop Dec 11, 2024
c0c8a57
Fix default password for minio.
ewelinagr Dec 11, 2024
94ca449
Fix
pvannierop Dec 13, 2024
4ea8e3d
Refactor implementation of timescaledb
pvannierop Dec 17, 2024
e7274d4
Refactor implementation of postgresql
pvannierop Dec 17, 2024
2180b83
Fix base.yaml
pvannierop Dec 17, 2024
d78e8e9
Fix minimal installation after db config updates
pvannierop Dec 17, 2024
c18b654
Fix issue with data dashboard backend primary key
pvannierop Dec 18, 2024
a554037
Fix generating long secrets for Minio
pvannierop Dec 19, 2024
13e030e
Improve comments related to database upgrades
pvannierop Jan 17, 2025
71aac92
Added a note about RADAR-K8s-Infrastructure
keyvaann Jan 22, 2025
ef5ae91
Merge pull request #333 from RADAR-base/release-1.2.0
keyvaann Jan 22, 2025
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
14 changes: 6 additions & 8 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@ jobs:
install:
strategy:
matrix:
K3S_VERSION: ["v1.27.14+k3s1", "v1.28.10+k3s1", "v1.29.5+k3s1", "v1.30.1+k3s1"]
K3S_VERSION: ["v1.30.6+k3s1", "v1.31.2+k3s1"]
exclude:
- K3S_VERSION: ${{ github.base_ref != 'refs/heads/main' && 'v1.27.14+k3s1' }}
- K3S_VERSION: ${{ github.base_ref != 'refs/heads/main' && 'v1.28.10+k3s1' }}
- K3S_VERSION: ${{ github.base_ref != 'refs/heads/main' && 'v1.29.5+k3s1' }}
- K3S_VERSION: ${{ github.base_ref != 'refs/heads/main' && 'v1.30.6+k3s1' }}
runs-on: self-hosted
steps:
- name: Cleanup
Expand All @@ -33,10 +31,10 @@ jobs:

- name: Install dependencies
env:
HELM_VERSION: "v3.11.3"
HELM_DIFF_VERSION: "3.6.0"
HELMFILE_VERSION: "v0.152.0"
YQ_VERSION: "v4.33.3"
HELM_VERSION: "v3.16.3"
HELM_DIFF_VERSION: "3.9.12"
HELMFILE_VERSION: "v0.169.1"
YQ_VERSION: "v4.44.3"
run: |
./.github/ci_config/bin/install-dependencies

Expand Down
35 changes: 35 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,41 @@ Then you can make a new fork or branch and make your changes there and after you
If you're changing an existing code, make sure that it is either backwards compatible or the documentation shows a clear path of applying the changes without breaking the existing installations.


#### Development automation

This repository can be used for development automation for instance on a k3s or k3d (dockerized k3s) cluster. The example below shows how to deploy on a k3d cluster.

1. Install k3d (see [here](https://github.com/k3d-io/k3d#get))
2. Create a k3d cluster that is configured to run RADAR-base

```shell
k3d cluster create my-test-cluster --port '80:80@loadbalancer' --config=.github/ci_config/k3d-config.yaml
```

This example creates a cluster named `my-test-cluster` with a load balancer that forwards local port 80 to the cluster. The
configuration file `.github/ci_config/k3d-config.yaml` is used to configure the cluster. This cluster will be accessible
in _kubectl_ with context name _k3d-my-test-cluster_.

3. Initialize the RADAR-Kubernetes deployment. Run:

```shell
./bin/init
```

4. In file _etc/production.yaml_:

- set _kubeContext_ to _k3d-my-test-cluster_
- set _dev_deployment_ to _true_
- (optional) enable/disable components as needed with the __install_ fields

5. Install RADAR-Kubernetes on the k3d cluster:

```shell
helmfile sync
```

When installation is complete, you can access the applications at `http://localhost`.

#### Adding a new component to RADAR-Kuberentes
In order to add a new component you first need to add its helm chart to [radar-helm-charts)](https://github.com/RADAR-base/radar-helm-charts) repository. Refer to contributing guidelines of that repository for more information. Once the chart has been added you need to:
- Add a helmfile for it in `helmfile.d` directory. The helmfiles are seperated in a modular way in order to avoid having a huge file and also installing certain components in order. Have a look at the current helmfiles and if your component is related to one of them add your component in that file other file create a new file. If your component is a dependency to other components, like Kafka or PostgreSQL prefix the file name with a smaller number so it will be installed first, but if it's a standalone component, the prefix number can be higher.
Expand Down
246 changes: 37 additions & 209 deletions README.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions bin/generate-secrets
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ nginx_auth_password=$(generate_secret)
secret="thehyve:$(echo $nginx_auth_password | openssl passwd -apr1 -stdin)" insert_secret ".kube_prometheus_stack.nginx_auth"
comment="username: thehyve, password: $nginx_auth_password" yq -i ".kube_prometheus_stack.nginx_auth line_comment |= strenv(comment)" etc/secrets.yaml

# Generate secrets for all remaining fields with value 'secret'.
replacements=$(yq e '.. | select(. == "secret") | [(path | "."+join("."))] | join(" ")' etc/secrets.yaml);
# Generate secrets for all remaining fields with value 'secret' or 'secret-secret' (if the component has a min length requirement).
replacements=$(yq e '.. | select(. == "secret" or . == "secret-secret") | [(path | "."+join("."))] | join(" ")' etc/secrets.yaml);
for key in $replacements; do
insert_secret $key
done
203 changes: 203 additions & 0 deletions docs/upgrade.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,203 @@
# Upgrade instructions

Run the following instructions to upgrade an existing RADAR-Kubernetes cluster.

| :exclamation: Note |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Upgrading the major version of a PostgreSQL image is not supported. If necessary, we propose to use a `pg_dump` to dump the current data and a `pg_restore` to restore that data on a newer version. Please find instructions for this elsewhere. |

## Upgrade to RADAR-Kubernetes version 1.2.0

### Update `production.yaml` file

1. Remove any line beginning with `_chart_version:`.
2. Remove any line beginning with `imageTag:`.
3. Add email server config to `management_portal` and `radar-appserver` sections analogous to:

```yaml
management_portal:
smtp:
enabled: true
host: smtp
port: 25
from: [email protected]
starttls: false
auth: true
```

```yaml
radar_appserver:
smtp:
enabled: true
host: smtp
port: 25
from: [email protected]
starttls: false
auth: true
```

4. Update _timescaledb_ database configuration:

- Rename `timescaledb_username` to `grafana_metrics_db_username`
- Remove `grafana_metrics_username` and `timescaledb_db_name` variables.
- When using _realtime-dashboard_, add `realtime_dashboard_db_username` that points to the current value of `timescaledb_username`.

5. For databases where data should persist after the update uncomment the respective `existingClaim` field. Example:

```yaml
realtime_dashboard_timescaledb:
postgresql:
primary:
persistence:
existingClaim: "data-timescaledb-postgresql-0"
```

### Update `secrets.yaml` file

1. Add the following new secrets to the `secrets.yaml` file to correctponding sections:

```yaml
management_portal:
oauth_clients:
radar_data_dashboard_backend:
client_secret: <add your own random secret here>
```

```yaml
radar_appserver:
smtp:
username: <your smtp username>
password: <your smtp password>
```

```yaml
data_dashboard_db_password: <same password as timescaledb_password>
realtime_dashboard_db_password: <same password as timescaledb_password>
```

2. Rename the `grafana_metrics_password` secret to `grafana_metrics_db_password` and `timescaledb_password` to `data_dashboard_db_password`.


### MongoDB
MongoDB has been updated to a new version and it's not compatible with the current version that has been installed in the cluster. There are two pathes forward:
- Deleting the MongoDB and its volumes and then installing it and configuring Graylog again. This is the recommeneded approach since usually there is no important data is stored in MongoDB and the Graylog stack will be replaced in the next release.
- Upgrading MongoDB cluster. If you have configured Graylog significantly, then it might be better to upgrade the MongoDB instead of reinstalling it. Options are:
- Manually exporting the databases and doing a clean reinstall as stated in the last step and the importing the data again.
- Following official MongoDB upgrade instructions for version [5.0](https://www.mongodb.com/docs/manual/release-notes/5.0-upgrade-replica-set/), [6.0](https://www.mongodb.com/docs/manual/release-notes/6.0-upgrade-replica-set/) and [7.0](https://www.mongodb.com/docs/manual/release-notes/7.0-upgrade-replica-set/).

## Upgrade to RADAR-Kubernetes version 1.1.x
Before running the upgrade make sure to copy `environments.yaml.tmpl` to `environments.yaml` and if you've previously changed `environments.yaml` apply the changes again. This is necessary due to addition of `helmDefaults` and `repositories` configurations to this file.

## Upgrade to RADAR-Kubernetes version 1.0.0

Before running the upgrade, compare `etc/base.yaml` and `etc/base.yaml.gotmpl` with their `production.yaml` counterparts. Please ensure that all properties in `etc/base.yaml` are overridden in your `production.yaml` or that the `base.yaml` default value is fine, in which case no value needs to be provided in `production.yaml`.

To upgrade the initial services, run

```shell
kubectl delete -n monitoring deployments kube-prometheus-stack-kube-state-metrics
helm -n graylog uninstall mongodb
kubectl delete -n graylog pvc datadir-mongodb-0 datadir-mongodb-1
```

Note that this will remove your graylog settings but not your actual logs. This step is unfortunately needed to enable credentials on the Graylog database hosted by the mongodb chart. You will need to recreate the GELF TCP input source as during install.

Then run

```shell
helmfile -f helmfile.d/00-init.yaml apply --concurrency 1
helmfile -f helmfile.d/10-base.yaml --selector name=cert-manager-letsencrypt apply
```

To update the Kafka stack, run:

```shell
helmfile -f helmfile.d/10-base.yaml apply --concurrency 1
```

After this has succeeded, edit your `production.yaml` and change the `cp_kafka.customEnv.KAFKA_INTER_BROKER_PROTOCOL_VERSION` to the corresponding version documented in the [Confluent upgrade instructions](https://docs.confluent.io/platform/current/installation/upgrade.html) of your Kafka installation. Find the currently installed version of Kafka with `kubectl exec cp-kafka-0 -c cp-kafka-broker -- kafka-topics --version`.
When the `cp_kafka.customEnv.KAFKA_INTER_BROKER_PROTOCOL_VERSION` is updated, again run

```shell
helmfile -f helmfile.d/10-base.yaml apply
```

To upgrade to the latest PostgreSQL helm chart, in `production.yaml`, uncomment the line `postgresql.primary.persistence.existingClaim: "data-postgresql-postgresql-0"` to use the same data storage as previously. Then run

```shell
kubectl delete secrets postgresql
kubectl delete statefulsets postgresql-postgresql
helmfile -f helmfile.d/10-managementportal.yaml apply
```

If installed, `radar-appserver-postgresql`, uncomment the `production.yaml` line `radar_appserver_postgresql.primary.existingClaim: "data-radar-appserver-postgresql-postgresql-0"`. Then run

```shell
kubectl delete secrets radar-appserver-postgresql
kubectl delete statefulsets radar-appserver-postgresql-postgresql
helmfile -f helmfile.d/20-appserver.yaml apply
```

If installed, to upgrade `timescaledb`, uncomment the `production.yaml` line `timescaledb.primary.existingClaim: "data-timescaledb-postgresql-0"`. Then run

```shell
kubectl delete secrets timescaledb-postgresql
kubectl delete statefulsets timescaledb-postgresql
helmfile -f helmfile.d/20-grafana.yaml apply
```

If installed, to upgrade `radar-upload-postgresql`, uncomment the `production.yaml` line `radar_upload_postgresql.primary.existingClaim: "data-radar-upload-postgresql-postgresql-0"`. Then run

```shell
kubectl delete secrets radar-upload-postgresql
kubectl delete statefulsets radar-upload-postgresql-postgresql
helmfile -f helmfile.d/20-upload.yaml apply
```

If minio is installed, upgrade it with the following instructions:

```shell
# get minio PV and PVC
kubectl get pv | grep export-minio- | tr -s ' ' | cut -d ' ' -f 1,6 | tr '/' ' ' | cut -d ' ' -f 1,3 | tee minio-pv.list
# Uninstall the minio statefulset
helm uninstall minio
# Associate PV with the new PVC name
while read -r pv pvc
do
# Don not delete PV
kubectl patch pv $pv -p '{"spec":{"persistentVolumeReclaimPolicy":"Retain"}}'
# Delete PVC
kubectl delete pvc $pvc
# Name of the new PVC
newpvc=$(echo $pvc | sed 's/export-/data-/')
# Associate PV with the new PVC name
kubectl patch pv $pv -p '{"spec":{"claimRef":{"name": "'$newpvc'", "namespace": "default", "uid": null}}}'
# Create new PVC
cat <<EOF | sed "s/data-minio-i/$newpvc/" | kubectl apply -f -
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
labels:
app.kubernetes.io/instance: minio
app.kubernetes.io/name: minio
name: data-minio-i
namespace: default
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 20Gi
EOF
done < minio-pv.list
# Do the new helm install.
helmfile -f helmfile.d/20-s3.yaml apply
```

Delete the redis stateful set (this will not delete the data on the volume)

```shell
kubectl delete statefulset redis-master
helmfile -f helmfile.d/20-s3.yaml sync --concurrency 1
```

13 changes: 7 additions & 6 deletions etc/base-secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,10 @@ radar_rest_sources_backend:
postgres:
password: secret
# --------------------------------------------------------- 20-dashboard.yaml ---------------------------------------------------------
timescaledb_password: secret
grafana_password: secret
grafana_metrics_password: secret

data_dashboard_db_password: secret
grafana_metrics_db_password: secret
realtime_dashboard_db_password: secret
# --------------------------------------------------------- 20-redcap.yaml ---------------------------------------------------------
radar_integration:
projects: []
Expand All @@ -147,9 +147,10 @@ radar_integration:

# --------------------------------------------------------- 20-s3-connector.yaml ---------------------------------------------------------
# The access keys and secret keys of object storage services should match.
# If AWS S3 is used as a storage medium instead of minio, then fill in those.
s3_access_key: secret
s3_secret_key: secret
# If AWS S3 is used as a storage medium instead of minio, then enter the AWS-provided secrets here.
# For minio the secrets must consist of at least 8 characters.
s3_access_key: secret-secret
s3_secret_key: secret-secret

# --------------------------------------------------------- 20-upload.yaml ---------------------------------------------------------
radar_upload_postgres_password: secret
Expand Down
Loading
Loading