修改yaml文件名
This commit is contained in:
20
k8s_yaml/test/Readme.md
Normal file
20
k8s_yaml/test/Readme.md
Normal file
@@ -0,0 +1,20 @@
|
||||
## Python
|
||||
- 集群内 svc 域名:`http://test-lessie-agents-svc.test-lessie.svc.cluster.local:8000`
|
||||
- 集群外部:`http://<Node_IP>:38000`
|
||||
|
||||
## Go
|
||||
- 集群内部:`http://test-lessie-sourcing-api-svc.test-lessie.svc.cluster.local:8100`
|
||||
- 集群外部:`http://<Node_IP>:30810`
|
||||
|
||||
## Java
|
||||
- **flymoon-agent**
|
||||
- 集群内部:`http://test-flymoon-agent-svc.test-lessie.svc.cluster.local:8070`
|
||||
- 集群外部:`http://<Node_IP>:30807`
|
||||
- **flymoon-admin**
|
||||
- 集群内部:`http://test-flymoon-admin-svc.test-lessie.svc.cluster.local:8080`
|
||||
- 集群外部:`http://<Node_IP>:30808`
|
||||
- **flymoon-payment**
|
||||
- 集群内部:`http://test-flymoon-payment-svc.test-lessie.svc.cluster.local:8090`
|
||||
- 集群外部:`http://<Node_IP>:30809`
|
||||
|
||||
## 主站前端
|
||||
20
k8s_yaml/test/network-test-pod.yaml
Normal file
20
k8s_yaml/test/network-test-pod.yaml
Normal file
@@ -0,0 +1,20 @@
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: network-test-pod
|
||||
namespace: test-lessie
|
||||
labels:
|
||||
app: network-test
|
||||
spec:
|
||||
containers:
|
||||
- name: network-tools
|
||||
image: nicolaka/netshoot:latest
|
||||
command: ["/bin/sh"]
|
||||
args: ["-c", "sleep 3600"] # 保持运行1小时
|
||||
resources:
|
||||
requests:
|
||||
memory: "64Mi"
|
||||
cpu: "50m"
|
||||
limits:
|
||||
memory: "128Mi"
|
||||
cpu: "100m"
|
||||
91
k8s_yaml/test/test-flymoon-admin.yaml
Normal file
91
k8s_yaml/test/test-flymoon-admin.yaml
Normal file
@@ -0,0 +1,91 @@
|
||||
# ----------------------------
|
||||
# Deployment
|
||||
# ----------------------------
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: test-flymoon-admin-deployment
|
||||
namespace: test-lessie
|
||||
labels:
|
||||
app: test-flymoon-admin
|
||||
environment: test
|
||||
project: flymoon
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: test-flymoon-admin
|
||||
environment: test
|
||||
project: flymoon
|
||||
strategy:
|
||||
type: RollingUpdate # 滚动更新策略
|
||||
rollingUpdate:
|
||||
maxSurge: 1 # 最大新增副本数
|
||||
maxUnavailable: 0 # 最大不可用副本数
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: test-flymoon-admin
|
||||
environment: test
|
||||
project: flymoon
|
||||
spec:
|
||||
imagePullSecrets:
|
||||
- name: dxin-image-repository # 镜像仓库凭证Secret
|
||||
volumes:
|
||||
- name: flymoon-admin-logs-volume
|
||||
hostPath:
|
||||
path: /data/logs/flymoon-admin/
|
||||
type: DirectoryOrCreate
|
||||
containers:
|
||||
- name: test-flymoon-admin # 容器名称
|
||||
image: uswccr.ccs.tencentyun.com/lessietest/flymoon-admin:v0.0.1 # 容器镜像
|
||||
imagePullPolicy: IfNotPresent # 镜像拉取策略 ,有则不拉
|
||||
env:
|
||||
- name: POD_NAME
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.name
|
||||
- name: SPRING_PROFILES_ACTIVE
|
||||
value: "s1"
|
||||
ports:
|
||||
- containerPort: 8080 # 容器暴露的端口
|
||||
resources:
|
||||
requests:
|
||||
cpu: "100m" # 容器请求分配0.1个CPU核心(这不是实际占用,但调度会以这里进行参考)
|
||||
memory: "1Gi" # 容器请求分配1Gi内存(这会实际预留)
|
||||
limits:
|
||||
cpu: "1" # 最多可以使用1个CPU核心
|
||||
memory: "3Gi" # 容器最多可以使用3Gi内存
|
||||
volumeMounts:
|
||||
- name: flymoon-admin-logs-volume
|
||||
mountPath: /app/logs/
|
||||
subPathExpr: flymoon-admin-log-$(POD_NAME)
|
||||
|
||||
---
|
||||
# ----------------------------
|
||||
# Service
|
||||
# 集群内部:http://test-flymoon-admin-svc.test-lessie.svc.cluster.local:8080
|
||||
# 集群外部:http://<Node-IP>:30808
|
||||
# ----------------------------
|
||||
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: test-flymoon-admin-svc
|
||||
namespace: test-lessie
|
||||
labels:
|
||||
app: test-flymoon-admin
|
||||
environment: test
|
||||
project: flymoon
|
||||
spec:
|
||||
type: NodePort
|
||||
selector: # 必须匹配 Deployment 的 labels 才能关联 Pod
|
||||
app: test-flymoon-admin
|
||||
environment: test
|
||||
project: flymoon
|
||||
ports:
|
||||
- name: http
|
||||
port: 8080 # ClusterIP 内部端口
|
||||
targetPort: 8080 # 容器端口
|
||||
nodePort: 30808 # 节点对外端口(30000-32767)
|
||||
|
||||
91
k8s_yaml/test/test-flymoon-agent.yaml
Normal file
91
k8s_yaml/test/test-flymoon-agent.yaml
Normal file
@@ -0,0 +1,91 @@
|
||||
# ----------------------------
|
||||
# Deployment
|
||||
# ----------------------------
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: test-flymoon-agent-deployment
|
||||
namespace: test-lessie
|
||||
labels:
|
||||
app: test-flymoon-agent
|
||||
environment: test
|
||||
project: flymoon
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: test-flymoon-agent
|
||||
environment: test
|
||||
project: flymoon
|
||||
strategy:
|
||||
type: RollingUpdate # 滚动更新策略
|
||||
rollingUpdate:
|
||||
maxSurge: 1 # 最大新增副本数
|
||||
maxUnavailable: 0 # 最大不可用副本数
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: test-flymoon-agent
|
||||
environment: test
|
||||
project: flymoon
|
||||
spec:
|
||||
imagePullSecrets:
|
||||
- name: dxin-image-repository # 镜像仓库凭证Secret
|
||||
volumes:
|
||||
- name: flymoon-agent-logs-volume
|
||||
hostPath:
|
||||
path: /data/logs/flymoon-agent/
|
||||
type: DirectoryOrCreate
|
||||
containers:
|
||||
- name: test-flymoon-agent # 容器名称
|
||||
image: uswccr.ccs.tencentyun.com/lessietest/flymoon-agent:v0.0.1 # 容器镜像
|
||||
imagePullPolicy: IfNotPresent # 镜像拉取策略 ,有则不拉
|
||||
env:
|
||||
- name: POD_NAME
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.name
|
||||
- name: SPRING_PROFILES_ACTIVE
|
||||
value: "s1"
|
||||
ports:
|
||||
- containerPort: 8070 # 容器暴露的端口
|
||||
resources:
|
||||
requests:
|
||||
cpu: "100m" # 容器请求分配0.1个CPU核心(这不是实际占用,但调度会以这里进行参考)
|
||||
memory: "1Gi" # 容器请求分配1Gi内存(这会实际预留)
|
||||
limits:
|
||||
cpu: "1" # 最多可以使用1个CPU核心
|
||||
memory: "3Gi" # 容器最多可以使用3Gi内存
|
||||
volumeMounts:
|
||||
- name: flymoon-agent-logs-volume
|
||||
mountPath: /app/logs/
|
||||
subPathExpr: flymoon-agent-log-$(POD_NAME)
|
||||
|
||||
---
|
||||
# ----------------------------
|
||||
# Service
|
||||
# 集群内部:http://test-flymoon-agent-svc.test-lessie.svc.cluster.local:8070
|
||||
# 集群外部:http://<Node-IP>:30807
|
||||
# ----------------------------
|
||||
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: test-flymoon-agent-svc
|
||||
namespace: test-lessie
|
||||
labels:
|
||||
app: test-flymoon-agent
|
||||
environment: test
|
||||
project: flymoon
|
||||
spec:
|
||||
type: NodePort
|
||||
selector: # 必须匹配 Deployment 的 labels 才能关联 Pod
|
||||
app: test-flymoon-agent
|
||||
environment: test
|
||||
project: flymoon
|
||||
ports:
|
||||
- name: http
|
||||
port: 8070 # ClusterIP 内部端口
|
||||
targetPort: 8070 # 容器端口
|
||||
nodePort: 30807 # 节点对外端口(30000-32767)
|
||||
|
||||
91
k8s_yaml/test/test-flymoon-payment.yaml
Normal file
91
k8s_yaml/test/test-flymoon-payment.yaml
Normal file
@@ -0,0 +1,91 @@
|
||||
# ----------------------------
|
||||
# Deployment
|
||||
# ----------------------------
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: test-flymoon-payment-deployment
|
||||
namespace: test-lessie
|
||||
labels:
|
||||
app: test-flymoon-payment
|
||||
environment: test
|
||||
project: flymoon
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: test-flymoon-payment
|
||||
environment: test
|
||||
project: flymoon
|
||||
strategy:
|
||||
type: RollingUpdate # 滚动更新策略
|
||||
rollingUpdate:
|
||||
maxSurge: 1 # 最大新增副本数
|
||||
maxUnavailable: 0 # 最大不可用副本数
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: test-flymoon-payment
|
||||
environment: test
|
||||
project: flymoon
|
||||
spec:
|
||||
imagePullSecrets:
|
||||
- name: dxin-image-repository # 镜像仓库凭证Secret
|
||||
volumes:
|
||||
- name: flymoon-payment-logs-volume
|
||||
hostPath:
|
||||
path: /data/logs/flymoon-payment/
|
||||
type: DirectoryOrCreate
|
||||
containers:
|
||||
- name: test-flymoon-payment # 容器名称
|
||||
image: uswccr.ccs.tencentyun.com/lessietest/flymoon-payment:v0.0.1 # 容器镜像
|
||||
imagePullPolicy: IfNotPresent # 镜像拉取策略 ,有则不拉
|
||||
env:
|
||||
- name: POD_NAME
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.name
|
||||
- name: SPRING_PROFILES_ACTIVE
|
||||
value: "s1"
|
||||
ports:
|
||||
- containerPort: 8090 # 容器暴露的端口
|
||||
resources:
|
||||
requests:
|
||||
cpu: "100m" # 容器请求分配0.1个CPU核心(这不是实际占用,但调度会以这里进行参考)
|
||||
memory: "1Gi" # 容器请求分配1Gi内存(这会实际预留)
|
||||
limits:
|
||||
cpu: "1" # 最多可以使用1个CPU核心
|
||||
memory: "3Gi" # 容器最多可以使用3Gi内存
|
||||
volumeMounts:
|
||||
- name: flymoon-payment-logs-volume
|
||||
mountPath: /app/logs/
|
||||
subPathExpr: flymoon-payment-log-$(POD_NAME)
|
||||
|
||||
---
|
||||
# ----------------------------
|
||||
# Service
|
||||
# 集群内部:http://test-flymoon-payment-svc.test-lessie.svc.cluster.local:8090
|
||||
# 集群外部:http://<Node-IP>:30809
|
||||
# ----------------------------
|
||||
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: test-flymoon-payment-svc
|
||||
namespace: test-lessie
|
||||
labels:
|
||||
app: test-flymoon-payment
|
||||
environment: test
|
||||
project: flymoon
|
||||
spec:
|
||||
type: NodePort
|
||||
selector: # 必须匹配 Deployment 的 labels 才能关联 Pod
|
||||
app: test-flymoon-payment
|
||||
environment: test
|
||||
project: flymoon
|
||||
ports:
|
||||
- name: http
|
||||
port: 8090 # ClusterIP 内部端口
|
||||
targetPort: 8090 # 容器端口
|
||||
nodePort: 30809 # 节点对外端口(30000-32767)
|
||||
|
||||
@@ -20,8 +20,8 @@ spec:
|
||||
strategy:
|
||||
type: RollingUpdate # 滚动更新策略
|
||||
rollingUpdate:
|
||||
maxSurge: 1 # 最大新增副本数
|
||||
maxUnavailable: 1 # 最大不可用副本数
|
||||
maxSurge: 1 # 最大新增副本数(先加)
|
||||
maxUnavailable: 0 # 最大不可用副本数(不减)
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
@@ -65,8 +65,8 @@ spec:
|
||||
- containerPort: 8000 # 容器暴露的端口
|
||||
resources:
|
||||
requests:
|
||||
cpu: "1" # 容器请求分配1个CPU核心
|
||||
memory: "2Gi" # 容器请求分配2Gi内存
|
||||
cpu: "0.5" # 容器请求分配0.5个CPU核心(这不是实际占用,但调度会以这里进行参考)
|
||||
memory: "2Gi" # 容器请求分配1Gi内存(这会实际预留)
|
||||
limits:
|
||||
cpu: "2" # 最多可以使用2个CPU核心
|
||||
memory: "8Gi" # 容器最多可以使用8Gi内存
|
||||
@@ -84,6 +84,7 @@ spec:
|
||||
# Service
|
||||
# 集群内部:http://test-lessie-agents-svc.test-lessie.svc.cluster.local:8000
|
||||
# 集群外部:http://<Node_IP>:38000
|
||||
# curl -v -X POST http://43.153.12.208:30800/api/chat/stream -H "Content-Type: application/json" -d '{"message": "hello"}'
|
||||
# ----------------------------
|
||||
|
||||
apiVersion: v1
|
||||
93
k8s_yaml/test/test-lessie-go-api.yaml
Normal file
93
k8s_yaml/test/test-lessie-go-api.yaml
Normal file
@@ -0,0 +1,93 @@
|
||||
# ----------------------------
|
||||
# Deployment
|
||||
# ----------------------------
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: test-lessie-go-api-deployment
|
||||
namespace: test-lessie
|
||||
labels:
|
||||
app: test-lessie-go-api
|
||||
environment: test
|
||||
project: lessie
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: test-lessie-go-api
|
||||
environment: test
|
||||
project: lessie
|
||||
strategy:
|
||||
type: RollingUpdate # 滚动更新策略
|
||||
rollingUpdate:
|
||||
maxSurge: 1 # 最大新增副本数
|
||||
maxUnavailable: 0 # 最大不可用副本数
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: test-lessie-go-api
|
||||
environment: test
|
||||
project: lessie
|
||||
spec:
|
||||
imagePullSecrets:
|
||||
- name: dxin-image-repository # 镜像仓库凭证Secret
|
||||
volumes:
|
||||
- name: go-logs-volume
|
||||
hostPath:
|
||||
path: /data/logs/lessie-go-api/
|
||||
type: DirectoryOrCreate
|
||||
containers:
|
||||
- name: test-lessie-go-api # 容器名称
|
||||
image: uswccr.ccs.tencentyun.com/lessietest/go_lessie-sourcing-api:latest # 容器镜像
|
||||
imagePullPolicy: IfNotPresent # 镜像拉取策略 ,有则不拉
|
||||
env:
|
||||
- name: POD_NAME
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.name
|
||||
- name: APP_ENV
|
||||
value: "s1"
|
||||
- name: APP_PORT
|
||||
value: "8100"
|
||||
ports:
|
||||
- containerPort: 8100 # 容器暴露的端口
|
||||
resources:
|
||||
requests:
|
||||
cpu: "100m" # 容器请求分配0.1个CPU核心(这不是实际占用,但调度会以这里进行参考)
|
||||
memory: "1.5Gi" # 容器请求分配1.5Gi内存(这会实际预留)
|
||||
limits:
|
||||
cpu: "1" # 最多可以使用1个CPU核心
|
||||
memory: "3Gi" # 容器最多可以使用3Gi内存
|
||||
volumeMounts:
|
||||
- name: go-logs-volume
|
||||
mountPath: /app/logs/
|
||||
subPathExpr: go-log-$(POD_NAME)
|
||||
|
||||
---
|
||||
# ----------------------------
|
||||
# Service
|
||||
# 集群内部:http://test-lessie-sourcing-api-svc.test-lessie.svc.cluster.local:8100
|
||||
# 集群外部:http://<Node-IP>:30810
|
||||
# ----------------------------
|
||||
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: test-lessie-go-api-svc
|
||||
namespace: test-lessie
|
||||
labels:
|
||||
app: test-lessie-go-api
|
||||
environment: test
|
||||
project: lessie
|
||||
spec:
|
||||
type: NodePort
|
||||
selector: # 必须匹配 Deployment 的 labels 才能关联 Pod
|
||||
app: test-lessie-go-api
|
||||
environment: test
|
||||
project: lessie
|
||||
ports:
|
||||
- name: http
|
||||
port: 8100 # ClusterIP 内部端口
|
||||
targetPort: 8100 # 容器端口
|
||||
nodePort: 30810 # 节点对外端口(30000-32767)
|
||||
|
||||
Reference in New Issue
Block a user