Using Google Container Engine with GCP free tier - google-cloud-platform

Is it possible to use Google Container Engine with Google Cloud free tier?
(I mean the "Always Free" usage limit, not the $300 free credit)
The docs for GKE says:
The basic cluster is free but each node is charged at standard Compute
Engine pricing
But the Compute Engine also have a free instance. Is it possible to use them together?

Unfortuniately, this is no longer a correct answer, as GKE no longer (as of December 2020 if not earlier) supports f1-micro instances for node pools as they do not have sufficient memory (as alluded to in my original answer below where enabling stackdrier would make the cluster unstable). Therefore, it is not possible to run a GKE cluster fully within the free tier.
Previously, this was possible. See explanation below.
Yes, you can use GKE with the free tier. GKE only charges for the underlying compute engine resources, which are directly billed by compute engine. (Note that after June 6, 2020, the free tier only includes one free GKE zonal cluster -- not an unlimited number of clusters).
GKE will likely require you to run 3 free f1-micro instances concurrently to get the cluster to a minimum size, but as long as the cluster is in one of the free regions and the total usage in a month is under the total number of hours per month it will still be free (that is, you can run 3 f1-micros for a bit under 250 hours and still be in the free tier). Make sure to shut off your instances when you are not using them. See more at https://cloud.google.com/free/docs/gcp-free-tier#always-free-usage-limits (especially the notes about the limit being time rather than instance count).
You may also want to ensure that the persistant disks are not kept around while the cluster isn't running, as the free tier only allows 3 10GB disks over the course of the month.
If you happen to run over the usage, you will only be charged for the usage beyond the free tier.
Of course, this all assumes that f1-micro instances are suitable to your use case. They are quite limited, and once GKE is on them, they have almost nothing remaining in terms of RAM: https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-architecture#memory_cpu
Finally, it has been my experience that setting up the stackdriver support when you create the cluster if you only have micro instances can cause the cluster to struggle greatly -- the stackdriver monitoring alone (or with even minimal other applications) start to cause the nodes to be throttled and time out.

For now It's not possible to create kubernates cluster with one f1-micro. It requires minimum 3 f1-micro instances:
ERROR: (gcloud.container.clusters.create) ResponseError: code=400,
message=Clusters of f1-micro instances must contain at least 3 nodes.
Please make the cluster larger or use a different machine type

This is how I made mine. I created a cluster named 'free-cluster' which runs 2 nodes. These nodes are in 'us-west1-a' as the 'free' tier only allows for the us-east, us-west and us-central zones only. also the VM instance-type should only use 'f1-micro' as that is the freebie they give. the rest are paid.
As is pointed out, GCP does force us to create 3 nodes and no option to state this in the dashboard. But after that you can just go to the nodes and "cordon" and "drain" them so they will not consume the free compute fast. You can leave just one node for the free-tier... this however makes less sense as you will not take advantage of load balancing, self-healing and other features as to why we use kubernetes clusters to begin with. for me I am good testing on 2 nodes as I only need to pay for that 1 cheap monthly f1-micro for my hobby and learning. make sure to go to Google Compute Engine in the dashboard and open the 'Instance groups' in the sidebar, you will find the VM instances in that cluster which you can just delete by selecting and clicking the "Delete Instance" button.

There is no way to get a free GKE cluster on GCP, but you can get a very cheap one by following the instructions at https://github.com/Neutrollized/free-tier-gke.
Using a combination of GKE's free management tier and a low cost machine type, the cost estimate is less than $5 per month: .
More details on what is available as part of the free tier can be found here: https://cloud.google.com/free.
tl;dr
gcloud container clusters create cheap-cluster \
--zone us-west1-a \
--node-locations us-west1-a \
--machine-type=e2-small \
--max-nodes=1 \
--num-nodes=1

As I understand, Google allows 1 f1-micro instance to be used for free even after the 12 month free period.

Related

Google cloud compute engine always free tier

I am trying to run a compute engine instance using the always free tier option. The documentation of the free tier says if it is a computer engine instance of e2-micro from certain locations, it should be free. Here is the screenshot:
Now, I have chosen e2-micro with standard persistent disk of 10GB (one can not go below 10GB in GCP platform) at us-central1 location (which is one of the free tier location). It still shows an estimate of $6.51 monthly cost. Here is the screenshot of the instance configuration:
Am I doing something wrong here? Is there any other option I need to check to make sure it stays in the always free tier?
An e2-micro instance is not (in and of itself) free. I think the estimate you are seeing is in fact the cost of running an instance. What makes it "free" is that Google will "waive" the fees for the resources described as "free tier". However, if you run more and more e2-micro instances beyond the amount offered as a "free taster" then you will be charged the rate listed.
Looking in detail at the first image that Syed posted we see the following at the bottom:
Your Free Tier e2-micro instance limit is by time, not by instance. Each month, eligible use of all of your e2-micro instance is free until you have used a number of hours equal to the total hours in the current month.
Putting it another way, you get this amount of resource for free. For example, if we assume that a month is approximately 720 hours then that is the amount of e2-micro consumption you get free in monthly billing cycle. Whether you run 1 instance of CPU consumption for the whole month or 720 instances for only 1 hour. Take care to note that resources are broken down into their chargeable components (CPU, disk, network egress).
Disclaimer: Nothing in this post should be taken as a formal Google statement ... please consult Google documentation such as Google Cloud Free Program for accurate details.

