1 Star 0 Fork 4

Bruce_GreatWang/demo-service-eureka

forked from Mooodo/demo-service-eureka 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
demo-service-eureka-cluster.yaml 1.78 KB
一键复制 编辑 原始数据 按行查看 历史
Mooodo 提交于 2021-08-17 10:14 . add the version in the k8s yaml files.
kind: StatefulSet
apiVersion: apps/v1
metadata:
labels:
app: demo-service-eureka-cluster
name: eureka
namespace: default
spec:
replicas: 3
serviceName: eureka
podManagementPolicy: "Parallel"
selector:
matchLabels:
app: demo-service-eureka-cluster
template:
metadata:
name: eureka
labels:
app: demo-service-eureka-cluster
spec:
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: "app"
operator: In
values:
- demo-service-eureka-cluster
topologyKey: "kubernetes.io/hostname"
containers:
- name: demo-service-eureka-cluster
image: repository:5000/demo-service-eureka:<VERSION>
imagePullPolicy: Always
args: [--spring.profiles.active=cluster]
env:
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: SERVICE_HOST
value: ${POD_NAME}.eureka
- name: REGISTRY_URL
value: "http://eureka-0.eureka:9001/eureka,http://eureka-1.eureka:9001/eureka,http://eureka-2.eureka:9001/eureka"
---
kind: Service
apiVersion: v1
metadata:
labels:
app: demo-service-eureka-cluster
name: eureka
namespace: default
spec:
ports:
- name: http
port: 9001
clusterIP: None
selector:
app: demo-service-eureka-cluster
---
kind: Service
apiVersion: v1
metadata:
labels:
app: demo-service-eureka-cluster
name: demo-service-eureka-cluster
namespace: default
spec:
type: NodePort
ports:
- name: http
port: 9001
targetPort: 9001
nodePort: 32001
selector:
app: demo-service-eureka-cluster
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/bruce-greatwang/demo-service-eureka.git
git@gitee.com:bruce-greatwang/demo-service-eureka.git
bruce-greatwang
demo-service-eureka
demo-service-eureka
master

搜索帮助