From d034db3b2fc616d35c69a317ae6f5e63e59a17c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Thu, 19 Oct 2023 17:41:34 +0200 Subject: [PATCH 1/9] Fix main readme wiki links --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 2062865dd..9d657f98b 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ In other words, we are interested in a network of networks and in keeping the da Post feed -Check out more screenshots [here](/wiki/en:Screenshots). +Check out more screenshots [here](https://github.com/Ocelot-Social-Community/Ocelot-Social/wiki/en:Screenshots). ## Features @@ -40,14 +40,14 @@ Ocelot.social networks feature: * filters * and more … -Check out the [full feature list](/wiki/en:FAQ#what-are-the-features). +Check out the [full feature list](https://github.com/Ocelot-Social-Community/Ocelot-Social/wiki/en:FAQ#what-are-the-features). ## User Guide and Frequently Asked Questions -In the [wiki](/wiki) you can find more information. +In the [wiki](https://github.com/Ocelot-Social-Community/Ocelot-Social/wiki) you can find more information. -* [User Guide](/wiki/en:User-Guide) -* [Frequently Asked Questions](/wiki/en:FAQ) +* [User Guide](https://github.com/Ocelot-Social-Community/Ocelot-Social/wiki/en:User-Guide) +* [Frequently Asked Questions](https://github.com/Ocelot-Social-Community/Ocelot-Social/wiki/en:FAQ) ## Demo From 3a65830e144bad06076efec1efc7abfcba567dd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Thu, 19 Oct 2023 17:42:27 +0200 Subject: [PATCH 2/9] Fix deployment readme links --- deployment/src/kubernetes/DigitalOcean.md | 2 +- deployment/src/kubernetes/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/deployment/src/kubernetes/DigitalOcean.md b/deployment/src/kubernetes/DigitalOcean.md index 2c919d5f2..71c49d783 100644 --- a/deployment/src/kubernetes/DigitalOcean.md +++ b/deployment/src/kubernetes/DigitalOcean.md @@ -75,7 +75,7 @@ The IPs of the DigitalOcean machines are not necessarily stable, so the cluster' ## Deploy -Yeah, you're done here. Back to [Deployment with Helm for Kubernetes](/deployment/kubernetes/README.md). +Yeah, you're done here. Back to [Deployment with Helm for Kubernetes](/deployment/src/kubernetes/README.md). ## Backups On DigitalOcean diff --git a/deployment/src/kubernetes/README.md b/deployment/src/kubernetes/README.md index 126c37e9c..8453213cd 100644 --- a/deployment/src/kubernetes/README.md +++ b/deployment/src/kubernetes/README.md @@ -9,7 +9,7 @@ Please contact us if you are interested in options not listed below. Managed Kubernetes: -- [DigitalOcean](/deployment/kubernetes/DigitalOcean.md) +- [DigitalOcean](/deployment/src/kubernetes/DigitalOcean.md) ## Configuration From ce923cd6980fe2192b49c96e4c8f79928596e83a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Thu, 19 Oct 2023 17:44:38 +0200 Subject: [PATCH 3/9] Update cert-manager and kubectl version in deployment --- deployment/src/kubernetes/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment/src/kubernetes/README.md b/deployment/src/kubernetes/README.md index 8453213cd..b86ad12a2 100644 --- a/deployment/src/kubernetes/README.md +++ b/deployment/src/kubernetes/README.md @@ -46,7 +46,7 @@ Please have a look here: - [Installing with Helm](https://cert-manager.io/docs/installation/helm/#installing-with-helm) -Our Helm installation is optimized for cert-manager version `v1.9.1` and `kubectl` version `"v1.24.2`. +Our Helm installation is optimized for cert-manager version `v1.13.1` and `kubectl` version `"v1.28.2`. Please search here for cert-manager versions that are compatible with your `kubectl` version on the cluster and on the client: [cert-manager Supported Releases](https://cert-manager.io/docs/installation/supported-releases/#supported-releases). From 97e1829970278e575e8b4bc2f8ed03389829f30b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Tue, 24 Oct 2023 13:58:57 +0200 Subject: [PATCH 4/9] Fix explicit Kubernetes terminal commands for installing cert-manager --- deployment/src/kubernetes/README.md | 31 ++++++++++++++--------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/deployment/src/kubernetes/README.md b/deployment/src/kubernetes/README.md index b86ad12a2..dbb2e7303 100644 --- a/deployment/src/kubernetes/README.md +++ b/deployment/src/kubernetes/README.md @@ -52,23 +52,14 @@ Please search here for cert-manager versions that are compatible with your `kube ***ATTENTION:*** *When uninstalling cert-manager, be sure to use the same method as for installation! Otherwise, we could end up in a broken state, see [Uninstall](https://cert-manager.io/docs/installation/kubectl/#uninstalling).* - From 30ae9981c0eb3c2a7ae35ecfd8e6954eecaa7a3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Tue, 24 Oct 2023 14:01:23 +0200 Subject: [PATCH 5/9] Fix explicit Kubernetes terminal commands for install, upgrade, rollback, uninstall ocelot --- deployment/src/kubernetes/README.md | 56 ++++++++++++++++++++++++----- 1 file changed, 48 insertions(+), 8 deletions(-) diff --git a/deployment/src/kubernetes/README.md b/deployment/src/kubernetes/README.md index dbb2e7303..eeac3cf54 100644 --- a/deployment/src/kubernetes/README.md +++ b/deployment/src/kubernetes/README.md @@ -190,10 +190,22 @@ All commands for ocelot need to be executed in the kubernetes folder. Therefore Only run once for the first time of installation: ```bash +# in configuration/ + # kubeconfig.yaml set globaly -$ helm install ocelot ./ +helm install ocelot \ + --values ./kubernetes/values.yaml \ + --set appVersion="latest" \ + ../../src/kubernetes/ \ + --timeout 10m + # or kubeconfig.yaml in your repo, then adjust -$ helm --kubeconfig=/../kubeconfig.yaml install ocelot ./ +helm install ocelot \ + --kubeconfig ./kubeconfig.yaml \ + --values ./kubernetes/values.yaml \ + --set appVersion="latest" \ + ../../src/kubernetes/ \ + --timeout 10m ``` #### Upgrade & Update @@ -201,10 +213,24 @@ $ helm --kubeconfig=/../kubeconfig.yaml install ocelot ./ Run for all upgrades and updates: ```bash +# !!! untested for now for new deployment structure !!! + +# in configuration/ + # kubeconfig.yaml set globaly -$ helm upgrade ocelot ./ +helm upgrade ocelot \ + --values ./kubernetes/values.yaml \ + --set appVersion="latest" \ + ../../src/kubernetes/ \ + --timeout 10m + # or kubeconfig.yaml in your repo, then adjust -$ helm --kubeconfig=/../kubeconfig.yaml upgrade ocelot ./ +helm upgrade ocelot \ + --kubeconfig ./kubeconfig.yaml \ + --values ./kubernetes/values.yaml \ + --set appVersion="latest" \ + ../../src/kubernetes/ \ + --timeout 10m ``` #### Rollback @@ -212,10 +238,17 @@ $ helm --kubeconfig=/../kubeconfig.yaml upgrade ocelot ./ Run for a rollback, in case something went wrong: ```bash +# !!! untested for now for new deployment structure !!! + +# in configuration/ + # kubeconfig.yaml set globaly -$ helm rollback ocelot +helm rollback ocelot --timeout 10m + # or kubeconfig.yaml in your repo, then adjust -$ helm --kubeconfig=/../kubeconfig.yaml rollback ocelot +helm rollback ocelot \ + --kubeconfig ./kubeconfig.yaml \ + --timeout 10m ``` #### Uninstall @@ -223,10 +256,17 @@ $ helm --kubeconfig=/../kubeconfig.yaml rollback ocelot Be aware that if you uninstall ocelot the formerly bound volumes become unbound. Those volumes contain all data from uploads and database. You have to manually free their reference in order to bind them again when reinstalling. Once unbound from their former container references they should automatically be rebound (considering the sizes did not change) ```bash +# !!! untested for now for new deployment structure !!! + +# in configuration/ + # kubeconfig.yaml set globaly -$ helm uninstall ocelot +helm uninstall ocelot --timeout 10m + # or kubeconfig.yaml in your repo, then adjust -$ helm --kubeconfig=/../kubeconfig.yaml uninstall ocelot +helm uninstall ocelot \ + --kubeconfig ./kubeconfig.yaml \ + --timeout 10m ``` ## Backups From e9ac5032aa6d6938c6da2df8a8a55e2ccb8459ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Tue, 24 Oct 2023 14:10:44 +0200 Subject: [PATCH 6/9] Fix explicit Kubernetes terminal commands for installing nginx --- deployment/src/kubernetes/README.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/deployment/src/kubernetes/README.md b/deployment/src/kubernetes/README.md index eeac3cf54..f827341a0 100644 --- a/deployment/src/kubernetes/README.md +++ b/deployment/src/kubernetes/README.md @@ -100,10 +100,15 @@ $ helm repo update #### 2. Install ingress-nginx ```bash +# in configuration/ + # kubeconfig.yaml set globaly -$ helm install ingress-nginx ingress-nginx/ingress-nginx -f nginx.values.yaml +helm install ingress-nginx ingress-nginx/ingress-nginx -f ../../src/kubernetes/nginx.values.yaml + # or kubeconfig.yaml in your repo, then adjust -$ helm --kubeconfig=/../kubeconfig.yaml install ingress-nginx ingress-nginx/ingress-nginx -f nginx.values.yaml +helm install \ + ingress-nginx ingress-nginx/ingress-nginx -f ../../src/kubernetes/nginx.values.yaml \ + --kubeconfig ./kubeconfig.yaml ``` ### DigitalOcean Firewall @@ -158,6 +163,8 @@ $ doctl compute firewall get --context ### DNS +***ATTENTION:** This seems not to work at all so we leave it away at the moment* + ***TODO:** I thought this is necessary if we use the DigitalOcean DNS management service? See [Manage DNS With DigitalOcean](/deployment/kubernetes/DigitalOcean.md#manage-dns-with-digitalocean)* This chart is only necessary (recommended is more precise) if you run DigitalOcean without load balancer. From 1ba1f1f3efd25107c4d68e96c599ffbcd7f7249e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Wed, 25 Oct 2023 12:17:34 +0200 Subject: [PATCH 7/9] Add Kubernetes terminal to set Neo4j database indexes, constrains, and initial admin account plus run migrate up --- deployment/src/kubernetes/README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/deployment/src/kubernetes/README.md b/deployment/src/kubernetes/README.md index f827341a0..d63528c25 100644 --- a/deployment/src/kubernetes/README.md +++ b/deployment/src/kubernetes/README.md @@ -338,8 +338,11 @@ $ kubectl -n default rollout status deployment/ocelot-neo4j --timeout=240s # !!! be aware of the correct kube context !!! $ kubectl config get-contexts -# reset and seed Neo4j database via backend for staging +# for staging: reset and seed Neo4j database via backend $ kubectl -n default exec -it $(kubectl -n default get pods | grep ocelot-backend | awk '{ print $1 }') -- /bin/sh -c "node --experimental-repl-await build/src/db/clean.js && node --experimental-repl-await build/src/db/seed.js" +# or alternatively +# for production: set Neo4j database indexes, constrains, and initial admin account plus run migrate up via backend +$ kubectl -n default exec -it $(kubectl -n default get pods | grep ocelot-backend | awk '{ print $1 }') -- /bin/sh -c "yarn prod:migrate init && yarn prod:migrate up" ``` From 844ad0ff2132584cb07e8231e127af56f89f2877 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Wed, 25 Oct 2023 12:29:55 +0200 Subject: [PATCH 8/9] Add Kubernetes cluster installation script to Kubernetes deployment --- deployment/scripts/cluster.install.sh | 58 +++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100755 deployment/scripts/cluster.install.sh diff --git a/deployment/scripts/cluster.install.sh b/deployment/scripts/cluster.install.sh new file mode 100755 index 000000000..9dd7ed15a --- /dev/null +++ b/deployment/scripts/cluster.install.sh @@ -0,0 +1,58 @@ +#!/bin/bash + +# !!! never tested !!! + +# base setup +SCRIPT_PATH=$(realpath $0) +SCRIPT_DIR=$(dirname $SCRIPT_PATH) + +# check CONFIGURATION +if [ -z ${CONFIGURATION} ]; then + echo "You must provide a `CONFIGURATION` via environment variable" + exit 1 +fi +echo "Using CONFIGURATION=${CONFIGURATION}" + +# configuration +KUBECONFIG=${KUBECONFIG:-${SCRIPT_DIR}/../configurations/${CONFIGURATION}/kubeconfig.yaml} +VALUES=${SCRIPT_DIR}/../configurations/${CONFIGURATION}/kubernetes/values.yaml +DOCKERHUB_OCELOT_TAG=${DOCKERHUB_OCELOT_TAG:-"latest"} + + +## install Ingress-Nginx +helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx +helm repo update +helm install \ + ingress-nginx ingress-nginx/ingress-nginx \ + --kubeconfig=${KUBECONFIG} \ + -f ${SCRIPT_DIR}/../src/kubernetes/nginx.values.yaml + +## install Cert-Manager +helm repo add jetstack https://charts.jetstack.io +helm repo update +helm install \ + cert-manager jetstack/cert-manager \ + --kubeconfig=${KUBECONFIG} \ + --namespace cert-manager \ + --create-namespace \ + --version v1.13.1 \ + --set installCRDs=true + +## install Ocelot with helm +helm install \ + ocelot \ + --kubeconfig=${KUBECONFIG} \ + --values ${VALUES} \ + --set appVersion="${DOCKERHUB_OCELOT_TAG}" \ + ${SCRIPT_DIR}/../src/kubernetes/ \ + --timeout 10m + +## set Neo4j database indexes, constrains, and initial admin account plus run migrate up +kubectl --kubeconfig=${KUBECONFIG} \ + -n default \ + exec -it \ + $(kubectl --kubeconfig=${KUBECONFIG} -n default get pods | grep ocelot-backend | awk '{ print $1 }') -- \ + /bin/sh -c "yarn prod:migrate init && yarn prod:migrate up" + # /bin/sh -c "node --experimental-repl-await build/src/db/clean.js && node --experimental-repl-await build/src/db/seed.js" + +echo "!!! You must install a firewall or similar !!! (for DigitalOcean see: deployment/src/kubernetes/README.md)" From 98652848ba6fe5a2bbdce23199ff8adc3e81c9e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Wed, 25 Oct 2023 12:32:58 +0200 Subject: [PATCH 9/9] Add comment in readme --- deployment/src/kubernetes/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/deployment/src/kubernetes/README.md b/deployment/src/kubernetes/README.md index d63528c25..17773d736 100644 --- a/deployment/src/kubernetes/README.md +++ b/deployment/src/kubernetes/README.md @@ -180,6 +180,8 @@ $ helm repo update #### 2. Install DNS ```bash +# !!! untested for now for new deployment structure !!! + # kubeconfig.yaml set globaly $ helm install dns bitnami/external-dns -f dns.values.yaml # or kubeconfig.yaml in your repo, then adjust