Google cloud platform free tier limits from compute engine

In GCP, it is not notified when a virtual machine of with resources higher than the free tier limit is created. An error message of following pattern arises in the notification. So, what is the maximum allowed resourced for Google cloud platform virtual machine?
Create VM instance "instance-2" and its boot disk "instance-2"
Quota 'C2_CPUS' exceeded. Limit: 0.0 in region asia-south1.
As written in the documentation:
Compute Engine
1 non-preemptible e2-micro VM instance per month in one of the following US regions:.
Oregon: us-west1
Iowa: us-central1
South Carolina: us-east1
30 GB-months HDD.
5 GB-month snapshot storage in the following regions:.
Oregon: us-west1
Iowa: us-central1
South Carolina: us-east1
Taiwan: asia-east1
Belgium: europe-west1
1 GB network egress from North America to all region destinations (excluding China and Australia) per month
Your Free Tier e2-micro instance limit is by time, not by instance. Each month, eligible use of all of your e2-micro instances is free until you have used a number of hours equal to the total hours in the current month. Usage calculations are combined across the supported regions.
Google Cloud Free Tier does not include external IP addresses.
Compute Engine offers discounts for sustained use of virtual machines. Your Free Tier use doesn't factor into sustained use.
GPUs and TPUs are not included in the Free Tier offer. You are always charged for GPUs and TPUs that you add to VM instances.
NB: This is subject to changes, check the link for up-to-date information.
Step-by-Step guide to create a free instance:
Create instance
Now go create the instance at https://console.cloud.google.com/compute/instancesAdd
region: us-east1 or one of the region indicated in the documentation.
Select General Purpose -> N2 -> e2-micro. You will see "Your first 744 hours of e2-micro instance usage are free this month"
Select Boot disk -> public image -> ubuntu -> 20.04LS -> boot disk type: Standard persistent disk (HDD) -> size 30gb (or as per documentation)
Allow http and https traffic (or don't check the boxes, if you don't intend to use port 80 and 443)
Click on Create
You can check "view billing report" to make sure you did it right.
You can found more information at the documentation Google Cloud Free Tier:
The Google Cloud Free Tier has two parts:
A 3-month(previously 12) free trial with $300 credit to use with any Google Cloud services.
Always Free, which provides limited access to many common Google Cloud resources, free of charge.
At the section 12-month, $300 free trial you can find Program coverage details:
Your free trial credit applies to all Google Cloud resources, with the
following exceptions:
You can't have more than 8 cores (or virtual CPUs) running at the same time.
You can't add GPUs to your VM instances.
You can't request a quota increase. For an overview of Compute Engine quotas, see Resource quotas.
You can't create VM instances that are based on Windows Server images.
You must upgrade your account to perform any of the actions in the preceding list.
In addition, have a look at the End of the free trial:
The free trial ends when you use all of your credit, or after 12
months, whichever happens first. At that time, the following
conditions apply:
You must upgrade to a paid account to continue using Google Cloud.
All resources you created during the trial are stopped.
Any data you stored in Compute Engine is lost.
Your account enters a 30-day grace period, during which you can recover resources and data you stored in any Google Cloud services
during the trial period.
You might receive a message stating that your account has been canceled, which only indicates that your account has been suspended to
prevent charges.
and at the Recovering data:
Caution: There is no automated way to recover data that you used on VM instances you created with Compute Engine. You must manually
export any data that you want to keep from your Compute Engine VM
instances before the trial period ends.
I do recommend you to upgrade your account before free trial ends.
After the free trial period ends you just have to register a credit card to continue to use their services if/when you accrue charges from them. If you set it up right it might charge you .02 cents every now and then. I just set up my first one with wordpress and at first I would get charged .02cents/month but once I updated the software and the config it rarely charges me. p.s. I started getting hack attempts pretty quickly.

Why am I being charged for N1 Predefined Instance Ram?

