apiVersion: apps/v1 kind: Deployment metadata: name: email-consumer namespace: juwan labels: app: email-consumer spec: replicas: 3 revisionHistoryLimit: 5 strategy: type: RollingUpdate rollingUpdate: maxSurge: 0 maxUnavailable: 1 selector: matchLabels: app: email-consumer template: metadata: labels: app: email-consumer spec: serviceAccountName: find-endpoints containers: - name: email-consumer image: 103.236.53.208:4418/library/email-consumer@sha256:6fe8a3a57310a5e79feecc4bf38ac2c5b8c58a7f200f104f7bf4707b9db5fc13 resources: requests: cpu: 100m memory: 128Mi limits: cpu: 500m memory: 512Mi volumeMounts: - name: timezone mountPath: /etc/localtime volumes: - name: timezone hostPath: path: /usr/share/zoneinfo/Asia/Shanghai --- apiVersion: v1 kind: Service metadata: name: email-consumer-svc namespace: juwan spec: ports: - port: 8080 targetPort: 8080 selector: app: email-consumer --- apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: name: email-consumer-hpa-c namespace: juwan labels: app: email-consumer-hpa-c spec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment name: email-consumer minReplicas: 1 maxReplicas: 3 metrics: - type: Resource resource: name: cpu target: type: Utilization averageUtilization: 80 --- apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: name: email-consumer-hpa-m namespace: juwan labels: app: email-consumer-hpa-m spec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment name: email-consumer minReplicas: 1 maxReplicas: 3 metrics: - type: Resource resource: name: memory target: type: Utilization averageUtilization: 80