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

[feature request] set job template imagePullPolicy to Always from IfNotPresent #505

Closed
adamzhoul opened this issue Sep 28, 2021 · 2 comments
Labels
kind/feature kind/feature

Comments

@adamzhoul
Copy link
Member

What would you like to be added:

imagePullPolicy: Always

now is:

imagePullPolicy: IfNotPresent

Why is this needed:

the default image is:

 docker.io/openyurt/xxxx:latest

IfNotPresent leads to never be updated while it should.

Problem I meet:

crictl  images
docker.io/openyurt/yurtctl-servant               latest               e1ec131fa6cc2       15.2MB

images left before. It’s not been build with the latest code.
I can’t remember which day I run yurtctl convert and downloaded the image.
And it contains a bug but is fixed by #490

In short:

  1. duplicated code leads to bug :
2021-09-28T06:05:04.16277Z stderr F I0928 06:05:04.154963  198728 edgenode.go:263] mark openyurt-worker2 as the edge-node
2021-09-28T06:05:04.2673512Z stderr F I0928 06:05:04.266359  198728 edgenode.go:274] open the openyurt-worker2 autonomous
2021-09-28T06:05:04.3142398Z stderr F I0928 06:05:04.305542  198728 edgenode.go:281] open the openyurt-worker2 autonomous
2021-09-28T06:05:04.3908907Z stderr F F0928 06:05:04.379338  198728 edgenode.go:83] fail to convert the kubernetes node to a yurt node: Operation cannot be fulfilled on nodes "openyurt-worker2": the object has been modified; please apply your changes to the latest version and try again
  1. pod exists with error. restart for ever with error
kubectl logs -f yurtctl-servant-convert-openyurt-worker2-x4fhp -n kube-system
F0928 06:44:12.296154  203920 edgenode.go:83] fail to convert the kubernetes node to a yurt node: Cannot do the convert, the worker node: openyurt-worker2 is not a Kubernetes node.
  1. convert job failed. leaves pod restart forever.

PS:
locating the error log is very difficult since the job pod restarts many many times.
can we return true here?

// 3.3. check the label of EdgeNodes
_, ok := node.Labels[projectinfo.GetEdgeWorkerLabelKey()]
if ok {
return fmt.Errorf("Cannot do the convert, the worker node: %s is not a Kubernetes node.", node.Name)
}

others
/kind feature

@adamzhoul adamzhoul added the kind/feature kind/feature label Sep 28, 2021
@rambohe-ch
Copy link
Member

rambohe-ch commented Sep 29, 2021

@adamzhoul Thank you for raising issue.
The reason of imagePullPolicy=IfNotPresent is: pods on edge nodes can restart successfully when edge nodes can not connect public network. so we need to keep imagePullPolicy=IfNotPresent.
and iff user wants to use latest images , it's recommended to pull images manually.

@adamzhoul
Copy link
Member Author

@rambohe-ch thanks for the reply.

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

No branches or pull requests

2 participants