2019-08-27 11:49:03 +10:00
2019-04-03 10:59:05 +11:00
2019-08-26 15:00:34 +10:00
2019-03-29 11:02:34 +11:00
2019-08-26 15:24:33 +10:00
2019-06-17 12:07:15 +10:00
2019-08-27 11:49:03 +10:00
2019-08-27 11:46:32 +10:00
...
2019-05-29 15:33:09 +10:00
2019-06-13 18:19:05 +10:00
wip
2019-06-14 13:01:43 +10:00
2019-08-26 15:00:34 +10:00
2019-08-23 17:40:46 +10:00
2019-08-23 17:40:46 +10:00

drone-plugin-kube

A simple Drone plugin for updating Kubernetes deployments from templates & configMaps from files. Follows from vallard/drone-kube but with dependency management, up-to-date client-go, docs updated to Drone 1.0.0 syntax, examples and a different structure. This plugin will create a deployment if it doesn't currently exist.

Usage

Add the following build step to your drone pipeline definition. Currently this plugin only updates deployments, it does not create them. I can add this behaviour or I will accept pull requests to introduce it.

drone.yaml deployment example

- name: Deploy app
  image: danielgormly/drone-plugin-kube
  settings:
    template: path/to/deployment.yaml # within repo
    ca: LS0tLS1... # BASE64 encoded string of the K8s CA cert
    server: https://10.0.0.20:6443 # K8s master node address
    token:
      from_secret: kubernetes_token # Service account token to a service account that can manage deployments
    namespace: custom # [Optional] Kubernetes namespace to use (defaults to `default`)
    [example_custom_key]: string # [Optional, example] Any additional values you label here will be available for template interpolation (lower case key names only!)

Deployment templates

Deployment config files are first interpreted by aymerick/raymond (handlebarsjs equivalent). You can use all available raymond expressions and anything you put in settings will be made available in your deployment template e.g. {{namespace}}. See example/deployment.template.yaml for a complete example.

Config maps from files

In this case, you can create a template just like deployment.yaml but you can provide a file path (relative to the repo's root) in the plugin setting configmap_file. (Currently only accepts utf-8 encoded data). Like deployments, this will both create new or update existing configmaps (based on the configmap name).

Adding a service account to Kubernetes that can manage deployments

See example/Role.yaml, example/ServiceAccount.yaml, example/RoleBinding.yaml.

Development notes

S
Description
No description provided
Readme 6.2 MiB
Languages
Go 90.7%
Shell 8.9%
Dockerfile 0.4%