代码拉取完成,页面将自动刷新
同步操作将从 商城/电商商城源码-商城系统搭建 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#apiVersion: v1
#kind: PersistentVolumeClaim
#metadata:
# namespace: youlai-mall
# name: tmall-pvc0
# labels: {}
#spec:
# accessModes:
# - ReadWriteOnce
# resources:
# requests:
# storage: 1Gi # k8s限制,只能扩容,对于pvc,只能扩容,不能缩容,且配置sc.yaml时需要指定allowVolumeExpansion: true #增加该字段表示允许动态扩容
# storageClassName: nfs-storage
#
#---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: tmall
name: tmall-deployment
namespace: ${k8s_namespace} #一定要写名称空间
spec:
progressDeadlineSeconds: 600
replicas: 1
selector:
matchLabels:
app: tmall
strategy: # 更新策略
rollingUpdate:
maxSurge: 50%
maxUnavailable: 50%
type: RollingUpdate
template:
metadata:
labels:
app: tmall
spec:
volumes: # 挂载卷
- name: host-time # 挂载主机上的时区
hostPath:
path: /etc/localtime
type: ''
# - name: volume-tmall # 挂载日志
# persistentVolumeClaim:
# claimName: tmall-pvc0
imagePullSecrets:
- name: ${docker_hub_id} #提前在项目下配置访问阿里云或harbor的账号密码
containers:
- image: $remote_tag
imagePullPolicy: Always
name: tmall
ports:
- name: http-8080
containerPort: 8080
protocol: TCP
resources: # 资源限制
limits:
cpu: 250m
memory: 512Mi
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- name: host-time
readOnly: true
mountPath: /etc/localtime
# - name: volume-tmall
# mountPath: /logs
dnsPolicy: ClusterFirst
restartPolicy: Always
terminationGracePeriodSeconds: 30
affinity: # 节点亲合性,这下面表达的意思是,尽量散到不同的机器上
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchLabels:
app: tmall
topologyKey: kubernetes.io/hostname
revisionHistoryLimit: 2 #deploy 升级最大记录数由 revisionHistoryLimit 定义,默认值为 10
---
apiVersion: v1
kind: Service
metadata:
labels:
app: tmall
name: tmall-svc
namespace: ${k8s_namespace}
spec:
ports:
- name: http
port: 8080
protocol: TCP
targetPort: 8080
selector:
app: tmall
sessionAffinity: None
type: NodePort
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。