Skip to content

Commit

Permalink
04: add pricing
Browse files Browse the repository at this point in the history
  • Loading branch information
katilp committed Oct 20, 2024
1 parent f9f2ae8 commit 0576110
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
7 changes: 7 additions & 0 deletions episodes/03-disk-image.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,13 @@ Note that the bucket for logs has to be in the same region so you might need to

::::::::::::::::::::::::::::::::::::::::::::::::

Once the image is built, you can see it in the list of available images with

```bash
gcloud compute images list
```

That's a long list, there are many images already available. Your new image has your project name under "PROJECT" and `secondary-disk-image` under "FAMILY".

## Costs

Expand Down
20 changes: 18 additions & 2 deletions episodes/04-cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,18 @@ The configurable parameters are defined in `variables.tf` and can be modified in

## Create the cluster

Set the variables in the `terraform.tfvars` files.
Set the variables in the `terraform.tfvars` files for example to

Run
```
project_id = "<PROJECT_ID>"
region = "europe-west4-a"
name = "1"
gke_num_nodes = 2
```

With these parameters, a cluster named `cluster-1` with 2 nodes will be created in the region `europe-west4-a`. You must define your GCP project.

To create the resources, run

```bash
terraform apply
Expand Down Expand Up @@ -115,10 +124,17 @@ This is finally not needed. The streaming for the secondary disk works even if I

## Costs

### Cluster management fee

For the GKE "Standard" cluster, there's a cluster management fee of
$0.10 per hour.

### CPU and memory

The cost is determined by the machine and disk type and is per time.
For this small example cluster with two e2-standard-4 nodes (4 vCPUs and 16 GB memory) the cost the cost is 0.3$ per hour. Each node has a 100 GB disk, and the cost is for two of these disks is 0.006$ per hour, i.e. very small compared to the machine cost.

The cluster usage contributes to the cost through data transfer and networking, but for this example case it is minimal.

::::::::::::::::::::::::::::::::::::: keypoints

Expand Down

0 comments on commit 0576110

Please sign in to comment.