Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rollout触发下一步导致已经被下线的deployment再次重新拉起 #202

Open
542928492 opened this issue Jan 22, 2024 · 1 comment

Comments

@542928492
Copy link

542928492 commented Jan 22, 2024

看起来不符合rollout配置文件声明的预期
kubectl apply -f - <<EOF
apiVersion: rollouts.kruise.io/v1beta1
kind: Rollout
metadata:
labels:
app.kubernetes.io/instance: rollout-mtf-demo
name: rollout-mtf-demo
namespace: default
spec:
workloadRef:
apiVersion: apps/v1
kind: Deployment
name: deploy-mtf-demo
strategy:
canary:
enableExtraWorkloadForCanary: false
steps:
- replicas: 1
- replicas: 50%
- replicas: 100%
trafficRoutings:
- service: svc-mtf-demo-headless
ingress:
classType: nginx
name: ingress-mtf-demo
EOF

下面是deployment ,他们都有相同的label,只是deployemnt名字不一样而已

[root@k8s ~]# kubectl get deployments.apps |grep mtf-demo

  • kubectl get deployments.apps
    deploy-mtf-demo 4/4 0 4 153m
    deploy-mtf-demo1 0/0 0 0 3h2m
    deploy-mtf-demo2 0/0 0 0 3h28m
    deploy-mtf-demo3 0/0 0 0 3h28m
    deploy-mtf-demo4 0/0 0 0 3h28m

当我触发状态流转到下一阶段的时候,
副本为0的deployment被从新拉起,然后再销毁。但是我指定的deployment为 ;deploy-mtf-demo

`
[root@k8s ~]# kubectl get pod -w| grep mtf-de

  • kubectl get pod -w
    deploy-mtf-demo-6f8985996c-5g7gf 1/1 Running 0 113m
    deploy-mtf-demo-6f8985996c-jfmk9 1/1 Running 0 113m
    deploy-mtf-demo-6f8985996c-lq47v 0/1 Pending 0 2s
    deploy-mtf-demo-6f8985996c-lx79b 1/1 Terminating 0 2m40s
    deploy-mtf-demo-6f8985996c-pjp4d 1/1 Running 0 113m
    deploy-mtf-demo2-698c8fcb57-9wjqj 0/1 Terminating 0 2s
    deploy-mtf-demo2-698c8fcb57-fwt6g 0/1 Pending 0 1s
    deploy-mtf-demo-6f8985996c-lq47v 0/1 ContainerCreating 0 2s
    deploy-mtf-demo2-698c8fcb57-fwt6g 0/1 Terminating 0 1s
    deploy-mtf-demo2-698c8fcb57-fwt6g 0/1 Terminating 0 1s
    deploy-mtf-demo2-698c8fcb57-zln4x 0/1 Pending 0 0s
    deploy-mtf-demo2-698c8fcb57-zln4x 0/1 Pending 0 0s
    deploy-mtf-demo-6f8985996c-lq47v 0/1 Terminating 0 2s
    deploy-mtf-demo2-698c8fcb57-zln4x 0/1 Terminating 0 0s
    deploy-mtf-demo2-698c8fcb57-zln4x 0/1 Terminating 0 1s
    deploy-mtf-demo-6f8985996c-wp7rg 0/1 Pending 0 0s
    deploy-mtf-demo-6f8985996c-wp7rg 0/1 Pending 0 0s
    deploy-mtf-demo2-698c8fcb57-6nff6 0/1 Pending 0 0s
    deploy-mtf-demo2-698c8fcb57-6nff6 0/1 Pending 0 0s
    deploy-mtf-demo-6f8985996c-wp7rg 0/1 ContainerCreating 0 0s
    deploy-mtf-demo2-698c8fcb57-6nff6 0/1 ContainerCreating 0 0s
    deploy-mtf-demo2-698c8fcb57-6nff6 0/1 Terminating 0 0s
    deploy-mtf-demo2-698c8fcb57-9wjqj 1/1 Terminating 0 7s
    deploy-mtf-demo2-698c8fcb57-vnj44 0/1 Pending 0 0s
    deploy-mtf-demo2-698c8fcb57-vnj44 0/1 Pending 0 0s
    deploy-mtf-demo2-698c8fcb57-vnj44 0/1 ContainerCreating 0 0s
    deploy-mtf-demo2-698c8fcb57-vnj44 0/1 Terminating 0 0s
    deploy-mtf-demo-6f8985996c-wp7rg 0/1 Terminating 0 5s
    deploy-mtf-demo-6f8985996c-jlqbz 0/1 Pending 0 0s
    deploy-mtf-demo-6f8985996c-jlqbz 0/1 Pending 0 0s
    deploy-mtf-demo2-698c8fcb57-5wphh 0/1 Pending 0 0s
    deploy-mtf-demo-6f8985996c-jlqbz 0/1 ContainerCreating 0 0s
    deploy-mtf-demo2-698c8fcb57-5wphh 0/1 Pending 0 0s
    deploy-mtf-demo2-698c8fcb57-zln4x 1/1 Terminating 0 6s`
@542928492
Copy link
Author

542928492 commented Jan 22, 2024

deployment 内容
kubectl apply -f - <<EOF
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app.kubernetes.io/instance: deploy-mtf-demo
app: mtf-demo
name: deploy-mtf-demo
namespace: default
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
app: mtf-demo
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
template:
metadata:
annotations:
sidecar.istio.io/inject: 'false'
creationTimestamp: null
labels:
app: mtf-demo
name: hello-word
spec:
containers:
- env:
- name: xx
value: hello-word2222
image: 'matengfei999887073/matengfei999887:helloworld-abv011900'
imagePullPolicy: IfNotPresent
lifecycle:
preStop:
exec:
command:
- /bin/sh
- -c
- sleep 20
name: hello-word
ports:
- containerPort: 8080
name: http
protocol: TCP
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext:
runAsUser: 0
terminationGracePeriodSeconds: 30
EOF

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant