Extended info about pods
> kubectl get pods -o wide
Pod does not start
> kubectl describe pods
Tailing logs of a given deployment deployment
Use the app label to find the pod and then use kubectl logs
to tail the logs.
For example using the pipelinerunner:
> kubectl logs $(kubectl get pod -l app=pipelinerunner -o name) -f
List all resources in the cluster
> kubectl api-resources --verbs=list -o name | xargs -n 1 kubectl get -o name
or to see the endpoints:
> kubectl api-resources -v=6
List all pods with node they are running on
> kubectl get pod -o=custom-columns=NAME:.metadata.name,STATUS:.status.phase,NODE:.spec.nodeName --all-namespaces
CRDs
# Prow
> kubectl get prowjob
# Jenkins-X
> kubectl get pipelineactivity
> kubectl get sourcerepository
# Tekton
> kubectl get pipelinerun
> kubectl get task
Get Prow jobs using label selector
# comma seperate types if you want to filter on more than one
> kubectl get prowjob -l 'prow.k8s.io/type in (presubmit)'
- presubmit - pull request
- batch - batched pull request
- postsubmit - release
- peridoc - time based (Prow internal)
Detect all pipeline resources for a given build
Assuming a repository name of repo and the build number 11:
> for i in pipelineactivity pipeline pipelinestructure taskrun pipelinerun task pod; do
kubectl get "$i" --show-kind --no-headers --ignore-not-found -o name -l repository=demo,build=11
done
Other labels which can be used: branch, build, owner, repo, prowJobName
Manually delete JX install
Brute force:
> kubectl delete namespace jx
> kubectl delete namespace cert-manager