apiVersion: apps/v1 kind: Deployment metadata: labels: app: community-team-merchant annotations: kubesphere.io/creator: dengbiao kubesphere.io/description: community-team-merchant name: community-team-merchant namespace: zhios spec: replicas: 1 selector: matchLabels: app: community-team-merchant template: metadata: labels: app: community-team-merchant spec: volumes: # 用于时区校正 - name: host-time hostPath: path: /etc/localtime type: '' # pvc - name: community-team-merchant-pvc # 在该部署中的名称,后面使用改名称挂载 persistentVolumeClaim: claimName: community-team-merchant-pvc # pvc的名称 # Nginx配置 - name: community-team-merchant-nginx configMap: name: community-team-merchant-nginx # 外部configMap的名称 items: - key: nginx.conf path: default.conf containers: - image: nginx imagePullPolicy: IfNotPresent name: community-team-merchant ports: - containerPort: 80 name: tcp-80 protocol: TCP resources: {} volumeMounts: - name: host-time mountPath: /etc/localtime readOnly: true - name: community-team-merchant-nginx mountPath: /etc/nginx/conf.d/default.conf readOnly: true subPath: default.conf - name: community-team-merchant-pvc mountPath: /usr/share/nginx/html dnsPolicy: ClusterFirst restartPolicy: Always