Files
plugin-drone-kube-apply/README.md
T

1.9 KiB

drone-kubano

A simple Drone plugin for managing Kubernetes deployments. Follows from vallard/drone-kube but with dependency management, up-to-date , improved docs updated to Drone 1.0.0, examples, restructured code and I will .

Usage

Add the following build step to your drone pipeline definition.

drone.yaml partial example

- name: Deploy app
  image: danielgormly/kubano
  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: ey... # Service account token to a service account that can manage deployments
    namespace: custom # [Optional] Custom namespace. (Defaults to `default`)
    custom: string # [Optional] Available to be referenced in template rendering as PLUGIN_CUSTOM
    master_alias: production # [Optional] Custom setting example. Available as PLUGIN_MASTER_ALIAS

deployment templates

Deployment config files are first interpreted by aymerick/raymond (handlebarsjs equivalent). You can use all available raymond expressions, DRONE_*, PLUGIN_* environment variables. Use {{VARIABLE}} to add interpolated expressions. See /example/deployment.template.yaml for a complete example.

Adding a service account to Kubernetes that can manage deployments

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

Development