microservices-k8s/microservices/auth.yaml

55 lines
1.2 KiB
YAML

# auth-deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: osredm-auth
namespace: microservices
annotations:
mon-name: "授权服务"
spec:
replicas: 1
selector:
matchLabels:
app: auth
template:
metadata:
labels:
app: auth
spec:
containers:
- name: auth
image: microservices-auth:latest
imagePullPolicy: IfNotPresent
env:
- name: TZ
value: Asia/Shanghai
ports:
- containerPort: 8081
resources:
limits:
memory: "1024Mi"
volumeMounts:
- name: shared-logs-volume
mountPath: /home/microservices/logs
volumes:
- name: shared-logs-volume
hostPath:
path: /data/k8s-data/microservices-ns/logs
type: DirectoryOrCreate
---
# auth-service.yaml
apiVersion: v1
kind: Service
metadata:
name: osredm-auth
namespace: microservices
spec:
selector:
app: auth
ports:
- port: 8081
targetPort: 8081
protocol: TCP
name: auth-port
type: ClusterIP