1、页面展示

效果演示

1.1、卡片展示

在这里插入图片描述

1.2、时间效果

在这里插入图片描述

1.3、反转效果

在这里插入图片描述

2、deployment.yaml

apiVersion: apps/v1
kind: Deployment
metadata:
  name: xxx-frontend
  namespace: xxx
  labels:
    app: xxx-frontend
    version: v1
spec:
  replicas: 2
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 1
      maxSurge: 1
  selector:
    matchLabels:
      app: xxx-frontend
  template:
    metadata:
      labels:
        app: xxx-frontend
        version: v1
    spec:
      imagePullSecrets:
      - name: registry-secret
      containers:
      - name: frontend
        image: xxx/frontend:${IMAGE_TAG}
        imagePullPolicy: IfNotPresent
        ports:
        - containerPort: 80
          name: http
        volumeMounts:
        - name: nginx-config
          mountPath: /etc/nginx/nginx.conf
          subPath: nginx.conf
        resources:
          requests:
            memory: "128Mi"
            cpu: "100m"
          limits:
            memory: "256Mi"
            cpu: "200m"
        readinessProbe:
          httpGet:
            path: /
            port: 80
          initialDelaySeconds: 5
          periodSeconds: 5
          timeoutSeconds: 3
          failureThreshold: 3
        livenessProbe:
          httpGet:
            path: /
            port: 80
          initialDelaySeconds: 10
          periodSeconds: 30
          timeoutSeconds: 5
          failureThreshold: 3
      volumes:
      - name: nginx-config
        configMap:
          name: nginx-config
      restartPolicy: Always

3、执行 yaml 文件

kubectl apply -f deployment.yaml

4、效果演示

效果演示

Logo

码道开发者社区,聚焦华为云码道 CodeArts 代码智能体,沉淀 Agent、Skill、鸿蒙开发实战内容,供开发者查阅资料、交流技术、分享工程实践

更多推荐