Skip to content

Commit

Permalink
chore(deploy): fix deploy scripts & docs (#548)
Browse files Browse the repository at this point in the history
  • Loading branch information
maslow authored Dec 15, 2022
1 parent 4c76333 commit 0fe81df
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 24 deletions.
30 changes: 9 additions & 21 deletions deploy/scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,22 @@

```bash
cd deploy/scripts
sh install-on-linux.sh # install k8s cluster

# replace with your domain here.
export DOMAIN=127.0.0.1.nip.io

# install k8s cluster
sh install-on-linux.sh $DOMAIN
```

## Create development environment on MacOS

1. Install multipass on MacOS

> Skip this step if you have already installed multipass
```bash
brew install --cask multipass # or see https://multipass.run/install
# Skip this step if you have already installed multipass
# see https://multipass.run/install
brew install --cask multipass
```

2. Create vm & deploy in it
Expand All @@ -28,20 +33,3 @@ brew install --cask multipass # or see https://multipass.run/install
cd deploy/scripts
sh install-on-mac.sh # create vm & setup in it
```

3. Start laf server

```bash
# Forward service in cluster to localhost, run this command in another terminal separately
kubectl port-forward deployment/mongodb 27017:27017 -n laf-system
kubectl port-forward deployments/casdoor 30070:8000 -n laf-system

# Run these in first time or when someone change the schema.
cd server
npm install
npx prisma db push
npx prisma generate

# run dev
npm run watch
```
19 changes: 16 additions & 3 deletions deploy/scripts/install-on-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,36 @@ baseurl=https://yum.fury.io/labring/
enabled=1
gpgcheck=0
EOF
yum update
# yum update
yum clean all
yum install sealos -y
else
echo "yum not installed"
fi

ARCH=$(arch | sed s/aarch64/arm64/ | sed s/x86_64/amd64/)
echo "ARCH: $ARCH"

# if sealos not installed
if [ ! -x "$(command -v sealos)" ]; then
echo "sealos not installed"
exit 1
# download sealos
# wget https://oss.lafyun.com/xaqth3-data/sealos_4.1.4-rc2_linux_${ARCH}.tar.gz && \
# tar -zxvf sealos_4.1.4-rc2_linux_arm64.tar.gz sealos && chmod +x sealos && mv sealos /usr/bin
fi


# install k8s cluster
sealos run labring/kubernetes:v1.24.0-4.1.1 labring/flannel:v0.19.0 --single
# sealos run labring/kubernetes:v1.24.0 labring/flannel:v0.19.0 labring/helm:v3.8.2 --single
sealos run labring/kubernetes:v1.24.9 labring/flannel:v0.19.0 labring/helm:v3.8.2 --single

# taint master node
NODENAME=$(kubectl get nodes -ojsonpath='{.items[0].metadata.name}')
kubectl taint node $NODENAME node-role.kubernetes.io/master-
kubectl taint node $NODENAME node-role.kubernetes.io/control-plane-

# install required components
sealos run labring/helm:v3.8.2
sealos run labring/openebs:v1.9.0
sealos run labring/cert-manager:v1.8.0

Expand Down

0 comments on commit 0fe81df

Please sign in to comment.