mirror of
https://gitee.com/XM-GO/PandaX.git
synced 2026-04-23 02:48:34 +08:00
更新K3S,docker-compose两种部署方式
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
## K3S
|
||||
# K3S安装
|
||||
## K3S安装及卸载
|
||||
1. 安装
|
||||
curl -sfL http://rancher-mirror.cnrancher.com/k3s/k3s-install.sh | INSTALL_K3S_MIRROR=cn INSTALL_K3S_VERSION="v1.23.1+k3s1" sh -
|
||||
2. 卸载
|
||||
sudo /usr/local/bin/k3s-uninstall.sh
|
||||
|
||||
## mysql 安装
|
||||
1. kubectl kustomize ./deploy/mysql -o ./deploy/mysql.yaml
|
||||
2. kubectl apply -f ./deploy/mysql.yaml
|
||||
## 服务安装 安装
|
||||
1. kubectl kustomize deploy/manifest-server -o deploy/deploy-server.yaml
|
||||
2. kubectl apply -f ./deploy/deploy-server.yaml
|
||||
|
||||
## k3s部署流程
|
||||
1. 设置打包环境
|
||||
@@ -15,9 +16,9 @@ sudo /usr/local/bin/k3s-uninstall.sh
|
||||
2. 构建Linux执行命令
|
||||
go build -o pandax .
|
||||
4. 构建docker镜像 (修改版本号 xmadmin/pandax:v1.0)
|
||||
docker build -t xmadmin/pandax:v1.4 --rm .
|
||||
docker build -t pandax:v1.4 --rm .
|
||||
5. 上传daocker镜像
|
||||
docker push xmadmin/pandax:v1.4
|
||||
docker push pandax:v1.4
|
||||
6. 生成 deploy.yaml
|
||||
kubectl kustomize deploy/manifest -o deploy/deploy.yaml
|
||||
7. k8s安装yaml
|
||||
@@ -26,4 +27,20 @@ sudo /usr/local/bin/k3s-uninstall.sh
|
||||
## 查看部署状态
|
||||
8. 查看 yaml 的安装状态
|
||||
kubectl get pods -n pandax
|
||||
kubectl get services -n pandax
|
||||
kubectl get services -n pandax
|
||||
|
||||
|
||||
# docker-compose安装
|
||||
## 安装 docker-compose
|
||||
```text
|
||||
curl -L "https://github.com/docker/compose/releases/download/v2.16.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
|
||||
```
|
||||
## 赋予权限
|
||||
```text
|
||||
sudo chmod +x /usr/local/bin/docker-compose
|
||||
```
|
||||
|
||||
## 执行创建命令
|
||||
```text
|
||||
docker-compose up
|
||||
```
|
||||
268
deploy/deploy-server.yaml
Normal file
268
deploy/deploy-server.yaml
Normal file
@@ -0,0 +1,268 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: pandax
|
||||
app.kubernetes.io/version: 1.0.0
|
||||
name: pandax
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: pandax
|
||||
app.kubernetes.io/version: 1.0.0
|
||||
name: pandax
|
||||
namespace: pandax
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: pandax
|
||||
app.kubernetes.io/version: 1.0.0
|
||||
name: pandax-rolebinding
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: cluster-admin
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: pandax
|
||||
namespace: pandax
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/version: 1.0.0
|
||||
name: emqx
|
||||
namespace: pandax
|
||||
spec:
|
||||
ports:
|
||||
- port: 1883
|
||||
protocol: TCP
|
||||
targetPort: 1883
|
||||
- port: 8083
|
||||
protocol: TCP
|
||||
targetPort: 8083
|
||||
- port: 8084
|
||||
protocol: TCP
|
||||
targetPort: 8084
|
||||
- port: 8883
|
||||
protocol: TCP
|
||||
targetPort: 8883
|
||||
- port: 18083
|
||||
protocol: TCP
|
||||
targetPort: 18083
|
||||
selector:
|
||||
app: emqx
|
||||
app.kubernetes.io/version: 1.0.0
|
||||
type: LoadBalancer
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/version: 1.0.0
|
||||
name: mysql
|
||||
namespace: pandax
|
||||
spec:
|
||||
ports:
|
||||
- port: 3306
|
||||
protocol: TCP
|
||||
targetPort: mysql
|
||||
selector:
|
||||
app: mysql
|
||||
app.kubernetes.io/version: 1.0.0
|
||||
type: LoadBalancer
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/version: 1.0.0
|
||||
name: redis
|
||||
namespace: pandax
|
||||
spec:
|
||||
ports:
|
||||
- port: 6379
|
||||
protocol: TCP
|
||||
targetPort: redis
|
||||
selector:
|
||||
app: redis
|
||||
app.kubernetes.io/version: 1.0.0
|
||||
type: LoadBalancer
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/version: 1.0.0
|
||||
name: tdengine
|
||||
namespace: pandax
|
||||
spec:
|
||||
ports:
|
||||
- port: 6030
|
||||
protocol: TCP
|
||||
targetPort: 6030
|
||||
- port: 6041
|
||||
protocol: TCP
|
||||
targetPort: 6041
|
||||
selector:
|
||||
app: tdengine
|
||||
app.kubernetes.io/version: 1.0.0
|
||||
type: LoadBalancer
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/version: 1.0.0
|
||||
name: emqx
|
||||
namespace: pandax
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: emqx
|
||||
app.kubernetes.io/version: 1.0.0
|
||||
strategy:
|
||||
type: Recreate
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: emqx
|
||||
app.kubernetes.io/version: 1.0.0
|
||||
spec:
|
||||
containers:
|
||||
- image: emqx/emqx:5.1.0
|
||||
imagePullPolicy: IfNotPresent
|
||||
name: emqx
|
||||
ports:
|
||||
- containerPort: 1883
|
||||
protocol: TCP
|
||||
- containerPort: 8083
|
||||
protocol: TCP
|
||||
- containerPort: 8084
|
||||
protocol: TCP
|
||||
- containerPort: 8883
|
||||
protocol: TCP
|
||||
- containerPort: 18083
|
||||
protocol: TCP
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/version: 1.0.0
|
||||
name: mysql
|
||||
namespace: pandax
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: mysql
|
||||
app.kubernetes.io/version: 1.0.0
|
||||
strategy:
|
||||
type: Recreate
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: mysql
|
||||
app.kubernetes.io/version: 1.0.0
|
||||
spec:
|
||||
containers:
|
||||
- env:
|
||||
- name: MYSQL_ROOT_PASSWORD
|
||||
value: pandax
|
||||
image: mysql:8.0.23
|
||||
imagePullPolicy: IfNotPresent
|
||||
name: mysql
|
||||
ports:
|
||||
- containerPort: 3306
|
||||
name: mysql
|
||||
protocol: TCP
|
||||
volumeMounts:
|
||||
- mountPath: /var/lib/mysql
|
||||
name: mysql-data
|
||||
volumes:
|
||||
- hostPath:
|
||||
name: mysql-data
|
||||
path: ./mysql/data
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/version: 1.0.0
|
||||
name: redis
|
||||
namespace: pandax
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: redis
|
||||
app.kubernetes.io/version: 1.0.0
|
||||
strategy:
|
||||
type: Recreate
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: redis
|
||||
app.kubernetes.io/version: 1.0.0
|
||||
spec:
|
||||
containers:
|
||||
- env:
|
||||
- name: requirepass
|
||||
value: pandax
|
||||
image: redis:7.0.12
|
||||
imagePullPolicy: IfNotPresent
|
||||
name: redis
|
||||
ports:
|
||||
- containerPort: 3306
|
||||
name: redis
|
||||
protocol: TCP
|
||||
volumeMounts:
|
||||
- mountPath: /data
|
||||
name: redis-data
|
||||
- mountPath: /logs
|
||||
name: mysql-log
|
||||
volumes:
|
||||
- hostPath:
|
||||
name: redis-data
|
||||
path: ./redis/data
|
||||
- hostPath:
|
||||
name: redis-log
|
||||
path: ./redis/logs
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/version: 1.0.0
|
||||
name: tdengine
|
||||
namespace: pandax
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: tdengine
|
||||
app.kubernetes.io/version: 1.0.0
|
||||
strategy:
|
||||
type: Recreate
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: tdengine
|
||||
app.kubernetes.io/version: 1.0.0
|
||||
spec:
|
||||
containers:
|
||||
- image: tdengine/tdengine:3.0.4.2
|
||||
imagePullPolicy: IfNotPresent
|
||||
name: tdengine
|
||||
ports:
|
||||
- containerPort: 6030
|
||||
protocol: TCP
|
||||
- containerPort: 6041
|
||||
protocol: TCP
|
||||
@@ -1,37 +1,4 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: pandax
|
||||
app.kubernetes.io/version: 1.0.0
|
||||
name: pandax
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: pandax
|
||||
app.kubernetes.io/version: 1.0.0
|
||||
name: pandax
|
||||
namespace: pandax
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: pandax
|
||||
app.kubernetes.io/version: 1.0.0
|
||||
name: pandax-rolebinding
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: cluster-admin
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: pandax
|
||||
namespace: pandax
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
labels:
|
||||
@@ -41,15 +8,83 @@ metadata:
|
||||
namespace: pandax
|
||||
spec:
|
||||
ports:
|
||||
- name: http
|
||||
port: 8080
|
||||
- port: 7788
|
||||
protocol: TCP
|
||||
targetPort: http
|
||||
targetPort: 7788
|
||||
- port: 9001
|
||||
protocol: TCP
|
||||
targetPort: 9001
|
||||
- port: 9002
|
||||
protocol: TCP
|
||||
targetPort: 9002
|
||||
- port: 9003
|
||||
protocol: TCP
|
||||
targetPort: 9003
|
||||
- port: 8801
|
||||
protocol: TCP
|
||||
targetPort: 8801
|
||||
- port: 5060
|
||||
protocol: TCP
|
||||
targetPort: 5060
|
||||
selector:
|
||||
app.kubernetes.io/name: pandax
|
||||
app.kubernetes.io/version: 1.0.0
|
||||
type: LoadBalancer
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: pandaxrule
|
||||
app.kubernetes.io/version: 1.0.0
|
||||
name: pandaxrule
|
||||
namespace: pandax
|
||||
spec:
|
||||
ports:
|
||||
- port: 7791
|
||||
protocol: TCP
|
||||
targetPort: 7791
|
||||
selector:
|
||||
app.kubernetes.io/name: pandaxrule
|
||||
app.kubernetes.io/version: 1.0.0
|
||||
type: LoadBalancer
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: pandaxscreen
|
||||
app.kubernetes.io/version: 1.0.0
|
||||
name: pandaxscreen
|
||||
namespace: pandax
|
||||
spec:
|
||||
ports:
|
||||
- port: 7790
|
||||
protocol: TCP
|
||||
targetPort: 7790
|
||||
selector:
|
||||
app.kubernetes.io/name: pandaxscreen
|
||||
app.kubernetes.io/version: 1.0.0
|
||||
type: LoadBalancer
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: pandaxweb
|
||||
app.kubernetes.io/version: 1.0.0
|
||||
name: pandaxweb
|
||||
namespace: pandax
|
||||
spec:
|
||||
ports:
|
||||
- port: 7788
|
||||
protocol: TCP
|
||||
targetPort: 7789
|
||||
selector:
|
||||
app.kubernetes.io/name: pandaxweb
|
||||
app.kubernetes.io/version: 1.0.0
|
||||
type: LoadBalancer
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
@@ -71,11 +106,107 @@ spec:
|
||||
app.kubernetes.io/version: 1.0.0
|
||||
spec:
|
||||
containers:
|
||||
- image: xmadmin/pandax:v1.4
|
||||
imagePullPolicy: Always
|
||||
- image: ccr.ccs.tencentyun.com/pandax/pandax:v1.9.1
|
||||
imagePullPolicy: IfNotPresent
|
||||
name: pandax
|
||||
ports:
|
||||
- containerPort: 7788
|
||||
name: http
|
||||
protocol: TCP
|
||||
- containerPort: 9001
|
||||
protocol: TCP
|
||||
- containerPort: 9002
|
||||
protocol: TCP
|
||||
- containerPort: 9003
|
||||
protocol: TCP
|
||||
- containerPort: 8801
|
||||
protocol: TCP
|
||||
- containerPort: 5060
|
||||
protocol: TCP
|
||||
serviceAccountName: pandax
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: pandaxrule
|
||||
app.kubernetes.io/version: 1.0.0
|
||||
name: pandaxrule
|
||||
namespace: pandax
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: pandaxrule
|
||||
app.kubernetes.io/version: 1.0.0
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: pandaxrule
|
||||
app.kubernetes.io/version: 1.0.0
|
||||
spec:
|
||||
containers:
|
||||
- image: ccr.ccs.tencentyun.com/pandax/pandaxrule:v1.8
|
||||
imagePullPolicy: IfNotPresent
|
||||
name: pandaxrule
|
||||
ports:
|
||||
- containerPort: 7791
|
||||
protocol: TCP
|
||||
serviceAccountName: pandaxrule
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: pandaxscreen
|
||||
app.kubernetes.io/version: 1.0.0
|
||||
name: pandaxscreen
|
||||
namespace: pandax
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: pandaxscreen
|
||||
app.kubernetes.io/version: 1.0.0
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: pandaxscreen
|
||||
app.kubernetes.io/version: 1.0.0
|
||||
spec:
|
||||
containers:
|
||||
- image: ccr.ccs.tencentyun.com/pandax/pandaxscreen:v1.9.1
|
||||
imagePullPolicy: IfNotPresent
|
||||
name: pandaxscreen
|
||||
ports:
|
||||
- containerPort: 7790
|
||||
protocol: TCP
|
||||
serviceAccountName: pandaxscreen
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: pandaxweb
|
||||
app.kubernetes.io/version: 1.0.0
|
||||
name: pandaxweb
|
||||
namespace: pandax
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: pandaxweb
|
||||
app.kubernetes.io/version: 1.0.0
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: pandaxweb
|
||||
app.kubernetes.io/version: 1.0.0
|
||||
spec:
|
||||
containers:
|
||||
- image: ccr.ccs.tencentyun.com/pandax/pandaxweb:v1.9.1
|
||||
imagePullPolicy: IfNotPresent
|
||||
name: pandaxweb
|
||||
ports:
|
||||
- containerPort: 7789
|
||||
protocol: TCP
|
||||
serviceAccountName: pandaxweb
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
version: '3.2'
|
||||
services:
|
||||
redis:
|
||||
image: redis:7.0.12
|
||||
@@ -6,19 +7,20 @@ services:
|
||||
environment:
|
||||
requirepass: pandax
|
||||
volumes:
|
||||
- "./redis/conf/redis.conf:/etc/redis/redis.conf"
|
||||
- "./redis/data:/data"
|
||||
- "./redis/logs:/logs"
|
||||
command: ["redis-server","/etc/redis/redis.conf"]
|
||||
ports:
|
||||
- 6379:6379
|
||||
tdengine:
|
||||
image: tdengine/tdengine:3.0.4.2
|
||||
container_name: tdengine-server
|
||||
restart: always
|
||||
environment:
|
||||
- TZ=Asia/Shanghai
|
||||
ports:
|
||||
- 6030:6030
|
||||
- 6041:6041
|
||||
- 6030-6040:6030-6040/udp
|
||||
emqx:
|
||||
image: emqx/emqx:5.1.0
|
||||
restart: always
|
||||
@@ -34,9 +36,43 @@ services:
|
||||
container_name: mysql-server
|
||||
restart: always
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: 123456
|
||||
MYSQL_ROOT_PASSWORD: pandax
|
||||
MYSQL_DATABASE: pandax_iot
|
||||
volumes:
|
||||
- ./mysql/data:/var/lib/mysql
|
||||
ports:
|
||||
- "3306:3306"
|
||||
- "3306:3306"
|
||||
pandax:
|
||||
image: ccr.ccs.tencentyun.com/pandax/pandax:v1.9.1
|
||||
container_name: pandax
|
||||
restart: always
|
||||
depends_on:
|
||||
- mysql-server
|
||||
- emqx-server
|
||||
- tdengine-server
|
||||
- redis
|
||||
ports:
|
||||
- "7788:7788"
|
||||
- "9001:9001"
|
||||
- "9002:9002"
|
||||
- "9003:9003"
|
||||
- "8801:8801"
|
||||
- "5060:5060"
|
||||
pandax-web:
|
||||
image: ccr.ccs.tencentyun.com/pandax/pandaxweb:v1.9.1
|
||||
container_name: pandax-web
|
||||
restart: always
|
||||
ports:
|
||||
- "7789:7789"
|
||||
pandax-screen:
|
||||
image: ccr.ccs.tencentyun.com/pandax/pandaxscreen:v1.9.1
|
||||
container_name: pandax-screen
|
||||
restart: always
|
||||
ports:
|
||||
- "7790:7790"
|
||||
pandax-rule:
|
||||
image: ccr.ccs.tencentyun.com/pandax/pandaxrule:v1.8
|
||||
container_name: pandax-rule
|
||||
restart: always
|
||||
ports:
|
||||
- "7791:7791"
|
||||
56
deploy/manifest-server/emqx/deployment-service.yaml
Normal file
56
deploy/manifest-server/emqx/deployment-service.yaml
Normal file
@@ -0,0 +1,56 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: emqx
|
||||
spec:
|
||||
type: LoadBalancer
|
||||
ports:
|
||||
- port: 1883
|
||||
targetPort: 1883
|
||||
protocol: TCP
|
||||
- port: 8083
|
||||
targetPort: 8083
|
||||
protocol: TCP
|
||||
- port: 8084
|
||||
targetPort: 8084
|
||||
protocol: TCP
|
||||
- port: 8883
|
||||
targetPort: 8883
|
||||
protocol: TCP
|
||||
- port: 18083
|
||||
targetPort: 18083
|
||||
protocol: TCP
|
||||
selector:
|
||||
app: emqx
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: emqx
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: emqx
|
||||
strategy:
|
||||
type: Recreate
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: emqx
|
||||
spec:
|
||||
containers:
|
||||
- image: emqx/emqx:5.1.0
|
||||
name: emqx
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- containerPort: 1883
|
||||
protocol: TCP
|
||||
- containerPort: 8083
|
||||
protocol: TCP
|
||||
- containerPort: 8084
|
||||
protocol: TCP
|
||||
- containerPort: 8883
|
||||
protocol: TCP
|
||||
- containerPort: 18083
|
||||
protocol: TCP
|
||||
11
deploy/manifest-server/kustomization.yaml
Normal file
11
deploy/manifest-server/kustomization.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
resources:
|
||||
- namespace.yaml
|
||||
- rbac.yaml
|
||||
- mysql/deployment-service.yaml
|
||||
- redis/deployment-service.yaml
|
||||
- emqx/deployment-service.yaml
|
||||
- tdengine/deployment-service.yaml
|
||||
|
||||
commonLabels:
|
||||
app.kubernetes.io/version: 1.0.0
|
||||
namespace: pandax
|
||||
@@ -16,6 +16,7 @@ kind: Deployment
|
||||
metadata:
|
||||
name: mysql
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: mysql
|
||||
@@ -29,6 +30,7 @@ spec:
|
||||
containers:
|
||||
- image: mysql:8.0.23
|
||||
name: mysql
|
||||
imagePullPolicy: IfNotPresent
|
||||
env:
|
||||
- name: MYSQL_ROOT_PASSWORD
|
||||
value: pandax
|
||||
@@ -37,9 +39,9 @@ spec:
|
||||
name: mysql
|
||||
protocol: TCP
|
||||
volumeMounts:
|
||||
- name: mysql-persistent-storage
|
||||
- name: mysql-data
|
||||
mountPath: /var/lib/mysql
|
||||
volumes:
|
||||
- name: mysql-persistent-storage
|
||||
persistentVolumeClaim:
|
||||
claimName: mysql-pv-claim
|
||||
- hostPath:
|
||||
path: ./mysql/data
|
||||
name: mysql-data
|
||||
52
deploy/manifest-server/redis/deployment-service.yaml
Normal file
52
deploy/manifest-server/redis/deployment-service.yaml
Normal file
@@ -0,0 +1,52 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: redis
|
||||
spec:
|
||||
type: LoadBalancer
|
||||
ports:
|
||||
- port: 6379
|
||||
targetPort: redis
|
||||
protocol: TCP
|
||||
selector:
|
||||
app: redis
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: redis
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: redis
|
||||
strategy:
|
||||
type: Recreate
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: redis
|
||||
spec:
|
||||
containers:
|
||||
- image: redis:7.0.12
|
||||
name: redis
|
||||
imagePullPolicy: IfNotPresent
|
||||
env:
|
||||
- name: requirepass
|
||||
value: pandax
|
||||
ports:
|
||||
- containerPort: 3306
|
||||
name: redis
|
||||
protocol: TCP
|
||||
volumeMounts:
|
||||
- name: redis-data
|
||||
mountPath: /data
|
||||
- name: mysql-log
|
||||
mountPath: /logs
|
||||
volumes:
|
||||
- hostPath:
|
||||
path: ./redis/data
|
||||
name: redis-data
|
||||
- hostPath:
|
||||
path: ./redis/logs
|
||||
name: redis-log
|
||||
41
deploy/manifest-server/tdengine/deployment-service.yaml
Normal file
41
deploy/manifest-server/tdengine/deployment-service.yaml
Normal file
@@ -0,0 +1,41 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: tdengine
|
||||
spec:
|
||||
type: LoadBalancer
|
||||
ports:
|
||||
- port: 6030
|
||||
targetPort: 6030
|
||||
protocol: TCP
|
||||
- port: 6041
|
||||
targetPort: 6041
|
||||
protocol: TCP
|
||||
selector:
|
||||
app: tdengine
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: tdengine
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: tdengine
|
||||
strategy:
|
||||
type: Recreate
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: tdengine
|
||||
spec:
|
||||
containers:
|
||||
- image: tdengine/tdengine:3.0.4.2
|
||||
name: tdengine
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- containerPort: 6030
|
||||
protocol: TCP
|
||||
- containerPort: 6041
|
||||
protocol: TCP
|
||||
@@ -1,25 +0,0 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: pandax
|
||||
labels:
|
||||
app.kubernetes.io/name: pandax
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: pandax
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: pandax
|
||||
spec:
|
||||
serviceAccountName: pandax
|
||||
containers:
|
||||
- name: pandax
|
||||
image: xmadmin/pandax:v1.0
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: 8080
|
||||
protocol: TCP
|
||||
@@ -1,8 +1,8 @@
|
||||
resources:
|
||||
- namespace.yaml
|
||||
- rbac.yaml
|
||||
- service.yaml
|
||||
- deployment.yaml
|
||||
- pandax/pandax-deployment-service.yaml
|
||||
- pandax/pandaxweb-deployment-service.yaml
|
||||
- pandax/pandaxrule-deployment-service.yaml
|
||||
- pandax/pandaxscreen-deployment-service.yaml
|
||||
|
||||
commonLabels:
|
||||
app.kubernetes.io/version: 1.0.0
|
||||
|
||||
65
deploy/manifest/pandax/pandax-deployment-service.yaml
Normal file
65
deploy/manifest/pandax/pandax-deployment-service.yaml
Normal file
@@ -0,0 +1,65 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: pandax
|
||||
labels:
|
||||
app.kubernetes.io/name: pandax
|
||||
spec:
|
||||
type: LoadBalancer
|
||||
ports:
|
||||
- port: 7788
|
||||
targetPort: 7788
|
||||
protocol: TCP
|
||||
- port: 9001
|
||||
targetPort: 9001
|
||||
protocol: TCP
|
||||
- port: 9002
|
||||
targetPort: 9002
|
||||
protocol: TCP
|
||||
- port: 9003
|
||||
targetPort: 9003
|
||||
protocol: TCP
|
||||
- port: 8801
|
||||
targetPort: 8801
|
||||
protocol: TCP
|
||||
- port: 5060
|
||||
targetPort: 5060
|
||||
protocol: TCP
|
||||
selector:
|
||||
app.kubernetes.io/name: pandax
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: pandax
|
||||
labels:
|
||||
app.kubernetes.io/name: pandax
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: pandax
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: pandax
|
||||
spec:
|
||||
serviceAccountName: pandax
|
||||
containers:
|
||||
- name: pandax
|
||||
image: ccr.ccs.tencentyun.com/pandax/pandax:v1.9.1
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- containerPort: 7788
|
||||
protocol: TCP
|
||||
- containerPort: 9001
|
||||
protocol: TCP
|
||||
- containerPort: 9002
|
||||
protocol: TCP
|
||||
- containerPort: 9003
|
||||
protocol: TCP
|
||||
- containerPort: 8801
|
||||
protocol: TCP
|
||||
- containerPort: 5060
|
||||
protocol: TCP
|
||||
|
||||
40
deploy/manifest/pandax/pandaxrule-deployment-service.yaml
Normal file
40
deploy/manifest/pandax/pandaxrule-deployment-service.yaml
Normal file
@@ -0,0 +1,40 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: pandaxrule
|
||||
labels:
|
||||
app.kubernetes.io/name: pandaxrule
|
||||
spec:
|
||||
type: LoadBalancer
|
||||
ports:
|
||||
- port: 7791
|
||||
targetPort: 7791
|
||||
protocol: TCP
|
||||
selector:
|
||||
app.kubernetes.io/name: pandaxrule
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: pandaxrule
|
||||
labels:
|
||||
app.kubernetes.io/name: pandaxrule
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: pandaxrule
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: pandaxrule
|
||||
spec:
|
||||
serviceAccountName: pandaxrule
|
||||
containers:
|
||||
- name: pandaxrule
|
||||
image: ccr.ccs.tencentyun.com/pandax/pandaxrule:v1.8
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- containerPort: 7791
|
||||
protocol: TCP
|
||||
|
||||
40
deploy/manifest/pandax/pandaxscreen-deployment-service.yaml
Normal file
40
deploy/manifest/pandax/pandaxscreen-deployment-service.yaml
Normal file
@@ -0,0 +1,40 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: pandaxscreen
|
||||
labels:
|
||||
app.kubernetes.io/name: pandaxscreen
|
||||
spec:
|
||||
type: LoadBalancer
|
||||
ports:
|
||||
- port: 7790
|
||||
targetPort: 7790
|
||||
protocol: TCP
|
||||
selector:
|
||||
app.kubernetes.io/name: pandaxscreen
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: pandaxscreen
|
||||
labels:
|
||||
app.kubernetes.io/name: pandaxscreen
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: pandaxscreen
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: pandaxscreen
|
||||
spec:
|
||||
serviceAccountName: pandaxscreen
|
||||
containers:
|
||||
- name: pandaxscreen
|
||||
image: ccr.ccs.tencentyun.com/pandax/pandaxscreen:v1.9.1
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- containerPort: 7790
|
||||
protocol: TCP
|
||||
|
||||
40
deploy/manifest/pandax/pandaxweb-deployment-service.yaml
Normal file
40
deploy/manifest/pandax/pandaxweb-deployment-service.yaml
Normal file
@@ -0,0 +1,40 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: pandaxweb
|
||||
labels:
|
||||
app.kubernetes.io/name: pandaxweb
|
||||
spec:
|
||||
type: LoadBalancer
|
||||
ports:
|
||||
- port: 7788
|
||||
targetPort: 7789
|
||||
protocol: TCP
|
||||
selector:
|
||||
app.kubernetes.io/name: pandaxweb
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: pandaxweb
|
||||
labels:
|
||||
app.kubernetes.io/name: pandaxweb
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: pandaxweb
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: pandaxweb
|
||||
spec:
|
||||
serviceAccountName: pandaxweb
|
||||
containers:
|
||||
- name: pandaxweb
|
||||
image: ccr.ccs.tencentyun.com/pandax/pandaxweb:v1.9.1
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- containerPort: 7789
|
||||
protocol: TCP
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: pandax
|
||||
labels:
|
||||
app.kubernetes.io/name: pandax
|
||||
spec:
|
||||
type: LoadBalancer
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: http
|
||||
protocol: TCP
|
||||
name: http
|
||||
selector:
|
||||
app.kubernetes.io/name: pandax
|
||||
@@ -1,8 +0,0 @@
|
||||
resources:
|
||||
- namespace.yaml
|
||||
- mysql-pv.yaml
|
||||
- deployment-service.yaml
|
||||
|
||||
commonLabels:
|
||||
app.kubernetes.io/version: 1.0.0
|
||||
namespace: pandax-db
|
||||
@@ -1,26 +0,0 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: mysql-pv-volume
|
||||
labels:
|
||||
type: local
|
||||
spec:
|
||||
storageClassName: manual
|
||||
capacity:
|
||||
storage: 20Gi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
hostPath:
|
||||
path: "/mnt/data"
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: mysql-pv-claim
|
||||
spec:
|
||||
storageClassName: manual
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 20Gi
|
||||
@@ -1,7 +0,0 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: mysql
|
||||
app.kubernetes.io/version: master
|
||||
name: pandax-db
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user