diff --git a/mkdocs.yml b/mkdocs.yml index f5fb232..7339dd2 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -52,9 +52,11 @@ nav: - App deploy: - Using Dockerfile: ./user_guides/deploy_using_dockerfile.md - Admin guides: - - Managing platforms: ./admin_guides/managing_platforms.md + - Managing clusters: ./admin_guides/managing_clusters.md - Managing pools: ./admin_guides/managing_pools.md + - Managing platforms: ./admin_guides/managing_platforms.md - Managing teams: ./admin_guides/managing_teams.md + - References: - 404.md - Contributing: diff --git a/src/admin_guides/managing_clusters.md b/src/admin_guides/managing_clusters.md new file mode 100644 index 0000000..8a1f456 --- /dev/null +++ b/src/admin_guides/managing_clusters.md @@ -0,0 +1,74 @@ +# Managing clusters + +## Overview + +Cluster is used by provisioner to deploy applications in a specific kubernetes installation. + + +## Adding a cluster + +In order to create a cluster, you should create a terraform resource or invoke tsuru cluster add: + + + + +=== "Terraform" + read the full documentation of [tsuru_cluster resource](https://registry.terraform.io/providers/tsuru/tsuru/latest/docs/resources/cluster) + + ```terraform + resource "tsuru_cluster" "test_cluster" { + name = "test_cluster" + tsuru_provisioner = "kubernetes" + default = true + kube_config { + cluster { + server = "https://myclusteraddr" + certificate_authority_data = "server-ca" + } + user { + # when GKE + auth_provider { + name = "gcp" + } + # otherwise fill some of options based on our cluster authentication mode + client_certificate_data = "client-cert" + client_key_data = "client-key" + token = "token" + username = "username" + password = "password" + } + } + } + ``` + +=== "Tsuru client" + + the full options are offered only by terraform, the CLI version are just the simplified way to do + + ```bash + $ tsuru cluster add cluster1 kubernetes --addr mycluster-addr + ``` + + +## Listing clusters + +To list pools you do: + +```bash +$ tsuru cluster list ++-------+-------------+-----------+---------------+---------+-------+ +| Name | Provisioner | Addresses | Custom Data | Default | Pools | ++-------+-------------+-----------+---------------+---------+-------+ +| local | kubernetes | | | true | | ++-------+-------------+-----------+---------------+---------+-------+ +``` + +## Removing a cluster + +If you want to remove a cluster, use tsuru cluster remove or undeclare tsuru_cluster resource on terraform + +```bash +$ tsuru cluster remove cluster1 +``` + + diff --git a/src/contributing/docker-compose.md b/src/contributing/docker-compose.md index 4c5e00c..af2e7f0 100644 --- a/src/contributing/docker-compose.md +++ b/src/contributing/docker-compose.md @@ -115,12 +115,12 @@ minikube delete --all ## Useful resources -* [Managing teams](/docs/admin_guides/managing_teams) -* [Managing pools](https://docs.tsuru.io/stable/managing/using-pools.html#adding-a-pool) +* [Managing teams](../admin_guides/managing_teams.md) +* [Managing pools](../admin_guides/managing_pools.md) * [Managing users and permissions](https://docs.tsuru.io/stable/managing/users-and-permissions.html) -* [Managing platforms](https://docs.tsuru.io/stable/managing/create-platform.html) +* [Managing platforms](../admin_guides/managing_platforms.md) * Deploy an app: - * [Deploy an app with Dockerfile](/docs/user_guides/deploy_using_dockerfile/) + * [Deploy an app with Dockerfile](../user_guides/deploy_using_dockerfile.md) ## FAQ diff --git a/src/getting_started/install_gke.md b/src/getting_started/install_gke.md index 7ffddeb..e4766dc 100644 --- a/src/getting_started/install_gke.md +++ b/src/getting_started/install_gke.md @@ -8,11 +8,11 @@ This post will show how to install and configure Tsuru on GKE with Helm. All steps in this guide were done in Kubernetes v1.24.0. While it might work for almost all Kubernetes versions, some versions may break something. Feel free to report us in that case. You need to have both -gcloud and kubectl previously installed on your machine, if you don\'t +gcloud and kubectl previously installed on your machine, if you don't have it yet, you can install it [here](https://cloud.google.com/sdk/docs/install/), with gcloud and [kubectl](https://kubernetes.io/docs/tasks/tools/) properly installed, -let\'s get started. To create a Kubernetes cluster using gcloud, run the +let's get started. To create a Kubernetes cluster using gcloud, run the command: ``` bash @@ -21,7 +21,7 @@ $ gcloud beta container clusters create tsuru-cluster --image-type=COS --machine Download a release of the [Helm client](https://github.com/helm/helm/releases). With helm installed, -let\'s start +let's start ## Installing Tsuru @@ -31,7 +31,7 @@ To install Tsuru and its dependencies we will use a helm chart $ helm repo add tsuru https://tsuru.github.io/charts ``` -Now let\'s install the chart! +Now let's install the chart! ``` bash $ helm install tsuru tsuru/tsuru-stack --create-namespace --namespace tsuru-system @@ -55,7 +55,7 @@ $ tsuru target-add gke http://$TSURU_HOST -s $ tsuru login ``` -Let\'s assign the correct IP to default router: +Let's assign the correct IP to default router: ``` bash $ export NGINX_HOST=$(kubectl get svc -n tsuru-system tsuru-ingress-nginx-controller -o 'jsonpath={.status.loadBalancer.ingress[].ip}')