【发布时间】:2024-01-01 00:36:01
【问题描述】:
我有这个用于 kubernetes 的 deployment.yaml
---
apiVersion: v1
kind: Service
metadata:
name: smart-flats
labels:
app: smart-flats
spec:
type: NodePort
selector:
app: smart-flats
ports:
- protocol: TCP
port: 5000
name: http
---
apiVersion: v1
kind: ReplicationController
metadata:
name: smart-flats
spec:
replicas: 1
template:
metadata:
labels:
app: smart-flats
spec:
containers:
- name: smart-flats
image: sleezy/go-hello-world:<VERSION>
env:
- name: SECRETKEY
value: "${CONFIG_SECRETKEY}"
ports:
- containerPort: 5000
livenessProbe:
httpGet:
path: /health
port: 5000
initialDelaySeconds: 30
timeoutSeconds: 1
但是当我尝试推送新版本的应用程序时,kubectl get pods 仍然显示第一个并且没有更新版本,我该怎么办?每次推送新版本时,我都需要更新 pod。谢谢!
【问题讨论】:
标签: kubernetes gitlab-ci