This commit is contained in:
lingxiao865
2026-02-10 08:22:09 +08:00
commit 0f38d49b66
71 changed files with 5494 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: a-service-deployment
labels:
app: a-service
spec:
replicas: 1
selector:
matchLabels:
app: a-service
template:
metadata:
labels:
app: a-service
spec:
containers:
- name: a-service
image: 192.168.1.14:5000/a-service:v10
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8091
env:
- name: SPRING_APPLICATION_NAME
value: "re-config" # ← 可选,但推荐;也可在 ConfigMap 中设置
---
apiVersion: v1
kind: Service
metadata:
name: a-service
spec:
selector:
app: a-service
ports:
- protocol: TCP
port: 8091
targetPort: 8091
type: LoadBalancer

44
k8s/auth-deployment.yaml Normal file
View File

@@ -0,0 +1,44 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: auth-deployment
labels:
app: auth
spec:
replicas: 1
selector:
matchLabels:
app: auth
template:
metadata:
labels:
app: auth
spec:
containers:
- name: auth
image: 192.168.1.14:5000/auth:v33
imagePullPolicy: IfNotPresent
ports:
- containerPort: 9000
volumeMounts:
- name: keys-secret
mountPath: keys
readOnly: true
volumes:
- name: keys-secret
secret:
secretName: app-keys
defaultMode: 0600
---
apiVersion: v1
kind: Service
metadata:
name: auth-service
spec:
selector:
app: auth
ports:
- protocol: TCP
port: 9000
targetPort: 9000
type: LoadBalancer

View File

@@ -0,0 +1,35 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: gateway-deployment
labels:
app: gateway
spec:
replicas: 1
selector:
matchLabels:
app: gateway
template:
metadata:
labels:
app: gateway
spec:
containers:
- name: gateway
image: 192.168.1.14:5000/gateway:v19
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8083
---
apiVersion: v1
kind: Service
metadata:
name: gateway-service
spec:
selector:
app: gateway
ports:
- protocol: TCP
port: 8083
targetPort: 8083
type: LoadBalancer

11
k8s/secrets.yaml Normal file
View File

@@ -0,0 +1,11 @@
apiVersion: v1
kind: Secret
metadata:
name: auth-secret
type: Opaque
data:
# 注意这些是base64编码的值
# root (用户名)
db-username: cm9vdA==
# lingxiao (密码)
db-password: bGluZ3hpYW8=