From f31c12a7b9788a384d46c86517e69d256ffc9659 Mon Sep 17 00:00:00 2001 From: plm Date: Wed, 22 Jan 2025 14:21:31 +0100 Subject: [PATCH] Updating doc, and deployment procedure --- README.md | 52 +++++++++++++++++++++++--- build_opencloud_microservices.sh | 15 ++++++++ clone_opencloud_microservices.sh | 48 ++++++++++++++++++++++++ opencloud/templates/openCloudConf.yaml | 4 -- 4 files changed, 109 insertions(+), 10 deletions(-) create mode 100755 build_opencloud_microservices.sh create mode 100755 clone_opencloud_microservices.sh diff --git a/README.md b/README.md index c019323..664915a 100644 --- a/README.md +++ b/README.md @@ -6,19 +6,25 @@ or to ease opencloud dependencies (dex, mongo, mongo-express, ...) deployment. Kind (https://kind.sigs.k8s.io/) is used here as a lightweight kubernetes deployment. Obviously, any kubenetes compliant environment is a legitimate target. -HOW TO: +# Locally built microservices deployment procedure -1. Install kind +## Clone the repository + +``` +git clone https://cloud.o-forge.io/plm/oc-k8s.git +``` + +## Install kind Follow instructions here https://kind.sigs.k8s.io/ -2. Install helm +## Install helm Download suitable helm client here https://helm.sh/docs/intro/install/ -3. Fire up a kind cluster +## Fire up a kind cluster -Execute following script +Execute following script to create a single node development k8s cluster ``` create_kind_cluster.sh @@ -26,8 +32,42 @@ create_kind_cluster.sh It will create a *opencloud* docker container running kubernetes services. -4. Deploy the opencloud chart +## Clone all the microservices repositories taking part of the opencloud environment + +Execute following script to clone all the needed parts: + +``` +clone_opencloud_microservices.sh +``` + +## Build everything + +You need to build and publish all the opencloud microservices images in the kind cluster before deploying the Helm package. + +Proceed as following: + +``` +build_opencloud_microservices.sh +``` + +## Deploy the opencloud chart ``` install_development.sh ``` + +## Hostname settings + +Edit your /etc/hosts file, and add following line: + +``` +127.0.0.1 beta.opencloud.com +``` + +## Done + +Everything should be operational now, go to http://beta.opencloud.com and enjoy the ride + +# Prebuilt microservices deployment procedure + +TODO \ No newline at end of file diff --git a/build_opencloud_microservices.sh b/build_opencloud_microservices.sh new file mode 100755 index 0000000..9cfe9c2 --- /dev/null +++ b/build_opencloud_microservices.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +find . -mindepth 2 -maxdepth 2 -name 'Makefile' | while read -r makefile; do + dir=$(dirname "$makefile") + echo "Running 'make all' in $dir" + ( + cd "$dir" && make all + ) + if [ $? -ne 0 ]; then + echo "Error: make all failed in $dir" + exit 1 + fi +done + +echo "All make processes completed successfully." diff --git a/clone_opencloud_microservices.sh b/clone_opencloud_microservices.sh new file mode 100755 index 0000000..6733cc4 --- /dev/null +++ b/clone_opencloud_microservices.sh @@ -0,0 +1,48 @@ +#!/bin/bash + + +REPOS=( + "https://cloud.o-forge.io/core/oc-aggregator.git" + "https://cloud.o-forge.io/core/oc-auth.git" + "https://cloud.o-forge.io/core/oc-catalog.git" + "https://cloud.o-forge.io/core/oc-datacenter.git" + "https://cloud.o-forge.io/core/oc-discovery.git" + "https://cloud.o-forge.io/core/oc-front.git" + "https://cloud.o-forge.io/core/oc-discovery.git" + "https://cloud.o-forge.io/core/oc-monitord.git" + "https://cloud.o-forge.io/core/oc-peer.git" + "https://cloud.o-forge.io/core/oc-scheduler.git" + "https://cloud.o-forge.io/core/oc-schedulerd.git" + "https://cloud.o-forge.io/core/oc-workflow.git" + "https://cloud.o-forge.io/core/oc-workspace.git" +) + +# Function to clone repositories +clone_repo() { + local repo_url="$1" + local repo_name=$(basename "$repo_url" .git) + + echo "Processing repository: $repo_name" + + if [ -d "$repo_name" ]; then + echo "Repository '$repo_name' already exists. Pulling latest changes..." + cd "$repo_name" && git pull && cd .. + else + echo "Cloning repository: $repo_name" + git clone "$repo_url" + if [ $? -ne 0 ]; then + echo "Error cloning $repo_url" + exit 1 + fi + fi +} + +# Iterate through each repository in the list +for repo in "${REPOS[@]}"; do + clone_repo "$repo" +done + +echo "All repositories processed successfully." + + + diff --git a/opencloud/templates/openCloudConf.yaml b/opencloud/templates/openCloudConf.yaml index 2826ce9..9f3b407 100644 --- a/opencloud/templates/openCloudConf.yaml +++ b/opencloud/templates/openCloudConf.yaml @@ -2,10 +2,6 @@ apiVersion: v1 kind: ConfigMap metadata: name: opencloud-config - annotations: - "helm.sh/hook": post-install - "helm.sh/hook-weight": "1" # Lower number runs first - "helm.sh/hook-delete-policy": hook-succeeded data: OC_NAMESPACE: "{{ .Release.Namespace }}" OC_ADMIN_ROLE: "{{ .Values.ocAuth.keto.adminRole }}"