From 09a1731ffc6e84e78899c69d8779d85eaf52519b Mon Sep 17 00:00:00 2001 From: huhfoo Date: Tue, 12 Jan 2021 20:47:57 +0200 Subject: [PATCH 1/5] create instructions for service account setup --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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}' From 01cbc6950fa370e0796d2f932d4010a2bc5e6dd5 Mon Sep 17 00:00:00 2001 From: huhfoo Date: Tue, 12 Jan 2021 20:53:56 +0200 Subject: [PATCH 2/5] Update Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index fc604ab..04c4bb5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM bitnami/kubectl:1.16 +FROM bitnami/kubectl:latest LABEL maintainer "Sinlead " From 59c5c04bf58c6a0cbdeb092c023879561cb00552 Mon Sep 17 00:00:00 2001 From: huhfoo Date: Tue, 12 Jan 2021 20:54:27 +0200 Subject: [PATCH 3/5] use latest tag for kubectl --- Dockerfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 04c4bb5..297c267 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,5 @@ FROM bitnami/kubectl:latest -LABEL maintainer "Sinlead " - COPY init-kubectl kubectl /opt/sinlead/kubectl/bin/ USER root From cba96cebbc9748e2be01162847e971514b1f61ed Mon Sep 17 00:00:00 2001 From: huhfoo Date: Tue, 12 Jan 2021 21:11:48 +0200 Subject: [PATCH 4/5] Create .drone.yml --- .drone.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..7196111 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,13 @@ +kind: pipeline +type: kubernetes +name: publish +steps: +- name: publish + image: plugins/docker + settings: + repo: huhfoo/drone-kubectl + tags: latest + username: + from_secret: docker_username + password: + from_secret: docker_password From 2f3a6a9faf01c4c597d0757ceb7a63920d58f571 Mon Sep 17 00:00:00 2001 From: huhfoo Date: Tue, 12 Jan 2021 21:15:46 +0200 Subject: [PATCH 5/5] Update .drone.yml --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 7196111..b636840 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,6 +1,6 @@ kind: pipeline type: kubernetes -name: publish +name: publish image steps: - name: publish image: plugins/docker