Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
kind: pipeline
type: kubernetes
name: publish image
steps:
- name: publish
image: plugins/docker
settings:
repo: huhfoo/drone-kubectl
tags: latest
username:
from_secret: docker_username
password:
from_secret: docker_password
4 changes: 1 addition & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
FROM bitnami/kubectl:1.16

LABEL maintainer "Sinlead <opensource@sinlead.com>"
FROM bitnami/kubectl:latest

COPY init-kubectl kubectl /opt/sinlead/kubectl/bin/

Expand Down
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,19 @@ steps:

First, you need to have a service account with **proper privileges** and **service-account-token**.

Create a service account

```bash
kubectl create serviceaccount deploy
```

Assign the RoleBinding to the service account

```bash
kubectl create clusterrolebinding drone-rolebinding --clusterrole=cluster-admin --group=system:serviceaccounts:deploy

```

You can find out your server URL which looks like `https://xxx.xxx.xxx.xxx` by the command:
```bash
kubectl config view -o jsonpath='{range .clusters[*]}{.name}{"\t"}{.cluster.server}{"\n"}{end}'
Expand Down