apiVersion: apps/v1
kind: Deployment
metadata:
  name: audit-log-service
  namespace: erp
  labels:
    app: audit-log-service
    version: v1
spec:
  replicas: 2
  selector:
    matchLabels:
      app: audit-log-service
  template:
    metadata:
      labels:
        app: audit-log-service
        version: v1
    spec:
      containers:
        - name: audit-log-service
          image: erp-registry.erpzbbh.cn/audit-log-service:1.0.0
          ports:
            - containerPort: 8098
          env:
            - name: SPRING_PROFILES_ACTIVE
              value: prod
            - name: NACOS_SERVER_ADDR
              value: "nacos.erp.svc.cluster.local:8848"
            - name: DB_HOST
              value: "mysql.erp.svc.cluster.local"
            - name: DB_NAME
              value: "erp_audit"
            - name: REDIS_HOST
              value: "redis.erp.svc.cluster.local"
          resources:
            requests:
              memory: "512Mi"
              cpu: "250m"
            limits:
              memory: "1Gi"
              cpu: "500m"
          livenessProbe:
            httpGet:
              path: /actuator/health
              port: 8098
            initialDelaySeconds: 60
            periodSeconds: 10
          readinessProbe:
            httpGet:
              path: /actuator/health
              port: 8098
            initialDelaySeconds: 30
            periodSeconds: 5
---
apiVersion: v1
kind: Service
metadata:
  name: audit-log-service
  namespace: erp
spec:
  type: ClusterIP
  ports:
    - port: 8098
      targetPort: 8098
  selector:
    app: audit-log-service
