Skip to content

Commit 6f5495b

Browse files
authored
Merge pull request #860 from chris-sun-star/argocd-example
Argocd example
2 parents d42ee3a + 452fcb7 commit 6f5495b

File tree

12 files changed

+410
-0
lines changed

12 files changed

+410
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
apiVersion: argoproj.io/v1alpha1
2+
kind: Application
3+
metadata:
4+
name: ob-configserver
5+
namespace: argocd
6+
annotations:
7+
argocd.argoproj.io/hook: PreSync
8+
spec:
9+
project: default
10+
source:
11+
repoURL: https://github.com/oceanbase/ob-operator.git
12+
path: example/argocd/resources/ob-configserver
13+
targetRevision: master
14+
destination:
15+
server: "https://kubernetes.default.svc"
16+
namespace: oceanbase
17+
syncPolicy:
18+
automated:
19+
prune: true
20+
selfHeal: true
21+
syncOptions:
22+
- CreateNamespace=true
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
apiVersion: argoproj.io/v1alpha1
2+
kind: Application
3+
metadata:
4+
name: ob-operator
5+
namespace: argocd
6+
annotations:
7+
argocd.argoproj.io/hook: PreSync
8+
spec:
9+
project: default
10+
source:
11+
repoURL: https://oceanbase.github.io/ob-operator
12+
chart: ob-operator
13+
targetRevision: 2.3.3
14+
helm:
15+
parameters:
16+
- name: reporter
17+
value: "argocd"
18+
destination:
19+
server: "https://kubernetes.default.svc"
20+
namespace: oceanbase-system
21+
syncPolicy:
22+
automated:
23+
prune: true
24+
selfHeal: true
25+
syncOptions:
26+
- CreateNamespace=true

example/argocd/apps/obcluster.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
apiVersion: argoproj.io/v1alpha1
2+
kind: Application
3+
metadata:
4+
name: ob-cluster
5+
namespace: argocd
6+
annotations:
7+
argocd.argoproj.io/sync-wave: "1"
8+
9+
spec:
10+
project: default
11+
source:
12+
repoURL: https://github.com/oceanbase/ob-operator.git
13+
path: example/argocd/resources/obcluster
14+
targetRevision: master
15+
destination:
16+
server: "https://kubernetes.default.svc"
17+
namespace: oceanbase
18+
syncPolicy:
19+
automated:
20+
prune: true
21+
selfHeal: true
22+
ignoreDifferences:
23+
- group: "oceanbase.oceanbase.com"
24+
kind: "OBCluster"
25+
jsonPointers:
26+
- /spec/parameters

example/argocd/apps/obproxy.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
apiVersion: argoproj.io/v1alpha1
2+
kind: Application
3+
metadata:
4+
name: ob-proxy
5+
namespace: argocd
6+
annotations:
7+
argocd.argoproj.io/sync-wave: "1"
8+
spec:
9+
project: default
10+
source:
11+
repoURL: https://github.com/oceanbase/ob-operator.git
12+
path: example/argocd/resources/obproxy
13+
targetRevision: master
14+
destination:
15+
server: "https://kubernetes.default.svc"
16+
namespace: oceanbase
17+
syncPolicy:
18+
automated:
19+
prune: true
20+
selfHeal: true

example/argocd/apps/obtenant.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
apiVersion: argoproj.io/v1alpha1
2+
kind: Application
3+
metadata:
4+
name: ob-tenant
5+
namespace: argocd
6+
annotations:
7+
argocd.argoproj.io/sync-wave: "2"
8+
spec:
9+
project: default
10+
source:
11+
repoURL: https://github.com/oceanbase/ob-operator.git
12+
path: example/argocd/resources/obtenant
13+
targetRevision: master
14+
destination:
15+
server: "https://kubernetes.default.svc"
16+
namespace: oceanbase
17+
syncPolicy:
18+
automated:
19+
prune: true
20+
selfHeal: true
21+
ignoreDifferences:
22+
- group: "oceanbase.oceanbase.com"
23+
kind: "OBTenant"
24+
jsonPointers:
25+
- /spec/pools

