From d777164984b2b8a56b75aeabdc0c93dc1a0f550e Mon Sep 17 00:00:00 2001 From: dark Date: Tue, 24 Dec 2024 01:13:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6=E8=87=B3?= =?UTF-8?q?=20''?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- k8s.yaml | 128 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 k8s.yaml diff --git a/k8s.yaml b/k8s.yaml new file mode 100644 index 0000000..05c30fc --- /dev/null +++ b/k8s.yaml @@ -0,0 +1,128 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: minio-api + namespace: service + labels: + app: minio-api +spec: + replicas: 1 + revisionHistoryLimit: 5 + selector: + matchLabels: + app: minio-api + template: + metadata: + labels: + app: minio-api + spec: + containers: + - name: minio-api + image: harbor125.gxxhygroup.com/service/minio-api:latest + imagePullPolicy: Always + ports: + - containerPort: 8801 + readinessProbe: + tcpSocket: + port: 8801 + initialDelaySeconds: 5 + periodSeconds: 10 + livenessProbe: + tcpSocket: + port: 8801 + initialDelaySeconds: 15 + periodSeconds: 20 + resources: + requests: + cpu: 500m + memory: 512Mi + limits: + cpu: 1000m + memory: 1024Mi + volumeMounts: + - name: timezone + mountPath: /etc/localtime + volumes: + - name: timezone + hostPath: + path: /usr/share/zoneinfo/Asia/Shanghai + +--- + +apiVersion: v1 +kind: Service +metadata: + name: minio-api-svc + namespace: service +spec: + ports: + - port: 8801 + targetPort: 8801 + selector: + app: minio-api + +--- + +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: minio-api-hpa-c + namespace: service + labels: + app: minio-api-hpa-c +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: minio-api + minReplicas: 1 + maxReplicas: 10 + metrics: + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: 80 + +--- + +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: minio-api-hpa-m + namespace: service + labels: + app: minio-api-hpa-m +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: minio-api + minReplicas: 1 + maxReplicas: 10 + metrics: + - type: Resource + resource: + name: memory + target: + type: Utilization + averageUtilization: 80 +--- +kind: Ingress +apiVersion: networking.k8s.io/v1 +metadata: + name: minio-api + namespace: service +spec: + rules: + - host: minio-api-dev.gxxhygroup.com + http: + paths: + - path: / + pathType: ImplementationSpecific + backend: + service: + name: minio-api-svc + port: + number: 8801