启动ruoyi-gateway
1. 需要修改gateway模块的bootstrap.yaml文件中的nacos连接地址为k8s地址
2. 进入若依项目建立本地镜像
进入若依的目录:Ruoyi/docker
执行命令: docker compose build ruoyi-gateway
3. 在nacos中查看服务是否部署成功。
4. ruoyi-gateway.yaml内容:
apiVersion: apps/v1
kind: Deployment
metadata:
name: ruoyi-gateway
labels:
app: ruoyi-gateway
spec:
strategy:
type: Recreate
selector:
matchLabels:
app: ruoyi-gateway
template:
metadata:
labels:
app: ruoyi-gateway
spec:
containers:
- name: ruoyi-gateway
image: docker-ruoyi-gateway
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8080
---
kind: Service
apiVersion: v1
metadata:
name: ruoyi-gateway
spec:
type: ClusterIP
selector:
app: ruoyi-gateway
ports:
- port: 8080
标红的字体为需要根据情况进行修改的镜像名称。
使用minikube image load可以加载本地镜像