Skip to content

Commit c8e75a4

Browse files
authored
Optimize cmd and k8s directory structure (#45)
Signed-off-by: Jiangnan Jia <[email protected]>
1 parent 00b50db commit c8e75a4

File tree

4 files changed

+11
-90
lines changed

4 files changed

+11
-90
lines changed

README.md

Lines changed: 1 addition & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -5,85 +5,4 @@ OpenSergo control plane enables unified management for microservice governance r
55
![arch](https://user-images.githubusercontent.com/9434884/182856237-8ce85f41-1a1a-4a2a-8f58-db042bd4db42.png)
66

77
# How to Start
8-
9-
## step 1 : prepare kubernetes
10-
Please ensure that one of the following conditions is satisfied:
11-
- make sure you are in the kubernetes cluster.
12-
- make sure the `kubeconfig` is ok in you local.
13-
14-
## step 2 : init OpenSergo (CRDs & Namespace & RBAC)
15-
### install all CRDs in following directories:
16-
- [./k8s/crd/bases](./k8s/crd/bases)
17-
18-
you can just only execute commands,like :
19-
``` shell
20-
kubectl apply -f ./k8s/crd/bases/fault-tolerance.opensergo.io_circuitbreakerstrategies.yaml
21-
kubectl apply -f ./k8s/crd/bases/fault-tolerance.opensergo.io_concurrencylimitstrategies.yaml
22-
kubectl apply -f ./k8s/crd/bases/fault-tolerance.opensergo.io_faulttolerancerules.yaml
23-
kubectl apply -f ./k8s/crd/bases/fault-tolerance.opensergo.io_ratelimitstrategies.yaml
24-
kubectl apply -f ./k8s/crd/bases/fault-tolerance.opensergo.io_throttlingstrategies.yaml
25-
kubectl apply -f ./k8s/crd/bases/traffic.opensergo.io_trafficerouters.yaml
26-
```
27-
28-
### install Namespace in following directories:
29-
- [./k8s/namespace.yaml](./k8s/namespace.yaml)
30-
31-
you can just only execute commands,like :
32-
``` shell
33-
kubectl apply -f ./k8s/namespace.yaml
34-
```
35-
36-
### install RBAC in following directories:
37-
- [./k8s/rbac](./k8s/rbac)
38-
39-
you can just only execute commands,like :
40-
``` shell
41-
kubectl apply -f ./k8s/rbac/rbac.yaml
42-
```
43-
44-
### or you can directly execute the file [./cmd/install/init.sh](./cmd/install/init.sh) to install CRDs、 Namespace、 RBAC, like:
45-
``` shell
46-
wget --no-check-certificate https://raw.githubusercontent.com/opensergo/opensergo-control-plane/main/cmd/install/init.sh && chmod +x init.sh && ./init.sh
47-
```
48-
if you execute cmd above, some resources will download in `$HOME/opensergo/opensergo-control-plane`.
49-
50-
## step 3 : start OpenSergo Control Plane
51-
we provide several ways to start OpenSergo Control Plane.
52-
53-
The default **port** is **10246**
54-
55-
### 1st : start it by exec the binary executable file.
56-
download or build the binary executable file
57-
- download the binary executable file in the release or tag page.
58-
- build the binary executable file by yourself.
59-
60-
### 2nd : start it by container image
61-
we provide a container image in Docker Hub, you can start it by the container image.
62-
- Docker Hub: opensergo/opensergo-control-plane:0.0.1-alpha-1
63-
- aliyuncs: opensergo-registry.cn-hangzhou.cr.aliyuncs.com/opensergo/opensergo-control-plane:0.1.0
64-
65-
``` shell
66-
docker run -p 10246:10246 opensergo/opensergo-control-plane
67-
```
68-
If you start it in another container runtime rather than kubernetes pod, you should config the `kubeconfig` in the container runtime.
69-
70-
### 3rd : start it by kubernetes workload (deployment + service)
71-
72-
apply yaml :
73-
- [./cmd/install/k8s/opensergo-control-plane.yaml](./cmd/install/k8s/opensergo-control-plane.yaml)
74-
75-
you can just only execute commands,like :
76-
``` shell
77-
kubectl apply -f ./cmd/install/k8s/opensergo-control-plane.yaml
78-
```
79-
80-
or you can also execute the file [./cmd/install/k8s/deploy.sh](./cmd/install/k8s/deploy.sh) directly, like:
81-
``` shell
82-
wget --no-check-certificate https://raw.githubusercontent.com/opensergo/opensergo-control-plane/main/cmd/install/k8s/deploy.sh && chmod +x deploy.sh && ./deploy.sh
83-
```
84-
if you execute cmd above, some resources will download in `$HOME/opensergo/opensergo-control-plane`,
85-
you can change modify `$HOME/opensergo/opensergo-control-plane/cmd/install/k8s/opensergo-control-plane.yaml` by yourself,
86-
for example change the Service from `ClusterIP` to `NodePort/LoadBalancer`
87-
88-
### 4th : start it by helm (Work In Process)
89-
we provide a Helm Chart in the repo, you can use it directly.
8+
detail refers to [quick-start/opensergo-control-plane](https://opensergo.io/docs/quick-start/opensergo-control-plane/)
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,13 @@ OPENSERGO_CONTROL_PLANE_HOME=$HOME/opensergo/opensergo-control-plane
2121
mkdir -p $OPENSERGO_CONTROL_PLANE_HOME
2222

2323

24+
# Uninstall rbac.yaml
25+
kubectl delete -f $OPENSERGO_CONTROL_PLANE_HOME/k8s/rbac/rbac.yaml
26+
# Uninstall Namespace
27+
kubectl delete -f $OPENSERGO_CONTROL_PLANE_HOME/k8s/namespace.yaml
2428
# Uninstall CRDs
2529
kubectl delete -f $OPENSERGO_CONTROL_PLANE_HOME/k8s/crd/bases
30+
2631
# Download CRDs ./k8s/crd/bases
2732
mkdir -p $OPENSERGO_CONTROL_PLANE_HOME/k8s/crd/bases
2833
wget --no-check-certificate -O $OPENSERGO_CONTROL_PLANE_HOME/k8s/crd/bases/fault-tolerance.opensergo.io_circuitbreakerstrategies.yaml https://raw.githubusercontent.com/opensergo/opensergo-control-plane/main/k8s/crd/bases/fault-tolerance.opensergo.io_circuitbreakerstrategies.yaml
@@ -35,17 +40,13 @@ wget --no-check-certificate -O $OPENSERGO_CONTROL_PLANE_HOME/k8s/crd/bases/traff
3540
kubectl apply -f $OPENSERGO_CONTROL_PLANE_HOME/k8s/crd/bases
3641

3742

38-
# Uninstall Namespace
39-
kubectl delete -f $OPENSERGO_CONTROL_PLANE_HOME/k8s/namespace.yaml
4043
# Download Namespace
4144
mkdir -p $OPENSERGO_CONTROL_PLANE_HOME/k8s
4245
wget --no-check-certificate -O $OPENSERGO_CONTROL_PLANE_HOME/k8s/namespace.yaml https://raw.githubusercontent.com/opensergo/opensergo-control-plane/main/k8s/namespace.yaml
4346
# Install Namespace
4447
kubectl apply -f $OPENSERGO_CONTROL_PLANE_HOME/k8s/namespace.yaml
4548

4649

47-
# Uninstall rbac.yaml
48-
kubectl delete -f $OPENSERGO_CONTROL_PLANE_HOME/k8s/rbac/rbac.yaml
4950
# Download rbac.yaml
5051
mkdir -p $OPENSERGO_CONTROL_PLANE_HOME/k8s/rbac
5152
wget --no-check-certificate -O $OPENSERGO_CONTROL_PLANE_HOME/k8s/rbac/rbac.yaml https://raw.githubusercontent.com/opensergo/opensergo-control-plane/main/k8s/rbac/rbac.yaml

cmd/install/k8s/deploy.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,10 @@ mkdir -p $OPENSERGO_CONTROL_PLANE_HOME
2222

2323

2424
# Uninstall opensergo-control-plane.yaml
25-
kubectl delete -f $OPENSERGO_CONTROL_PLANE_HOME/cmd/install/k8s/opensergo-control-plane.yaml
25+
kubectl delete -f $OPENSERGO_CONTROL_PLANE_HOME/k8s/workload/opensergo-control-plane.yaml
26+
2627
# Download opensergo-control-plane.yaml
27-
mkdir -p $OPENSERGO_CONTROL_PLANE_HOME/cmd/install/k8s
28-
wget --no-check-certificate -O $OPENSERGO_CONTROL_PLANE_HOME/cmd/install/k8s/opensergo-control-plane.yaml https://raw.githubusercontent.com/opensergo/opensergo-control-plane/main/cmd/install/k8s/opensergo-control-plane.yaml
28+
mkdir -p $OPENSERGO_CONTROL_PLANE_HOME/k8s/workload
29+
wget --no-check-certificate -O $OPENSERGO_CONTROL_PLANE_HOME/k8s/workload/opensergo-control-plane.yaml https://raw.githubusercontent.com/opensergo/opensergo-control-plane/main/k8s/workload/opensergo-control-plane.yaml
2930
# Install opensergo-control-plane.yaml
30-
kubectl apply -f $OPENSERGO_CONTROL_PLANE_HOME/cmd/install/k8s/opensergo-control-plane.yaml
31+
kubectl apply -f $OPENSERGO_CONTROL_PLANE_HOME/k8s/workload/opensergo-control-plane.yaml
File renamed without changes.

0 commit comments

Comments
 (0)