diff --git a/README.md b/README.md index 4209575..90f017e 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ If you use this downlaoder, you can avoid to download the binary several times. * Display Name: Name of the task * k8s endpoint: select the endpoint which you created at `1.1. Create an endopint` -* kubectl binary: Leave it blank.(depricated) +* kubectl binary: Leave it blank. Don't use this.(depricated) * kubectl download version:If you want to specify the version, fill this, e.g. `v1.5.2`. Blank means latest. * enable istioctl: Check it if you want to use istioctl * istioctl download version: Specify the version. Blank doesn't mean the latest. not like the kubectl downloader. e.g. `0.1.5` diff --git a/k8s.md b/k8s.md index 8d81c62..b55a541 100644 --- a/k8s.md +++ b/k8s.md @@ -1,18 +1,15 @@ Kubernetes extension for VSTS === -Enable Kubernetes extension for VSTS. Kubernetes endpoint for kubectl config and kubectl apply build task. -Mainly aim for using Linux Hosted Agent(preview). +Enable us to use Kubernetes related product for VSTS. Also it enable us to kubernetes endpoint for kubectl. You can use kubectl, helm, and istioctl by this extension. This task aims for using Linux Hosted Agent(preview). GitHub repo is [here](https://github.com/TsuyoshiUshio/KubernetesTask). +**NOTE:** this task is NOT the official Kubernetes task created by Microsoft. -Currently, stable version tasks are version 0.x.x.or 1.x.x. 2.0.0 or later is preview. - - -[GitHub: KubernetesTask](https://github.com/TsuyoshiUshio/KubernetesTask) +Currently you can use istio/helm feature from 3.0.0. or later. ![Header](https://raw.githubusercontent.com/TsuyoshiUshio/KubernetesTask/master/docs/images/Header.png) -# 1 How to use this +# 1. How to use ## 1.1. Create an endopint @@ -36,7 +33,7 @@ You can get config file from your k8s master node `.kube/config`. See [Microsoft Azure Container Service Engine - Kubernetes Walkthrough](https://docs.microsoft.com/en-us/azure/container-service/container-service-kubernetes-walkthrough) Then copy the file content and paste on kubeconfig column. -**NOTE** +**NOTE:** If you copy config file into Kubeconfig, the build log of VSTS might show you the contents. This happens when you copy multiline. @@ -54,8 +51,61 @@ node tools/convert.js {filename} You can find {filename}_new file which include base64 encoding string. +## 1.2. downloader + +If you want to use kubectl/istioctl/helm binary, you need to use this task in advance. For the backword compatibility, I letf the old tasks like `kubernetes apply task` and `kubernetes general task`. However, I recommend to use the new task with downloader. It will be much more flexible and simple. + +If you use this downlaoder, you can avoid to download the binary several times. This task download kubectl/istioctl/helm binary into `./.vstsbin` directory and add it to the `PATH` environment variables. Also, it set `KUBECONFIG` environment variables. If you use this downloader, the following task can use kubectl/istioctl/helm command without specifying the full-path binary file name. + +![downloader](https://raw.githubusercontent.com/TsuyoshiUshio/KubernetesTask/master/docs/images/downloader.png) + +* Display Name: Name of the task +* k8s endpoint: select the endpoint which you created at `1.1. Create an endopint` +* kubectl binary: Leave it blank. Don't use this.(depricated) +* kubectl download version:If you want to specify the version, fill this, e.g. `v1.5.2`. Blank means latest. +* enable istioctl: Check it if you want to use istioctl +* istioctl download version: Specify the version. Blank doesn't mean the latest. not like the kubectl downloader. e.g. `0.1.5` +* enable helm: Check it if you want to use helm +* helm download version: Specify the version. Blank doesn't mean the latest. not like the kubectl downloader. e.g. `2.4.1` + +## 1.3. kubectl task + +You can execute kubectl using this task. If you want to use this task, you need to use `downloader` task in advance. See `1.2. downloader`. + +![kubectl task](https://raw.githubusercontent.com/TsuyoshiUshio/KubernetesTask/master/docs/images/kubectl.png) + +* Display name: Name of the task +* Sub Command: Specify kubectl sub command like apply, get, and so on. +Refer the [Overview of kubectl](https://kubernetes.io/docs/user-guide/kubectl-overview/). +* Argument: You can use any options and arguments. You can specify these with a space or a new line. New line will be converted into a space. + +## 1.4. istio task -## 1.2. Store and link kubectl command link with VSTS private repository +You can execute istioctl using this task. If you want to use this task, you need to use `downloader` task in advance. See `1.2. downloader`. + +![istio task](https://raw.githubusercontent.com/TsuyoshiUshio/KubernetesTask/master/docs/images/istio.png) + +* Display name: Name of the task +* Sub Command: Specify istio sub command like replace, create, and so on. +Refer the [istioctl](https://istio.io/docs/reference/commands/istioctl.html). +* Argument: You can use any options and arguments. You can specify these with a space or a new line. New line will be converted into a space. + +## 1.5. helm task + +You can execute helm using this task. If you want to use this task, you need to use `downloader` task in advance. See `1.2. downloader`. + +![helm task](https://raw.githubusercontent.com/TsuyoshiUshio/KubernetesTask/master/docs/images/helm.png) + +* Display name: Name of the task +* Sub Command: Specify helm sub command like create, verify, and so on. +Refer the [Using helm](https://docs.helm.sh/using_helm/#using-helm). +* Argument: You can use any options and arguments. You can specify these with a space or a new line. New line will be converted into a space. + +## 1.6. kubernetes apply task + +**NOTE:** kubernetes apply/general task is for backward compatibility. + +### 1.6.1. Store and link kubectl command link with VSTS private repository (Optional) If you use ver 2.0, you don't need this operation. However, this operation could fasten your pipeline without downloading a kubectl binary. @@ -67,7 +117,7 @@ Please `chmod +x kubectl` before adding kubectl to your repo. ![VSTS Private Repository](https://raw.githubusercontent.com/TsuyoshiUshio/KubernetesTask/master/docs/images/repo01.png) -## 1.3. Setup your kubectlapply task +## 1.6.2. Setup your kubectlapply task Then you can use the endpoint, specify the kubectl command and YAML file for deployment. Internally, it calls `kubectl apply` command. @@ -79,7 +129,9 @@ If you want to change the YAML file dynamically, you can use [Replace tokens](ht You can see the `downloadVersion` textbox. If you don't specify `KubectlBinary`, this task automatically download the latest kubebinary. If you want to specify the version, fill the `downloadVersion`, e.g. `v1.5.2`. -## 1.4. Setup your kubectlgeneral task +## 1.7. kubernetes general task + +**NOTE:** kubernetes apply/general task is for backward compatibility. You can use every kubectl command you want. Use kubectlgeneral task. You can specify a lot of arguments separated with space or new line. @@ -89,6 +141,7 @@ You can specify a lot of arguments separated with space or new line. You can see the `downloadVersion` textbox. If you don't specify `KubectlBinary`, this task automatically download the latest kubebinary. If you want to specify the version, fill the `downloadVersion`, e.g. `v1.5.2`. + # 2. Project GitHub Any contribution is welcome! diff --git a/tasks/downloader/task.json b/tasks/downloader/task.json index b9ba069..3413e99 100644 --- a/tasks/downloader/task.json +++ b/tasks/downloader/task.json @@ -14,7 +14,7 @@ "version": { "Major": "0", "Minor": "1", - "Patch": "27" + "Patch": "30" }, "minimumAgentVersion": "1.95.0", "instanceNameFormat": "downloader $(message)",