Pre Merge pull request !319 from RoaringFlame/k8s-deployment

pull/319/MERGE
RoaringFlame 6 months ago committed by Gitee
commit 9439ba1bdb
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

@ -0,0 +1,54 @@
# Kubernates 部署Ruoyi-Cloud项目
本部署所用到的k8s配置均为简易版仅作为初步入门学习使用有不合理的地方还请见谅。
### 后期考虑功能:
* HPA自动扩缩容
* MySQL主从、Redis集群、服务集群
* ELK日志收集
## 容器分布
~~~
namespace
├── redis
│ └── redis // StatefulSet
├── kube-ruoyi
│ └── ruoyi-mysql // Deployment
│ └── ruoyi-nacos
│ └── ruoyi-nginx
│ └── ruoyi-sentinel
│ └── ruoyi-gateway
│ └── ruoyi-auth
│ └── ruoyi-system
│ └── ruoyi-gen
│ └── ruoyi-job
│ └── ruoyi-file
│ └── ruoyi-monitor
│ └── elasticsearch
│ └── skywalking
│ └── skywalking-ui
├── minio
│ └── minio
├── monitor-sa
│ └── node-exporter
│ └── prometheus-server
│ └── monitoring-grafana
~~~
## 部署顺序及要点
1. Redis
2. MySQL手动Dockerfile打包镜像初始化准备好的数据脚本。使用了Secret加密密码等配置。
3. Nacos, 配置好MODE=standalone使用configMap设置数据库。
4. Sentinel
5. Gateway本服务需要用Dockerfile打包镜像否则会报错。其他RuoYi服务可以直接使用spring-boot的image命令一键打包生成镜像[每个服务都有使用额外的SpringBoot配置文件bootstrap-k8s.yml加入到服务中同时在原配置文件中把active换成${SPRING_PROFILES_ACTIVE:dev}后再打包以读取deployment的env变量。启动服务前记得提前在nacos中克隆新增服务配置以把dev改成k8sdeployment中启动的环境是SPRING_PROFILES_ACTIVE=k8s修改好Redis地址redis.redis、MySQL地址(ruoyi-mysql)、Sentinel地址(ruoyi-sentinel)]
6. Nginx部署之前先打包好前端静态文件使用本地磁盘方式挂载到容器 (注我使用的是Window的DockerDesktop启动的K8s挂载磁盘路径必须带/run/desktop/mnt/host)修改好nginx配置ruoyi-gateway就可以启动启动后输入localhost:30080就可以访问前端项目
7. Auth
8. System配置好后就可以登录了
9. Gen
10. Job
11. File改成minio服务之后需要修改静态文件中读取文件的端口地址
12. Monitor需要修改前端静态文件中的Monitor端口地址
13. Minio挂载本地文件。修改ruoyi-file服务中@Primary注释改到MinioServer上以使用Minio服务记得修改nacos配置
14. Elasticsearch部署文件一并放入到了skywalking文件夹中
15. skywalking需要在Java服务中使用agent进行跟踪自制agent镜像然后使用initContainers方式挂载到同一个容器模板放到了agent-in-server文件
16. skywalking-ui

@ -0,0 +1,54 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
name: minio
name: minio
namespace: minio
spec:
replicas: 1
selector:
matchLabels:
app: minio
template:
metadata:
labels:
app: minio
spec:
containers:
- name: minio
image: minio/minio
imagePullPolicy: Always
ports:
- containerPort: 9000
name: tcp
- containerPort: 9090
protocol: TCP
name: console
command:
- /bin/sh
- -c
- minio server /data --console-address ":9090"
env:
- name: MINIO_ACCESS_KEY
value: minioadmin
- name: MINIO_SECRET_KEY
value: minioadmin
readinessProbe:
failureThreshold: 3
httpGet:
path: /minio/health/ready
port: 9000
scheme: HTTP
initialDelaySeconds: 10
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 5
volumeMounts:
- mountPath: /data
name: minio-data
volumes:
- name: minio-data
hostPath:
path: /run/desktop/mnt/host/c/k8sVolume/minio/data
type: Directory

@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: minio

@ -0,0 +1,20 @@
apiVersion: v1
kind: Service
metadata:
name: minio
namespace: minio
labels:
app: minio
spec:
type: NodePort
publishNotReadyAddresses: true
ports:
- port: 9000
name: tcp
targetPort: 9000
- port: 9090
name: console
targetPort: 9090
nodePort: 30090
selector:
app: minio

@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: monitor-sa

@ -0,0 +1,63 @@
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: node-exporter
namespace: monitor-sa
labels:
name: node-exporter
spec:
selector:
matchLabels:
name: node-exporter
template:
metadata:
labels:
name: node-exporter
spec:
hostPID: true
hostIPC: true
hostNetwork: true # 共享宿主机网络和进程
containers:
- name: node-exporter
image: prom/node-exporter:v0.16.0
imagePullPolicy: IfNotPresent
ports:
- containerPort: 9100 # 容器暴露端口为9100
resources:
requests:
cpu: 0.15
securityContext:
privileged: true # 开启特权模式
args:
- --path.procfs
- /host/proc
- --path.sysfs
- /host/sys
- --collector.filesystem.ignored-mount-points
- '"^/(sys|proc|dev|host|etc)($|/)"'
volumeMounts: # 挂载宿主机目录以收集宿主机信息
- name: dev
mountPath: /host/dev
- name: proc
mountPath: /host/proc
- name: sys
mountPath: /host/sys
- name: rootfs
mountPath: /rootfs
tolerations: # 定义容忍度使其可调度到默认有污点的master
- key: "node-role.kubernetes.io/master"
operator: "Exists"
effect: "NoSchedule"
volumes: # 定义存储卷
- name: proc
hostPath:
path: /proc
- name: dev
hostPath:
path: /dev
- name: sys
hostPath:
path: /sys
- name: rootfs
hostPath:
path: /

