Updating doc, and deployment procedure
This commit is contained in:
parent
30b04e62c0
commit
f31c12a7b9
52
README.md
52
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
|
Kind (https://kind.sigs.k8s.io/) is used here as a lightweight kubernetes deployment. Obviously, any kubenetes compliant
|
||||||
environment is a legitimate target.
|
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/
|
Follow instructions here https://kind.sigs.k8s.io/
|
||||||
|
|
||||||
2. Install helm
|
## Install helm
|
||||||
|
|
||||||
Download suitable helm client here https://helm.sh/docs/intro/install/
|
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
|
create_kind_cluster.sh
|
||||||
@ -26,8 +32,42 @@ create_kind_cluster.sh
|
|||||||
|
|
||||||
It will create a *opencloud* docker container running kubernetes services.
|
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
|
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
|
15
build_opencloud_microservices.sh
Executable file
15
build_opencloud_microservices.sh
Executable file
@ -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."
|
48
clone_opencloud_microservices.sh
Executable file
48
clone_opencloud_microservices.sh
Executable file
@ -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."
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -2,10 +2,6 @@ apiVersion: v1
|
|||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
metadata:
|
metadata:
|
||||||
name: opencloud-config
|
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:
|
data:
|
||||||
OC_NAMESPACE: "{{ .Release.Namespace }}"
|
OC_NAMESPACE: "{{ .Release.Namespace }}"
|
||||||
OC_ADMIN_ROLE: "{{ .Values.ocAuth.keto.adminRole }}"
|
OC_ADMIN_ROLE: "{{ .Values.ocAuth.keto.adminRole }}"
|
||||||
|
Loading…
Reference in New Issue
Block a user