apiVersion: v1 kind: Pod metadata: name: myblog namespace: test labels: component: myblog spec: containers: - name: myblog image: harbor.opsbase.cn/public/myblog:v1 imagePullPolicy: IfNotPresent env: - name: MYSQL_HOST # 指定root用户的用户名 value: "66.94.125.73" - name: MYSQL_PASSWD value: "123456" ports: - containerPort: 8002 resources: requests: memory: 100Mi cpu: 50m limits: memory: 500Mi cpu: 100m livenessProbe: httpGet: path: /blog/index/ port: 8002 scheme: HTTP initialDelaySeconds: 10 # 容器启动后第一次执行探测是需要等待多少秒 periodSeconds: 15 # 执行探测的频率 timeoutSeconds: 2 # 探测超时时间 readinessProbe: httpGet: path: /blog/index/ port: 8002 scheme: HTTP initialDelaySeconds: 10 timeoutSeconds: 2 periodSeconds: 15