Use this drone plugin to creates and watches a K8s Job. The idea is to be able to deploy a service and then deploy a job that can test the service in k8s and clean it up.
The following parameters are used to configure this plugin:
url
- url to your cluster servertoken
- Token used to connect to the clusterca
- certificate auth to connect to clusterinsecure
- allow for insecure cluster connectionnamespace
- namespace (will use default if not set)template
- file location for the job template samplecleanup
- default true: will remove the job upon success or failuretimeout
- default 120: will timeout watching the job after 120 seconds and "try" to clean up the jobdebug
- default false: will add debug information The following is a sample k8s deployment configuration in your.drone.yml
file:
- name: k8s-job
image: pelotech/drone-k8s-job
settings:
url: https://k8s.server/
token: asldkfj
insecure: false
template: job.yml
Or with no cleanup, different timeout, and different namespace
- name: k8s-job
image: pelotech/drone-k8s-job
settings:
url: https://k8s.server/
token: asldkfj
namespace: testing
insecure: false
template: job.yml
cleanup: false
debug: true
timeout: 200
if you want to add secrets for the token it's KUBERNETES_TOKEN, KUBERNETES_URL, KUBERNETES_CA, JOB_TEMPLATE