你先记住这段脚本:apiVersion: apps/v1 kind: Deployment metadata: name: auth-uat spec: selector: matchLabels: app: auth-uat replicas: 1 minReadySeconds: 500 strategy: type: RollingUpdate rollingUpdate: maxSurge: 1 maxUnavailable: 1 template: metadata: labels: app: auth-uat spec: nodeSelector: 586: allserver hostNetwork: true imagePullSecrets: - name: registry-aliyun terminationGracePeriodSeconds: 100 containers: - env: - name: HOST_INNERIP valueFrom: fieldRef: apiVersion: v1 fieldPath: status.hostIP name: uat-auth image: registry.cn-hangzhou.aliyuncs.com/mx_586/auth_uat:6f9c6158e6c0 lifecycle: postStart: exec: command: - sh - /opt/app/auth-server/online_nacos.sh preStop: exec: command: - sh - /opt/app/auth-server/offline_nacos.sh volumeMounts: - mountPath: /opt/logs/auth-server/ name: auth-dir ports: - containerPort: 9010 readinessProbe: tcpSocket: port: 9010 initialDelaySeconds: 60 volumes: - name: auth-dir hostPath: path: /opt/logs/auth-server/
时间: 2024-02-10 15:21:48 浏览: 89
深入浅出Docker(六):像谷歌一样部署你的应用
好的,我已经记住了这段脚本。它是一个定义Deployment的YAML文件,用于部署名为auth-uat的应用程序。其中包含了应用程序的镜像、容器端口、节点选择器、存储卷等配置信息。此外,它还定义了滚动升级的策略,控制了新Pod的最大并发数和最大不可用性。还设置了Readiness Probe,用于检查Pod是否可以接收流量,以确保服务的可用性。
阅读全文