example/argocd/apps/secrets.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
apiVersion: argoproj.io/v1alpha1
2+
kind: Application
3+
metadata:
4+
name: secrets
5+
namespace: argocd
6+
annotations:
7+
argocd.argoproj.io/hook: PreSync
8+
spec:
9+
project: default
10+
source:
11+
repoURL: https://github.com/oceanbase/ob-operator.git
12+
path: example/argocd/resources/secrets
13+
targetRevision: master
14+
destination:
15+
server: "https://kubernetes.default.svc"
16+
namespace: oceanbase
17+
syncPolicy:
18+
automated:
19+
prune: true
20+
selfHeal: true
21+
syncOptions:
22+
- CreateNamespace=true
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
apiVersion: argoproj.io/v1alpha1
2+
kind: Application
3+
metadata:
4+
name: oceanbase-stack
5+
namespace: argocd
6+
spec:
7+
project: default
8+
source:
9+
repoURL: https://github.com/oceanbase/ob-operator.git
10+
path: example/argocd/apps
11+
targetRevision: master
12+
destination:
13+
server: "https://kubernetes.default.svc"
14+
namespace: argocd
15+
syncPolicy:
16+
automated:
17+
prune: true
18+
selfHeal: true
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: ob-configserver
5+
namespace: oceanbase
6+
spec:
7+
type: NodePort
8+
selector:
9+
app: ob-configserver
10+
ports:
11+
- name: "http"
12+
port: 8080
13+
targetPort: 8080
14+
nodePort: 30080
15+
---
16+
apiVersion: apps/v1
17+
kind: Deployment
18+
metadata:
19+
name: ob-configserver
20+
namespace: oceanbase
21+
spec:
22+
selector:
23+
matchLabels:
24+
app: ob-configserver
25+
replicas: 1
26+
template:
27+
metadata:
28+
labels:
29+
app: ob-configserver
30+
spec:
31+
containers:
32+
- name: ob-configserver
33+
image: oceanbase/ob-configserver:1.0.0-2
34+
ports:
35+
- containerPort: 8080
36+
name: "http"
37+
env:
38+
- name: DATABASE_TYPE
39+
value: sqlite3
40+
- name: SVC_ADDRESS
41+
value: $(OB_CONFIGSERVER_SERVICE_HOST)
42+
- name: SVC_PORT
43+
value: $(OB_CONFIGSERVER_SERVICE_PORT)
44+
resources:
45+
limits:
46+
memory: 2Gi
47+
cpu: "1"
48+
requests:
49+
memory: 200Mi
50+
cpu: 100m
51+
52+
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
apiVersion: oceanbase.oceanbase.com/v1alpha1
2+
kind: OBCluster
3+
metadata:
4+
name: obcluster
5+
namespace: oceanbase
6+
annotations:
7+
"oceanbase.oceanbase.com/mode": "service"
8+
spec:
9+
clusterName: obcluster
10+
clusterId: 1
11+
userSecrets:
12+
root: root-password
13+
proxyro: proxyro-password
14+
monitor: monitor-password
15+
operator: operator-password
16+
topology:
17+
- zone: zone1
18+
replica: 1
19+
- zone: zone2
20+
replica: 1
21+
- zone: zone3
22+
replica: 1
23+
observer:
24+
image: oceanbase/oceanbase-cloud-native:4.3.5.3-103000092025080818
25+
resource:
26+
memory: 10Gi
27+
storage:
28+
dataStorage:
29+
storageClass: local-path
30+
size: 30Gi
31+
redoLogStorage:
32+
storageClass: local-path
33+
size: 30Gi
34+
logStorage:
35+
storageClass: local-path
36+
size: 10Gi
37+
parameters:
38+
- name: __min_full_resource_pool_memory
39+
value: "2147483648"
40+
- name: system_memory
41+
value: 1G
42+
- name: obconfig_url
43+
value: 'http://ob-configserver.oceanbase.svc:8080/services?Action=ObRootServiceInfo&ObCluster=obcluster'
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: obproxy
5+
namespace: oceanbase
6+
spec:
7+
type: ClusterIP
8+
selector:
9+
app: obproxy
10+
ports:
11+
- name: "sql"
12+
port: 2883
13+
targetPort: 2883
14+
- name: "prometheus"
15+
port: 2884
16+
targetPort: 2884
17+
18+
---
19+
apiVersion: apps/v1
20+
kind: Deployment
21+
metadata:
22+
name: obproxy
23+
namespace: oceanbase
24+
spec:
25+
selector:
26+
matchLabels:
27+
app: obproxy
28+
replicas: 2
29+
template:
30+
metadata:
31+
labels:
32+
app: obproxy
33+
spec:
34+
containers:
35+
- name: obproxy
36+
image: oceanbase/obproxy-ce:4.3.3.0-5
37+
ports:
38+
- containerPort: 2883
39+
name: "sql"
40+
- containerPort: 2884
41+
name: "prometheus"
42+
env:
43+
- name: APP_NAME
44+
value: obcluster
45+
- name: OB_CLUSTER
46+
value: obcluster
47+
- name: CONFIG_URL
48+
value: 'http://ob-configserver.oceanbase.svc:8080/services?Action=GetObProxyConfig'
49+
- name: PROXYRO_PASSWORD
50+
valueFrom:
51+
secretKeyRef:
52+
name: proxyro-password
53+
key: password
54+
resources:
55+
limits:
56+
memory: 2Gi
57+
cpu: "1"
58+
requests:
59+
memory: 200Mi
60+
cpu: 200m

0 commit comments

Comments
 (0)