diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..b636840 --- /dev/null +++ b/.drone.yml @@ -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 diff --git a/Dockerfile b/Dockerfile index fc604ab..297c267 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,4 @@ -FROM bitnami/kubectl:1.16 - -LABEL maintainer "Sinlead " +FROM bitnami/kubectl:latest COPY init-kubectl kubectl /opt/sinlead/kubectl/bin/ diff --git a/README.md b/README.md index 7ba309e..746356a 100644 --- a/README.md +++ b/README.md @@ -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}'