@ -0,0 +1,169 @@
apiVersion: v1
kind: ConfigMap #
metadata:
name: prometheus-config
namespace: kube-system
labels:
kubernetes.io/cluster-service: "true"
addonmanager.kubernetes.io/mode: EnsureExists
data:
prometheus.yml: |
rule_files:
- /etc/config/rules/*.rules
scrape_configs:
- job_name: prometheus
static_configs:
- targets:
- localhost:9090
- job_name: kubernetes-nodes
scrape_interval: 30s
static_configs:
- targets:
- 192.168.73.135:9100
- 192.168.73.138:9100
- 192.168.73.139:9100
- 192.168.73.140:9100
- job_name: kubernetes-apiservers
kubernetes_sd_configs:
- role: endpoints
relabel_configs:
- action: keep
regex: default;kubernetes;https
source_labels:
- __meta_kubernetes_namespace
- __meta_kubernetes_service_name
- __meta_kubernetes_endpoint_port_name
scheme: https
tls_config:
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
insecure_skip_verify: true
bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
- job_name: kubernetes-nodes-kubelet
kubernetes_sd_configs:
- role: node
relabel_configs:
- action: labelmap
regex: __meta_kubernetes_node_label_(.+)
scheme: https
tls_config:
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
insecure_skip_verify: true
bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
- job_name: kubernetes-nodes-cadvisor
kubernetes_sd_configs:
- role: node
relabel_configs:
- action: labelmap
regex: __meta_kubernetes_node_label_(.+)
- target_label: __metrics_path__
replacement: /metrics/cadvisor
scheme: https
tls_config:
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
insecure_skip_verify: true
bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
- job_name: kubernetes-service-endpoints
kubernetes_sd_configs:
- role: endpoints
relabel_configs:
- action: keep
regex: true
source_labels:
- __meta_kubernetes_service_annotation_prometheus_io_scrape
- action: replace
regex: (https?)
source_labels:
- __meta_kubernetes_service_annotation_prometheus_io_scheme
target_label: __scheme__
- action: replace
regex: (.+)
source_labels:
- __meta_kubernetes_service_annotation_prometheus_io_path
target_label: __metrics_path__
- action: replace
regex: ([^:]+)(?::\d+)?;(\d+)
replacement: $1:$2
source_labels:
- __address__
- __meta_kubernetes_service_annotation_prometheus_io_port
target_label: __address__
- action: labelmap
regex: __meta_kubernetes_service_label_(.+)
- action: replace
source_labels:
- __meta_kubernetes_namespace
target_label: kubernetes_namespace
- action: replace
source_labels:
- __meta_kubernetes_service_name
target_label: kubernetes_name
- job_name: kubernetes-services
kubernetes_sd_configs:
- role: service
metrics_path: /probe
params:
module:
- http_2xx
relabel_configs:
- action: keep
regex: true
source_labels:
- __meta_kubernetes_service_annotation_prometheus_io_probe
- source_labels:
- __address__
target_label: __param_target
- replacement: blackbox
target_label: __address__
- source_labels:
- __param_target
target_label: instance
- action: labelmap
regex: __meta_kubernetes_service_label_(.+)
- source_labels:
- __meta_kubernetes_namespace
target_label: kubernetes_namespace
- source_labels:
- __meta_kubernetes_service_name
target_label: kubernetes_name
- job_name: kubernetes-pods
kubernetes_sd_configs:
- role: pod
relabel_configs:
- action: keep
regex: true
source_labels:
- __meta_kubernetes_pod_annotation_prometheus_io_scrape
- action: replace
regex: (.+)
source_labels:
- __meta_kubernetes_pod_annotation_prometheus_io_path
target_label: __metrics_path__
- action: replace
regex: ([^:]+)(?::\d+)?;(\d+)
replacement: $1:$2
source_labels:
- __address__
- __meta_kubernetes_pod_annotation_prometheus_io_port
target_label: __address__
- action: labelmap
regex: __meta_kubernetes_pod_label_(.+)
- action: replace
source_labels:
- __meta_kubernetes_namespace
target_label: kubernetes_namespace
- action: replace
source_labels:
- __meta_kubernetes_pod_name
target_label: kubernetes_pod_name
alerting:
alertmanagers:
- static_configs:
- targets: ["alertmanager:80"]

@ -0,0 +1 @@
存放sql目录下的所有脚本用于docker自动执行。

@ -0,0 +1,5 @@
# 基础镜像
FROM mysql:5.7
# 执行sql脚本
ADD ./db/*.sql /docker-entrypoint-initdb.d/

@ -0,0 +1,47 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: ruoyi-mysql #指定deployment的名字
namespace: kube-ruoyi
labels:
app: ruoyi-mysql-local
spec: #规约
replicas: 1 #pod的副本数量就是希望创建多少个pod的副本.可p选字段。它的默认值是1。
selector: #selector 字段定义 Deployment 如何查找要管理的 Pods。必须匹配 .spec.template.metadata.labels否则请求会被 API 拒绝。
matchLabels:
app: ruoyi-mysql-local
template: #Deployment Pod 模板;它和 Pod 的语法规则完全相同。 只是这里它是嵌套的,因此不需要 apiVersion 或 kind。
metadata:
labels:
app: ruoyi-mysql-local
spec: #pod模板规约
containers: #容器
- name: ruoyi-mysql #容器的名称
image: ruoyi/mysql:5.7 #容器使用的镜像
ports:
- containerPort: 3306
volumeMounts:
- name: mysql-local-data #pv的name
mountPath: /var/lib/mysql #MySQL容器的数据都是存在这个目录的要对这个目录做数据持久化
env:
- name: MYSQL_ROOT_PASSWORD
valueFrom: # Read environment variables from kubernetes secrets
secretKeyRef:
name: ruoyi-mysql-secret
key: mysql-root-pass
- name: MYSQL_USER
valueFrom:
secretKeyRef:
name: ruoyi-mysql-secret
key: mysql-user
- name: MYSQL_PASSWORD
valueFrom:
secretKeyRef:
name: ruoyi-mysql-secret
key: mysql-password
volumes:
- name: mysql-local-data #pv的name
hostPath:
path: /run/desktop/mnt/host/c/k8sVolume/mysql/data
type: Directory
restartPolicy: Always #Deployment 中的 Pod 模板必须指定适当的标签和适当的重新启动策略。只有 .spec.template.spec.restartPolicy 等于 Always 才是被允许的,这也是在没有指定时的默认设置

@ -0,0 +1,29 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: mysql-pv
namespace: kube-ruoyi
spec:
capacity:
storage: 3Gi
accessModes:
- ReadWriteMany
persistentVolumeReclaimPolicy: Retain # 手动删除
storageClassName: hostpath #表明这个pv所属的storageClass
hostPath:
path: /mnt/data #节点上卷的完整路径。必须是存在的路径不然容器无法创建deployment会报错可以是目录或块设备(磁盘、分区…)。
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: mysql-pvc-local
namespace: kube-ruoyi
spec:
accessModes: #访问模式 申领在请求具有特定访问模式的存储时,使用与卷相同的访问模式约定。
- ReadWriteMany
volumeMode: Filesystem #卷模式
resources:
requests:
storage: 1Gi
storageClassName: hostpath # 此处须显式设置空字符串或指定值,否则会被设置为默认的 StorageClass

@ -0,0 +1,10 @@
apiVersion: v1
kind: Secret
metadata:
name: ruoyi-mysql-secret
namespace: kube-ruoyi
type: Opaque #base-64加密
data:
mysql-root-pass: cGFzc3dvcmQ=
mysql-user: YWRtaW4=
mysql-password: MTIzNDU2

@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: ruoyi-mysql
namespace: kube-ruoyi
spec:
ports:
- port: 3306
nodePort: 30060
selector:
app: ruoyi-mysql-local # 该 Service 会将所有具有标签 app: mysql-labels-app暴露到一个抽象的 Service 端口上targetPort容器接收流量的端口port可任意取值的抽象的 Service 端口,其他 Pod 通过该端口访问 Service
type: NodePort

@ -0,0 +1,31 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: ruoyi-nacos-config
namespace: kube-ruoyi
data:
application.properties: |
spring.datasource.platform=mysql
db.num=1
db.url.0=jdbc:mysql://ruoyi-mysql:3306/ry-config?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC
db.user=root
db.password=password
nacos.naming.empty-service.auto-clean=true
nacos.naming.empty-service.clean.initial-delay-ms=50000
nacos.naming.empty-service.clean.period-time-ms=30000
management.endpoints.web.exposure.include=*
management.metrics.export.elastic.enabled=false
management.metrics.export.influx.enabled=false
server.tomcat.accesslog.enabled=true
server.tomcat.accesslog.pattern=%h %l %u %t "%r" %s %b %D %{User-Agent}i %{Request-Source}i
server.tomcat.basedir=/home/ruoyi/nacos/tomcat/logs
nacos.security.ignore.urls=/,/error,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.ico,/console-ui/public/**,/v1/auth/**,/v1/console/health/**,/actuator/**,/v1/console/server/**
nacos.core.auth.system.type=nacos
nacos.core.auth.enabled=false
nacos.core.auth.plugin.nacos.token.expire.seconds=18000
nacos.core.auth.plugin.nacos.token.secret.key=SecretKey012345678901234567890123456789012345678901234567890123456789
nacos.core.auth.caching.enabled=true
nacos.core.auth.enable.userAgentAuthWhite=false
nacos.core.auth.server.identity.key=serverIdentity
nacos.core.auth.server.identity.value=security
nacos.istio.mcp.server.enabled=false

@ -0,0 +1,37 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: ruoyi-nacos
namespace: kube-ruoyi
spec:
replicas: 1
selector:
matchLabels:
app: ruoyi-nacos
template:
metadata:
labels:
app: ruoyi-nacos
spec:
containers:
- name: ruoyi-nacos
image: nacos/nacos-server
imagePullPolicy: Always
ports:
- containerPort: 8848
name: client
- containerPort: 9848
name: client-rpc
- containerPort: 9849
name: raft-rpc
env:
- name: MODE
value: standalone
volumeMounts:
- mountPath: /home/nacos/conf/application.properties
name: nacos-conf
subPath: application.properties
volumes:
- name: nacos-conf
configMap:
name: ruoyi-nacos-config

@ -0,0 +1,23 @@
apiVersion: v1
kind: Service
metadata:
name: ruoyi-nacos
namespace: kube-ruoyi
labels:
app: ruoyi-nacos
spec:
type: NodePort
publishNotReadyAddresses: true
ports:
- port: 8848
name: server
targetPort: 8848
nodePort: 30848
- port: 9848
name: client-rpc
targetPort: 9848
- port: 9849
name: raft-rpc
targetPort: 9849
selector:
app: ruoyi-nacos

@ -0,0 +1,37 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: ruoyi-nginx-config
namespace: kube-ruoyi
data:
nginx.conf: |
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name localhost;
location / {
root /home/ruoyi/projects/ruoyi-ui;
try_files $uri $uri/ /index.html;
index index.html index.htm;
}
location /prod-api/{
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://ruoyi-gateway:8080/;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}

@ -0,0 +1,53 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: ruoyi-nginx
namespace: kube-ruoyi
spec:
replicas: 1
selector:
matchLabels:
app: ruoyi-nginx
template:
metadata:
labels:
app: ruoyi-nginx
spec:
containers:
- name: ruoyi-nginx
image: nginx
imagePullPolicy: Always
ports:
- containerPort: 80
volumeMounts:
- mountPath: /etc/nginx/nginx.conf
name: nginx-conf
subPath: nginx.conf
- mountPath: /home/ruoyi/projects/ruoyi-ui
name: local-path #/usr/share/nginx/html 挂载到volumes中server+path
volumes:
- name: nginx-conf
configMap:
name: ruoyi-nginx-config
- name: local-path
hostPath:
path: /run/desktop/mnt/host/c/k8sVolume/dist
type: Directory
---
apiVersion: v1
kind: Service
metadata:
name: ruoyi-nginx
namespace: kube-ruoyi
labels:
name: ruoyi-nginx
spec:
type: NodePort
ports:
- port: 80
targetPort: 80
nodePort: 30080
selector:
app: ruoyi-nginx

@ -0,0 +1,58 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: redis-config
namespace: redis
data:
redis.conf: |-
maxmemory 1000mb
maxmemory-policy allkeys-lru
protected-mode no
tcp-backlog 511
daemonize no
supervised no
dir /data
pidfile /data/redis_6379.pid
port 6379
loglevel notice
logfile ""
databases 16
stop-writes-on-bgsave-error yes
rdbcompression yes
rdbchecksum yes
dbfilename dump.rdb
replica-serve-stale-data yes
replica-read-only no
repl-diskless-sync no
repl-diskless-sync-delay 5
repl-disable-tcp-nodelay no
replica-priority 100
lazyfree-lazy-eviction no
lazyfree-lazy-expire no
lazyfree-lazy-server-del no
replica-lazy-flush no
appendonly no
appendfilename "appendonly.aof"
appendfsync everysec
no-appendfsync-on-rewrite no
auto-aof-rewrite-percentage 100
auto-aof-rewrite-min-size 64mb
aof-load-truncated yes
aof-use-rdb-preamble yes
lua-time-limit 5000
slowlog-log-slower-than 10000
slowlog-max-len 128
latency-monitor-threshold 0
notify-keyspace-events ""
set-max-intset-entries 512
hll-sparse-max-bytes 3000
stream-node-max-bytes 4096
stream-node-max-entries 100
activerehashing yes
client-output-buffer-limit normal 0 0 0
client-output-buffer-limit replica 256mb 64mb 60
client-output-buffer-limit pubsub 32mb 8mb 60
hz 10
dynamic-hz yes
aof-rewrite-incremental-fsync yes
rdb-save-incremental-fsync yes

@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: redis

@ -0,0 +1,98 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: redis
labels:
app: redis
namespace: redis
spec:
serviceName: redis
replicas: 1
selector:
matchLabels:
app: redis
template:
metadata:
labels:
app: redis
spec:
initContainers:
- name: config
image: redis:7.0.6
command: [ "sh", "-c" ]
args:
- |
cp /tmp/redis/redis.conf /etc/redis/redis.conf
echo "finding master..."
MASTER_FDQN=`hostname -f | sed -e 's/redis-[0-9]\./redis-0./'`
if [ "$(redis-cli -h sentinel -p 5000 ping)" != "PONG" ]; then
echo "master not found, defaulting to redis-0"
if [ "$(hostname)" = "redis-0" ]; then
echo "this is redis-0, not updating config..."
else
echo "updating redis.conf..."
echo "\nslaveof $MASTER_FDQN 6379" >> /etc/redis/redis.conf
fi
else
echo "sentinel found, finding master"
MASTER="$(redis-cli -h sentinel -p 5000 sentinel get-master-addr-by-name mymaster | grep -E '(^redis-\d{1,})|([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})')"
echo "master found : $MASTER, updating redis.conf"
echo "slaveof $MASTER 6379" >> /etc/redis/redis.conf
fi
volumeMounts:
- name: redis-config
mountPath: /etc/redis/
- name: config
mountPath: /tmp/redis/
containers:
- name: redis
image: redis:7.0.6
command: [ "redis-server" ]
args: [ "/etc/redis/redis.conf" ]
ports:
- containerPort: 6379
name: redis
volumeMounts:
- name: data
mountPath: /data
- name: redis-config
mountPath: /etc/redis/
resources:
limits:
memory: 1100Mi
requests:
memory: 1100Mi
volumes:
- name: redis-config
emptyDir: { }
- name: config
configMap:
name: redis-config
volumeClaimTemplates:
- metadata:
name: data
spec:
storageClassName: hostpath
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 500Mi
---
apiVersion: v1 # API version
kind: Service # Type of the kubernetes resource
metadata:
name: redis # Name of the kubernetes resource
labels: # Labels that will be applied to this resource
app: redis
namespace: redis
spec:
selector:
app: redis # The service exposes Pods with label `app=redis`
ports:
- name: redis-port
port: 6379
nodePort: 30079
type: NodePort

@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: kube-ruoyi

@ -0,0 +1,41 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: ruoyi-sentinel
namespace: kube-ruoyi
spec:
replicas: 1
selector:
matchLabels:
app: ruoyi-sentinel
template:
metadata:
labels:
app: ruoyi-sentinel
spec:
containers:
- name: ruoyi-sentinel
image: bladex/sentinel-dashboard
imagePullPolicy: Always
ports:
- containerPort: 8858
env: # Environment variables supplied to the Pod
- name: JAVA_TOOL_OPTIONS
value: "-Dserver.port=8858 -Dcsp.sentinel.dashboard.server=localhost:8858 -Dproject.name=sentinel-dashboard"
---
apiVersion: v1
kind: Service
metadata:
name: ruoyi-sentinel
namespace: kube-ruoyi
labels:
name: ruoyi-sentinel
spec:
type: NodePort
ports:
- port: 8858
targetPort: 8858
nodePort: 30858
selector:
app: ruoyi-sentinel

@ -0,0 +1,50 @@
apiVersion: apps/v1 # API version
kind: Deployment # Type of kubernetes resource
metadata:
name: ruoyi-auth # Name of the kubernetes resource
namespace: kube-ruoyi
labels: # Labels that will be applied to this resource
app: ruoyi-auth
spec:
replicas: 1 # No. of replicas/pods to run in this deployment
selector:
matchLabels: # The deployment applies to any pods matching the specified labels
app: ruoyi-auth
template: # Template for creating the pods in this deployment
metadata:
labels: # Labels that will be applied to each Pod in this deployment
app: ruoyi-auth
spec: # Spec for the containers that will be run in the Pods
containers:
- name: ruoyi-auth-server
image: ruoyi-auth:3.6.2
ports:
- name: http
containerPort: 9200 # The port that the container exposes
env: # Environment variables supplied to the Pod
- name: SPRING_PROFILES_ACTIVE
value: k8s
- name: SERVER_NAME
value: ruoyi-auth
- name: NACOS_SERVER
value: ruoyi-nacos # nacos svc name
- name: NACOS_PORT
value: "8848"
- name: NACOS_SHARED_CONFIGS
value: application-dev.yml
---
apiVersion: v1 # API version
kind: Service # Type of the kubernetes resource
metadata:
name: ruoyi-auth # Name of the kubernetes resource
labels: # Labels that will be applied to this resource
app: ruoyi-auth
namespace: kube-ruoyi
spec:
type: NodePort # The service will be exposed by opening a Port on each node and proxying it.
selector:
app: ruoyi-auth # The service exposes Pods with label `app=ruoyi-auth`
ports: # Forward incoming connections on port 9200 to the target port 9200
- name: http
port: 9200
targetPort: 9200

@ -0,0 +1,50 @@
apiVersion: apps/v1 # API version
kind: Deployment # Type of kubernetes resource
metadata:
name: ruoyi-gateway # Name of the kubernetes resource
namespace: kube-ruoyi
labels: # Labels that will be applied to this resource
app: ruoyi-gateway
spec:
replicas: 1 # No. of replicas/pods to run in this deployment
selector:
matchLabels: # The deployment applies to any pods matching the specified labels
app: ruoyi-gateway
template: # Template for creating the pods in this deployment
metadata:
labels: # Labels that will be applied to each Pod in this deployment
app: ruoyi-gateway
spec: # Spec for the containers that will be run in the Pods
containers:
- name: ruoyi-gateway-server
image: ruoyi-gateway:3.6.2
ports:
- name: http
containerPort: 8080 # The port that the container exposes
env: # Environment variables supplied to the Pod
- name: SPRING_PROFILES_ACTIVE
value: k8s
- name: SERVER_NAME
value: ruoyi-gateway
- name: NACOS_SERVER
value: ruoyi-nacos # nacos svc name
- name: NACOS_PORT
value: "8848"
- name: NACOS_SHARED_CONFIGS
value: application-dev.yml
---
apiVersion: v1 # API version
kind: Service # Type of the kubernetes resource
metadata:
name: ruoyi-gateway # Name of the kubernetes resource
labels: # Labels that will be applied to this resource
app: ruoyi-gateway
namespace: kube-ruoyi
spec:
type: NodePort # The service will be exposed by opening a Port on each node and proxying it.
selector:
app: ruoyi-gateway # The service exposes Pods with label `app=ruoyi-gateway`
ports: # Forward incoming connections on port 8080 to the target port 8080
- name: http
port: 8080
targetPort: 8080

@ -0,0 +1,50 @@
apiVersion: apps/v1 # API version
kind: Deployment # Type of kubernetes resource
metadata:
name: ruoyi-file # Name of the kubernetes resource
namespace: kube-ruoyi
labels: # Labels that will be applied to this resource
app: ruoyi-file
spec:
replicas: 1 # No. of replicas/pods to run in this deployment
selector:
matchLabels: # The deployment applies to any pods matching the specified labels
app: ruoyi-file
template: # Template for creating the pods in this deployment
metadata:
labels: # Labels that will be applied to each Pod in this deployment
app: ruoyi-file
spec: # Spec for the containers that will be run in the Pods
containers:
- name: ruoyi-file-server
image: ruoyi-modules-file:3.6.2
ports:
- name: http
containerPort: 9300 # The port that the container exposes
env: # Environment variables supplied to the Pod
- name: SPRING_PROFILES_ACTIVE
value: k8s
- name: SERVER_NAME
value: ruoyi-file
- name: NACOS_SERVER
value: ruoyi-nacos # nacos svc name
- name: NACOS_PORT
value: "8848"
- name: NACOS_SHARED_CONFIGS
value: application-dev.yml
---
apiVersion: v1 # API version
kind: Service # Type of the kubernetes resource
metadata:
name: ruoyi-file # Name of the kubernetes resource
labels: # Labels that will be applied to this resource
app: ruoyi-file
namespace: kube-ruoyi
spec:
type: NodePort # The service will be exposed by opening a Port on each node and proxying it.
selector:
app: ruoyi-file # The service exposes Pods with label `app=ruoyi-file`
ports: # Forward incoming connections on port 9300 to the target port 9300
- name: http
port: 9300
targetPort: 9300

@ -0,0 +1,50 @@
apiVersion: apps/v1 # API version
kind: Deployment # Type of kubernetes resource
metadata:
name: ruoyi-gen # Name of the kubernetes resource
namespace: kube-ruoyi
labels: # Labels that will be applied to this resource
app: ruoyi-gen
spec:
replicas: 1 # No. of replicas/pods to run in this deployment
selector:
matchLabels: # The deployment applies to any pods matching the specified labels
app: ruoyi-gen
template: # Template for creating the pods in this deployment
metadata:
labels: # Labels that will be applied to each Pod in this deployment
app: ruoyi-gen
spec: # Spec for the containers that will be run in the Pods
containers:
- name: ruoyi-gen-server
image: ruoyi-modules-gen:3.6.2
ports:
- name: http
containerPort: 9202 # The port that the container exposes
env: # Environment variables supplied to the Pod
- name: SPRING_PROFILES_ACTIVE
value: k8s
- name: SERVER_NAME
value: ruoyi-gen
- name: NACOS_SERVER
value: ruoyi-nacos # nacos svc name
- name: NACOS_PORT
value: "8848"
- name: NACOS_SHARED_CONFIGS
value: application-dev.yml
---
apiVersion: v1 # API version
kind: Service # Type of the kubernetes resource
metadata:
name: ruoyi-gen # Name of the kubernetes resource
labels: # Labels that will be applied to this resource
app: ruoyi-gen
namespace: kube-ruoyi
spec:
type: NodePort # The service will be exposed by opening a Port on each node and proxying it.
selector:
app: ruoyi-gen # The service exposes Pods with label `app=ruoyi-gen`
ports: # Forward incoming connections on port 9202 to the target port 9202
- name: http
port: 9202
targetPort: 9202

@ -0,0 +1,50 @@
apiVersion: apps/v1 # API version
kind: Deployment # Type of kubernetes resource
metadata:
name: ruoyi-job # Name of the kubernetes resource
namespace: kube-ruoyi
labels: # Labels that will be applied to this resource
app: ruoyi-job
spec:
replicas: 1 # No. of replicas/pods to run in this deployment
selector:
matchLabels: # The deployment applies to any pods matching the specified labels
app: ruoyi-job
template: # Template for creating the pods in this deployment
metadata:
labels: # Labels that will be applied to each Pod in this deployment
app: ruoyi-job
spec: # Spec for the containers that will be run in the Pods
containers:
- name: ruoyi-job-server
image: ruoyi-modules-job:3.6.2
ports:
- name: http
containerPort: 9203 # The port that the container exposes
env: # Environment variables supplied to the Pod
- name: SPRING_PROFILES_ACTIVE
value: k8s
- name: SERVER_NAME
value: ruoyi-job
- name: NACOS_SERVER
value: ruoyi-nacos # nacos svc name
- name: NACOS_PORT
value: "8848"
- name: NACOS_SHARED_CONFIGS
value: application-dev.yml
---
apiVersion: v1 # API version
kind: Service # Type of the kubernetes resource
metadata:
name: ruoyi-job # Name of the kubernetes resource
labels: # Labels that will be applied to this resource
app: ruoyi-job
namespace: kube-ruoyi
spec:
type: NodePort # The service will be exposed by opening a Port on each node and proxying it.
selector:
app: ruoyi-job # The service exposes Pods with label `app=ruoyi-job`
ports: # Forward incoming connections on port 9203 to the target port 9203
- name: http
port: 9203
targetPort: 9203

@ -0,0 +1,50 @@
apiVersion: apps/v1 # API version
kind: Deployment # Type of kubernetes resource
metadata:
name: ruoyi-system # Name of the kubernetes resource
namespace: kube-ruoyi
labels: # Labels that will be applied to this resource
app: ruoyi-system
spec:
replicas: 1 # No. of replicas/pods to run in this deployment
selector:
matchLabels: # The deployment applies to any pods matching the specified labels
app: ruoyi-system
template: # Template for creating the pods in this deployment
metadata:
labels: # Labels that will be applied to each Pod in this deployment
app: ruoyi-system
spec: # Spec for the containers that will be run in the Pods
containers:
- name: ruoyi-system-server
image: ruoyi-modules-system:3.6.2
ports:
- name: http
containerPort: 9201 # The port that the container exposes
env: # Environment variables supplied to the Pod
- name: SPRING_PROFILES_ACTIVE
value: k8s
- name: SERVER_NAME
value: ruoyi-system
- name: NACOS_SERVER
value: ruoyi-nacos # nacos svc name
- name: NACOS_PORT
value: "8848"
- name: NACOS_SHARED_CONFIGS
value: application-dev.yml
---
apiVersion: v1 # API version
kind: Service # Type of the kubernetes resource
metadata:
name: ruoyi-system # Name of the kubernetes resource
labels: # Labels that will be applied to this resource
app: ruoyi-system
namespace: kube-ruoyi
spec:
type: NodePort # The service will be exposed by opening a Port on each node and proxying it.
selector:
app: ruoyi-system # The service exposes Pods with label `app=ruoyi-system`
ports: # Forward incoming connections on port 9201 to the target port 9201
- name: http
port: 9201
targetPort: 9201

@ -0,0 +1,50 @@
apiVersion: apps/v1 # API version
kind: Deployment # Type of kubernetes resource
metadata:
name: ruoyi-monitor # Name of the kubernetes resource
namespace: kube-ruoyi
labels: # Labels that will be applied to this resource
app: ruoyi-monitor
spec:
replicas: 1 # No. of replicas/pods to run in this deployment
selector:
matchLabels: # The deployment applies to any pods matching the specified labels
app: ruoyi-monitor
template: # Template for creating the pods in this deployment
metadata:
labels: # Labels that will be applied to each Pod in this deployment
app: ruoyi-monitor
spec: # Spec for the containers that will be run in the Pods
containers:
- name: ruoyi-monitor-server
image: ruoyi-visual-monitor:3.6.2
ports:
- name: http
containerPort: 9100 # The port that the container exposes
env: # Environment variables supplied to the Pod
- name: SPRING_PROFILES_ACTIVE
value: k8s
- name: SERVER_NAME
value: ruoyi-monitor
- name: NACOS_SERVER
value: ruoyi-nacos # nacos svc name
- name: NACOS_PORT
value: "8848"
- name: NACOS_SHARED_CONFIGS
value: application-dev.yml
---
apiVersion: v1 # API version
kind: Service # Type of the kubernetes resource
metadata:
name: ruoyi-monitor # Name of the kubernetes resource
labels: # Labels that will be applied to this resource
app: ruoyi-monitor
namespace: kube-ruoyi
spec:
type: NodePort # The service will be exposed by opening a Port on each node and proxying it.
selector:
app: ruoyi-monitor # The service exposes Pods with label `app=ruoyi-monitor`
ports: # Forward incoming connections on port 9100 to the target port 9100
- name: http
port: 9100
targetPort: 9100

@ -0,0 +1,37 @@
# Tomcat
server:
port: 8080
# Spring
spring:
application:
# 应用名称
name: ${SERVER_NAME}
cloud:
nacos:
discovery:
# 服务注册地址
server-addr: ${NACOS_SERVER}:${NACOS_PORT}
config:
# 配置中心地址
server-addr: ${NACOS_SERVER}:${NACOS_PORT}
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- ${NACOS_SHARED_CONFIGS}
sentinel:
# 取消控制台懒加载
eager: true
transport:
# 控制台地址
dashboard: 127.0.0.1:8718
# nacos配置持久化
datasource:
ds1:
nacos:
server-addr: ${NACOS_SERVER}:${NACOS_PORT}
dataId: sentinel-ruoyi-gateway
groupId: DEFAULT_GROUP
data-type: json
rule-type: gw-flow

@ -0,0 +1,15 @@
# 基础镜像
FROM openjdk:8-jre
# author
MAINTAINER ruoyi
# 挂载目录
VOLUME /home/ruoyi
# 创建目录
RUN mkdir -p /home/ruoyi
# 指定路径
WORKDIR /home/ruoyi
# 复制jar文件到路径
COPY ./jar/ruoyi-gateway.jar /home/ruoyi/ruoyi-gateway.jar
# 启动网关服务
ENTRYPOINT ["java","-jar","ruoyi-gateway.jar"]

@ -0,0 +1 @@
存放网关模块打包好的jar文件用于docker启动应用。

@ -0,0 +1,73 @@
apiVersion: apps/v1 # API version
kind: Deployment # Type of kubernetes resource
metadata:
name: ruoyi-system # Name of the kubernetes resource
namespace: kube-ruoyi
labels: # Labels that will be applied to this resource
app: ruoyi-system
spec:
replicas: 1 # No. of replicas/pods to run in this deployment
selector:
matchLabels: # The deployment applies to any pods matching the specified labels
app: ruoyi-system
template: # Template for creating the pods in this deployment
metadata:
labels: # Labels that will be applied to each Pod in this deployment
app: ruoyi-system
spec: # Spec for the containers that will be run in the Pods
containers:
- name: ruoyi-system-server
image: ruoyi-modules-system:3.6.2
ports:
- name: http
containerPort: 9201 # The port that the container exposes
env: # Environment variables supplied to the Pod
- name: SPRING_PROFILES_ACTIVE
value: k8s
- name: SERVER_NAME
value: ruoyi-system
- name: NACOS_SERVER
value: ruoyi-nacos # nacos svc name
- name: NACOS_PORT
value: "8848"
- name: NACOS_SHARED_CONFIGS
value: application-dev.yml
- name: JAVA_OPTS
value: -javaagent:/javaagent/skywalking-agent/skywalking-agent.jar -Dskywalking.agent.service_name=k8s::$(SERVER_NAME) -Dskywalking.collector.backend_service=skywalking:11800
volumeMounts:
- mountPath: /javaagent
name: agent-jar
volumes:
- emptyDir: { }
name: agent-jar
initContainers:
# 官网用脚本命令行+args的方式执行多条command语句
- command: ['sh']
args:
- "-c"
- |
cp -r /opt/skywalking-agent /javaagent
chown -R 65534:65534 /javaagent
/bin/chmod -R 777 /javaagent
image: skywalking-agent:8.14.0
imagePullPolicy: IfNotPresent
name: skywalking-agent
volumeMounts:
- mountPath: /javaagent
name: agent-jar
---
apiVersion: v1 # API version
kind: Service # Type of the kubernetes resource
metadata:
name: ruoyi-system # Name of the kubernetes resource
labels: # Labels that will be applied to this resource
app: ruoyi-system
namespace: kube-ruoyi
spec:
type: NodePort # The service will be exposed by opening a Port on each node and proxying it.
selector:
app: ruoyi-system # The service exposes Pods with label `app=ruoyi-system`
ports: # Forward incoming connections on port 9201 to the target port 9201
- name: http
port: 9201
targetPort: 9201

@ -0,0 +1,17 @@
## cat Dcokerfile
FROM docker.io/library/busybox:latest AS base
# 使用 ADD 下载 java-agent,你也可以使用其他下载命令,或者下载到本地,再 使用 COPY或者ADD 指令添加到 镜像里
ADD https://dlcdn.apache.org/skywalking/java-agent/9.0.0/apache-skywalking-java-agent-9.0.0.tgz /tmp/
RUN mkdir -p /opt \
&& tar -xzf /tmp/apache-skywalking-java-agent-9.0.0.tgz -C /opt/ \
&& rm -rf /tmp/*
#ADD skywalking-agent.tar.gz /opt/
RUN mkdir -p /javaagent
## java-agent 使用 方法
## https://skywalking.apache.org/docs/skywalking-java/next/en/setup/service-agent/java-agent/readme/
## java -javaagent:/opt/skywalking-agent/skywalking-agent.jar -jar yourApp.jar
## -javaagent:/opt/skywalking-agent/skywalking-agent.jar=agent.service_name=yourAppName,collector.backend_service=127.0.0.1:11800
## -javaagent:/opt/skywalking-agent/skywalking-agent.jar -Dskywalking.agent.service_name=yourAppName -Dskywalking.collector.backend_service=127.0.0.1:11800

@ -0,0 +1,44 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
name: elasticsearch
name: elasticsearch
namespace: kube-ruoyi
spec:
replicas: 1
selector:
matchLabels:
app: elasticsearch
template:
metadata:
labels:
app: elasticsearch
spec:
containers:
- name: elasticsearch
image: elasticsearch:7.14.2
ports:
- containerPort: 9200
name: cluster-node
env:
- name: discovery.type
value: single-node
- name: TZ
value: Asia/Shanghai
- name: ES_JAVA_OPTS
value: -Xms512m -Xmx512m
---
apiVersion: v1
kind: Service
metadata:
name: elasticsearch
namespace: kube-ruoyi
spec:
ports:
- port: 9220 # 和auth-server的端口冲突了对外暴露换一个端口访问
targetPort: 9200
name: cluster-node
selector:
app: elasticsearch # 该 Service 会将所有具有标签 app: mysql-labels-app暴露到一个抽象的 Service 端口上targetPort容器接收流量的端口port可任意取值的抽象的 Service 端口,其他 Pod 通过该端口访问 Service
type: NodePort

@ -0,0 +1,50 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
name: skywalking
name: skywalking
namespace: kube-ruoyi
spec:
replicas: 1
selector:
matchLabels:
app: skywalking
template:
metadata:
labels:
app: skywalking
spec:
containers:
- name: skywalking
image: apache/skywalking-oap-server
imagePullPolicy: Always
ports:
- containerPort: 11800
name: collector
- containerPort: 12800
name: oap
env:
- name: SW_STORAGE
value: elasticsearch
- name: TZ
value: Asia/Shanghai
- name: SW_STORAGE_ES_CLUSTER_NODES
value: elasticsearch:9220
---
apiVersion: v1
kind: Service
metadata:
name: skywalking
namespace: kube-ruoyi
spec:
ports:
- port: 11800
targetPort: 11800
name: collector
- port: 12800
targetPort: 12800
name: oap
selector:
app: skywalking # 该 Service 会将所有具有标签 app: mysql-labels-app暴露到一个抽象的 Service 端口上targetPort容器接收流量的端口port可任意取值的抽象的 Service 端口,其他 Pod 通过该端口访问 Service
type: NodePort

@ -0,0 +1,42 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
name: skywalking-ui
name: skywalking-ui
namespace: kube-ruoyi
spec:
replicas: 1
selector:
matchLabels:
app: skywalking-ui
template:
metadata:
labels:
app: skywalking-ui
spec:
containers:
- name: skywalking-ui
image: apache/skywalking-ui
imagePullPolicy: Always
ports:
- containerPort: 8080
name: console
env:
- name: SW_OAP_ADDRESS
value: http://skywalking:12800
- name: TZ
value: Asia/Shanghai
---
apiVersion: v1
kind: Service
metadata:
name: skywalking-ui
namespace: kube-ruoyi
spec:
ports:
- port: 8080
nodePort: 30088
selector:
app: skywalking-ui # 该 Service 会将所有具有标签 app: mysql-labels-app暴露到一个抽象的 Service 端口上targetPort容器接收流量的端口port可任意取值的抽象的 Service 端口,其他 Pod 通过该端口访问 Service
type: NodePort

@ -0,0 +1,22 @@
# Tomcat
server:
port: 9200
# Spring
spring:
application:
# 应用名称
name: ${SERVER_NAME}
cloud:
nacos:
discovery:
# 服务注册地址
server-addr: ${NACOS_SERVER}:${NACOS_PORT}
config:
# 配置中心地址
server-addr: ${NACOS_SERVER}:${NACOS_PORT}
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- ${NACOS_SHARED_CONFIGS}

@ -9,7 +9,7 @@ spring:
name: ruoyi-auth
profiles:
# 环境配置
active: dev
active: ${SPRING_PROFILES_ACTIVE:dev}
cloud:
nacos:
discovery:

@ -0,0 +1,37 @@
# Tomcat
server:
port: 8080
# Spring
spring:
application:
# 应用名称
name: ${SERVER_NAME}
cloud:
nacos:
discovery:
# 服务注册地址
server-addr: ${NACOS_SERVER}:${NACOS_PORT}
config:
# 配置中心地址
server-addr: ${NACOS_SERVER}:${NACOS_PORT}
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- ${NACOS_SHARED_CONFIGS}
sentinel:
# 取消控制台懒加载
eager: true
transport:
# 控制台地址
dashboard: 127.0.0.1:8718
# nacos配置持久化
datasource:
ds1:
nacos:
server-addr: ${NACOS_SERVER}:${NACOS_PORT}
dataId: sentinel-ruoyi-gateway
groupId: DEFAULT_GROUP
data-type: json
rule-type: gw-flow

@ -9,7 +9,7 @@ spring:
name: ruoyi-gateway
profiles:
# 环境配置
active: dev
active: ${SPRING_PROFILES_ACTIVE:dev}
cloud:
nacos:
discovery:

@ -0,0 +1,23 @@
# Tomcat
server:
port: 9300
# Spring
spring:
application:
# 应用名称
name: ${SERVER_NAME}
cloud:
nacos:
discovery:
# 服务注册地址
server-addr: ${NACOS_SERVER}:${NACOS_PORT}
config:
# 配置中心地址
server-addr: ${NACOS_SERVER}:${NACOS_PORT}
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- ${NACOS_SHARED_CONFIGS}

@ -9,7 +9,7 @@ spring:
name: ruoyi-file
profiles:
# 环境配置
active: dev
active: ${SPRING_PROFILES_ACTIVE:dev}
cloud:
nacos:
discovery:

@ -0,0 +1,23 @@
# Tomcat
server:
port: 9202
# Spring
spring:
application:
# 应用名称
name: ${SERVER_NAME}
cloud:
nacos:
discovery:
# 服务注册地址
server-addr: ${NACOS_SERVER}:${NACOS_PORT}
config:
# 配置中心地址
server-addr: ${NACOS_SERVER}:${NACOS_PORT}
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- ${NACOS_SHARED_CONFIGS}

@ -9,7 +9,7 @@ spring:
name: ruoyi-gen
profiles:
# 环境配置
active: dev
active: ${SPRING_PROFILES_ACTIVE:dev}
cloud:
nacos:
discovery:

@ -0,0 +1,22 @@
# Tomcat
server:
port: 9203
# Spring
spring:
application:
# 应用名称
name: ${SERVER_NAME}
cloud:
nacos:
discovery:
# 服务注册地址
server-addr: ${NACOS_SERVER}:${NACOS_PORT}
config:
# 配置中心地址
server-addr: ${NACOS_SERVER}:${NACOS_PORT}
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- ${NACOS_SHARED_CONFIGS}

@ -9,7 +9,7 @@ spring:
name: ruoyi-job
profiles:
# 环境配置
active: dev
active: ${SPRING_PROFILES_ACTIVE:dev}
cloud:
nacos:
discovery:

@ -0,0 +1,22 @@
# Tomcat
server:
port: 9201
# Spring
spring:
application:
# 应用名称
name: ${SERVER_NAME}
cloud:
nacos:
discovery:
# 服务注册地址
server-addr: ${NACOS_SERVER}:${NACOS_PORT}
config:
# 配置中心地址
server-addr: ${NACOS_SERVER}:${NACOS_PORT}
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- ${NACOS_SHARED_CONFIGS}

@ -9,7 +9,7 @@ spring:
name: ruoyi-system
profiles:
# 环境配置
active: dev
active: ${SPRING_PROFILES_ACTIVE:dev}
cloud:
nacos:
discovery:

@ -0,0 +1,22 @@
# Tomcat
server:
port: 9100
# Spring
spring:
application:
# 应用名称
name: ${SERVER_NAME}
cloud:
nacos:
discovery:
# 服务注册地址
server-addr: ${NACOS_SERVER}:${NACOS_PORT}
config:
# 配置中心地址
server-addr: ${NACOS_SERVER}:${NACOS_PORT}
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- ${NACOS_SHARED_CONFIGS}

@ -9,7 +9,7 @@ spring:
name: ruoyi-monitor
profiles:
# 环境配置
active: dev
active: ${SPRING_PROFILES_ACTIVE:dev}
cloud:
nacos:
discovery:

Loading…
Cancel
Save