https://github.com/sh4d1/drone-kubernetes
Drone Plugin for Kubernetes
https://github.com/sh4d1/drone-kubernetes
deployment drone-kubernetes drone-plugin golang kubernetes
Last synced: 10 months ago
JSON representation
Drone Plugin for Kubernetes
- Host: GitHub
- URL: https://github.com/sh4d1/drone-kubernetes
- Owner: Sh4d1
- Created: 2018-01-22T14:36:08.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-11-22T06:54:48.000Z (over 7 years ago)
- Last Synced: 2025-04-15T10:45:18.245Z (about 1 year ago)
- Topics: deployment, drone-kubernetes, drone-plugin, golang, kubernetes
- Language: Go
- Size: 22.5 MB
- Stars: 31
- Watchers: 2
- Forks: 14
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Drone Kubernetes
[](https://cloud.drone.io/Sh4d1/drone-kubernetes) [](https://hub.docker.com/r/sh4d1/drone-kubernetes/ "Get your own image badge on microbadger.com")
Drone plugin to create/update Kubernetes resources.
It uses the latest k8s go api, so it is intened to use on Kubernetes 1.9+. I can't guarantee it will work for previous versions.
You can directly pull the image from [sh4d1/drone-kubernetes](https://hub.docker.com/r/sh4d1/drone-kubernetes/)
## Supported resources
Currently, this plugin supports:
* apps/v1
* DaemonSet
* Deployment
* ReplicaSet
* StatefulSet
* apps/v1beta1
* Deployment
* StatefulSet
* apps/v1beta2
* DaemonSet
* Deployment
* ReplicaSet
* StatefulSet
* v1
* ConfigMap
* PersistentVolume
* PersistentVolumeClaim
* Pod
* ReplicationController
* Service
* extensions/v1beta1
* DaemonSet
* Deployment
* Ingress
* ReplicaSet
## Inspiration
It is inspired by [vallard](https://github.com/vallard) and his plugin [drone-kube](https://github.com/vallard/drone-kube).
## Usage
Here is how you can use this plugin:
```
pipeline:
deploy:
image: sh4d1/drone-kubernetes
kubernetes_template: deployment.yml
kubernetes_namespace: default
secrets: [kubernetes_server, kubernetes_cert, kubernetes_token]
```
## Secrets
You need to define these secrets before.
```
$ drone secret add --image=sh4d1/drone-kubernetes -repository -name KUBERNETES_SERVER -value
```
```
$ drone secret add --image=sh4d1/drone-kubernetes -repository -name KUBERNETES_CERT -value
```
```
$ drone secret add --image=sh4d1/drone-kubernetes -repository -name KUBERNETES_TOKEN -value
```
### How to get values of `KUBERNETES_CERT` and `KUBERNETES_TOKEN`
List secrets of `default` namespace
```
$ kubectl get -n default secret
```
Show the `ca.crt` and `token` from secret
```
$ kubectl get secret -n -o yaml | egrep 'ca.crt:|token:'
```
You can copy/paste the encoded certificate to the `KUBERNETES_CERT` value.
For the `KUBERNETES_TOKEN`, you need to decode it:
* `echo "" | base64 -d`
* `kubectl describe secret -n | grep 'token:'`
TODO