I'm new at GCP and I confess that don't undestand all of the billings.
I'm being charged twice for my instance as you can see in the following image
First for my Instance Core, okay, but later for a Instance Ram, I had made my research and discovered that this can charge me when I use custom RAM on my instance
In this following print, it says me how to find out if I'm using more vCPUs than the pre-defined options
As you can see I'm only using 1 reserved vCPU
That is the pre-defined options of n1-standard-1
Is this charge correct? If so, is there a way to prevent it using n1-standard-1? How?
I am following up regarding your concern about how your instances are being charged. You can verify pricing for Predefined vCPUs and memory. This is the actual price of the service and is more reliable compared to the Pricing Calculator which only gives you an estimate.
The VM instances charge pricing is in this link. It shows the cost for N1’s machine standard predefined machine types. The vCPUs and memory from each of the machine types are billed by their individual predefined vCPU and memory prices.
I suggest that you check the complete pricing matrix for all of our services so you'll have an idea of how much the actual charges will be for your projects and you can choose different instance types or memory from pre-defined n1-standard-1.
If you are interested in discounts, this document explain 3 type of discounts: Sustained use discounts, Committed use discounts, Discounts for preemptible VM instances
Also the Google Cloud Free Tier gives you free resources to learn about Google Cloud services by trying them on your own.

GCP GCE F1-micro not free?

I am trying to create a GCE f1-micro in GCP. It should be free according to: GCP Free Tier
and following the tutorial: How to set up a free micro VPS on Google Cloud Platform
However it does not seem to be free. The pricing calculator set beside is showing the message:
$4.28 monthly estimate
What I am missing? thanks
It's f1-micro is always free up to 720 hours (1 month) in the supported regions. GCP still shows you the cost per hour, because GCP doesn't yet know how many hours you're going to use. If you use more than 720 hours, it will begin charging you at that rate.
Your Always Free f1-micro instance limit is by time, not by instance. Each month, eligible use of all of your f1-micro instances is free until you have used a number of hours equal to the total hours in the current month.
Sicne this was answered, the free instance type is now an e2-micro, not an f1-micro, but this answer should otherwise still hold.
A single free tier qualified (e.g. e2-micro) instance, running for an entire month, given certain constraints, should be free, yes.
2 things might be at play here for your estimate:
When using the pricing calculator, to ensure the free tier limits are accounted for, make sure you check the "Include Always Free usage in my estimate" box (note that this checkbox only appears if you have selected a valid "always free" configuration):
The GCP pricing calculator does not automatically include disk in the estimate, but it would also account for the free tier for disk usage in a similar way, when it is added to the estimate.
That said, you appear to be referring to the estimate that shows up on the "Create an instance" page. This estimate does not account for the free tier, and additionally includes the cost the persistent disk that you have requested (also without accounting for the free tier). However, if you see the message "Your first 720 hours of f1-micro instance usage are free this month." above that estimate, the instance (but possibly not including the disk if it is, for example, larger than 30GB) should qualify for the free tier (subject to your other usage, of course).
Second, the always free tier for an f1-micro is only in one of three US regions: us-west1, us-central1, or us-east1. Make sure you have selected one of those regions.

Is Google Cloud Trial enough for academic project?

We are going to use Kubernetes Engine, Cloud SQL, Storage, and possibly Nosql and cache services for our academic project.
So far we'll have 5 accounts and the project has to be running for 3 months.
Will it be enough for us? Is it possible, for example, to stop project and billing every night or even stop and start at any time?
The Google Cloud Platform (GCP) Free Tier includes $300.00 USD in credits to get started with any GCP product. Since this is an academic project, I recommend using the Google Cloud Platform Pricing Calculator to learn how to price GCP products and services - link. Also review what is included in the "Always Free Products" - link. Then there are discounts for services that run for a majority of the month - "Sustained Usage Discounts" - link.
Google Kubernetes Engine:
Kubernetes Engine is free (the worker nodes are not free).
If you select n1-standard-1 (1 vCPU, 3.75 GB mem) the cost is $24.27 per month per node. Typically you will create a three node cluster: round up to $75.00 per month.
Google Cloud SQL:
Selecting a db-pg-f1-micro (PostgreSQL) with 32 GB of SSD storage: $24.27 per month
Will it be enough for us?
As you can see, you will quickly burn thru $300.00 in credit in only three months.
Take into consideration that Google's goal is not to give away services. The goal is to introduce you to Google Cloud and provide enough services at zero or low cost so that you can complete an evaluation of Google Cloud.
Is it possible, for example, to stop project and billing every night
or even stop and start at any time?
No, you cannot start and stop billing every night. In order to stop billing for a project you must delete the project and everything in it. Some services such as Google Compute Engine (GCE) can be stopped. This stops billing for the VM instance but billing for storage, snapshots, IP addresses, etc. continues unless you delete your instances every night and recreate them each morning.
Services such as Kubernetes or Google Cloud SQL cannot be completely shutdown. Technically you could by deleting everything but then recreating everything takes more time than the savings gained. Very good for practice however.
Google Cloud services would be a great option for your circumstances.
If its budgetary constraint you may want to look into using AWS, AWS will provde you with a years time for free which would be good for your horizontal scaling with k8s
Amazon and Kubernetes