Skip to content

Basic docker image with OpenShift cli + kubectl + tekton cli

License

Notifications You must be signed in to change notification settings

virer/ocp-k8s-tkn-basic-tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 

Repository files navigation

OpenShift cli + kubectl + tekton cli basic dockerfile

Basic dockerfile with k8s ocp and tkn tools. Used to cleanup tekton pipelines with something like that:

#!/bin/bash
export PATH=$PATH:/usr/local/bin
TOKEN=$( cat /run/secrets/kubernetes.io/serviceaccount/token )

/usr/local/bin/oc login --token=$TOKEN https://kubernetes.default.svc
/usr/local/bin/oc project $NAMESPACE

for pod in $(/usr/local/bin/tkn pipelinerun list | awk '/[2-9] days ago.*(Cancelled|Succeeded|Failed)/ { print $1 }'); do
  /usr/local/bin/tkn pipelinerun delete ${pod} --force
done
# EOF

About

Basic docker image with OpenShift cli + kubectl + tekton cli

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published