一:簡介
基本上之前的所有問題我都已經講解過了 , 那麼現在可以直接部署了
二 : 部署
auth 資源清單
apiVersion: v1
kind: Service
metadata:
name: cloud-auth
namespace: ms
spec:
ports:
- name: cloud-auth
port: 8020
selector:
project: ms
app: cloud-auth
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: cloud-auth
namespace: ms
spec:
replicas: 2
selector:
matchLabels:
project: ms
app: cloud-auth
template:
metadata:
labels:
project: ms
app: cloud-auth
spec:
containers:
- name: cloud-auth
image: registry.cn-hangzhou.aliyuncs.com/sdongp-dkz/cloud-auth:1.0-SNAPSHOT
ports:
- name: http
containerPort: 8020
auth 的eureka
# 註冊到eureka
eureka:
instance:
# 可以使用ip註冊
preferIpAddress: true
client:
serviceUrl:
## 註冊到 eureka (這裏需要自己配置host 和 nginx)
defaultZone: http://eureka01.ms.svc.cluster.local:8040/eureka/,http://eureka02.ms.svc.cluster.local:8040/eureka/
部署 查看
http://eureka02.ctnrs.com:32486/
到此全部部署完成