Skip to content
This repository was archived by the owner on May 25, 2023. It is now read-only.

[Question] how to check the logs when i create A kube-batch job. #664

Closed
zoux86 opened this issue Mar 26, 2019 · 3 comments
Closed

[Question] how to check the logs when i create A kube-batch job. #664

zoux86 opened this issue Mar 26, 2019 · 3 comments

Comments

@zoux86
Copy link

zoux86 commented Mar 26, 2019

I installed the kube-batch V0.4.1 in my local k8s cluster recently, And i want to run the example given by the https://github.com/kubernetes-sigs/kube-batch/blob/master/doc/usage/tutorial.md
but the pod is alaways pending.

here is the yaml

apiVersion: batch/v1
kind: Job
metadata:
  name: qj-1
spec:
  backoffLimit: 6
  completions: 6
  parallelism: 6
  template:
    metadata:
      annotations:
        scheduling.k8s.io/group-name: qj-1
    spec:
      containers:
      - image: busybox
        imagePullPolicy: IfNotPresent
        name: busybox
        resources:
          requests:
            cpu: "1"
      restartPolicy: Never
      schedulerName: kube-batch
---
apiVersion: scheduling.incubator.k8s.io/v1alpha1
kind: PodGroup
metadata:
  name: qj-1
spec:
  minMember: 6

After i created the yaml , it showed:
image
but the pod is always pending.
image

i used the "kubectl describe pod " and "kubectl logs " command , but still have no idea what wrong.

so i want to know how to see the logs when kube-batch Schedule a job. Can anyone give me some advice?

Anything else we need to know?:
The result of "kubectl describe pod" command:
image

Environment:

  • Kubernetes version (use kubectl version): 1.13.4
    1 master 3 node

  • OS (e.g. from /etc/os-release): ubuntu 16.04

  • kube-batch version: V0.4.1

@hex108
Copy link
Contributor

hex108 commented Mar 27, 2019

You could check scheduler log. It might be because node resource is not enough for 6(minMember) pods. You could set the minMemeber to 2 or set pod's spec's request cpu to 0.1, and try it again.

@asifdxtreme
Copy link
Contributor

is it possible you missed this last Note in second step

NOTE: kube-batch need to collect cluster information(such as Pod, Node, CRD, etc) for scheduling, so the service account used by the deployment must have permission to access those cluster resources, otherwise, kube-batch will fail to startup.  
For users who are not familiar with Kubernetes RBAC, please copy the example/role.yaml into $GOPATH/src/github.com/kubernetes-sigs/kube-batch/deployment/kube-batch/templates/ and reinstall batch.

I faced the same issue while trying it for the first time, after adding the role.yaml my deployment was fine.

@zoux86
Copy link
Author

zoux86 commented Mar 27, 2019

@hex108 @asifdxtreme Thanks, i added the role.yaml. And it successed.

@zoux86 zoux86 closed this as completed Mar 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants