Skip to content

Commit

Permalink
Add docs of clusters
Browse files Browse the repository at this point in the history
  • Loading branch information
wpjunior committed Sep 15, 2023
1 parent b947f1f commit 62fe0dd
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 10 deletions.
4 changes: 3 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
74 changes: 74 additions & 0 deletions src/admin_guides/managing_clusters.md
Original file line number Diff line number Diff line change
@@ -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
```


8 changes: 4 additions & 4 deletions src/contributing/docker-compose.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
10 changes: 5 additions & 5 deletions src/getting_started/install_gke.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand All @@ -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
Expand All @@ -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}')
Expand Down

0 comments on commit 62fe0dd

Please sign in to comment.