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