GCP: Kubernetes engine allocatable resources - kubernetes

According to the documentation, Kubernetes reserves a significant amount of resources on the nodes in the cluster in order to run itself. Are the numbers in the documentation correct or is Google trying to sell me bigger nodes?
Aside: Taking kube-system pods and other reserved resources into account, am I right in saying it's better resource-wise to rent one machine equiped with 15GB of RAM instead of two with 7.5GB of RAM each?

Yes, kubernetes reserves a significant amount of resources on the nodes. So better consider that before renting the machine.
You can deploy custom machines in GCP. For the pricing you can use this calculator by Google

Related

kubernetes - Why is there a max pods per node?

Why is there a pod limit in Kubernetes?
It makes intuitive sense to me that there'll be some limitation, but I'm curious to know the specific botteleneck which warrants the limit.
The default limit of 110 pods per node is merely a compromise of Kubernetes, I think, not a technical limit.
Some vendors have additional limitations.
For example, on Azure, there's a limit on the number of IP addresses you can assign to a node. So if your Kubernetes cluster is configured to assign a IP address from Azure VNet to each pod, the limit is 30 (See https://learn.microsoft.com/en-us/azure/aks/configure-azure-cni#maximum-pods-per-node).
On IBM Cloud, if you use IBM Block Storage for persistent volumes, they will be mounted as 'Secondary volumes' on your node, and you can only have 12 of those per node, so that's limit of 12 pods with persistent volumes. It sucks when you hit that limit when scaling up the first time :-(
On other vendors or with other storage classes, this limit is larger: https://kubernetes.io/docs/concepts/storage/storage-limits/

gcp kubernetes autopilot mode, what is the free tier

I'm trying to use the free tier (autopilot mode) to learn k8s on gcp. However I cam across the following Is it possible to have Google Cloud Kubernetes cluster in the free tier?. However when I checked the link given in the question I could not find the specified limitation f1-micro machines are not supported due to insufficient memory. Is this still valid ? can I use k8s on gcp in the free tier without incurring any cost?
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.
Also, for your question regarding limitation of f1-micro to be used in GKE,if you follow the documentation limitation
It is written that- Minimum CPU platform cannot be used with shared core machine types. Now since f1-micro machines are shared core machine types. So it is valid and cannot be used.
As described in the documentation, there is no management cost for 1 Autopilot or 1 GKE standard zonal mode.
You don't pay for the control plane. But then you have to pay for your workload measured in seconds for autopilot (pod level) and seconds for GKE standard (node level (compute engine))
For study purpose, I believe its better to have classic (Standard) GKE cluster rather than autopilot, where you have less managing options.
When its come to pricing, using Preemptible nodes in GKE cluster is a better option where pricing is really low.
you can enable this selecting as below
Preemptible nodes
Hi If you want to learn the K8s on GCP you can try using qwiklabs where you get some initial credits by which you can access some of the labs where you can learn and practice your activities. https://go.qwiklabs.com/qwiklabs-free

Google Cloud Kubernetes with 3 Micro Instances (Free tier) - Not useable AT ALL?

I'm using google cloud with the free tier and the free credits, and I wanted to try out kubernetes.
I create node pool of 3 f1-micro instances (only f1-micro instances are eligible for free tier). It seems each one should end up with 240mb of memory.
However, I tried to create a simple deployment with a pod requesting 100Mi of memory, and I'm getting an Insufficient Memory errors.
Does that mean google cloud Kubernetes isn't really usable with the free tier, hence it's not free at all?
Or am I missing something here?
For each of the nodes run kubectl describe nodename which will show lot of details about the node and look for Allocatable and Allocated resources. You may notice that almost all the memory is used, and f1-micro is limited to an average of 0.2 CPU which has been exceeded just by the k8s system pods.
You can try editing the deployment of system pods such as CoreDNS and reduce the requests of the pods

How to check if my kubernetes cluster has resources to deploy all my softwares

I want to deploy many softwares in a kubernetes cluster. I have information like the configuration of each software like the number of pods, request and limits of cpu and RAM for each software.
My requirement is all the softwares should be provisioned successfully or none of them should be provisioned even if one software fails. Failure can be because there are no enough resources in the kubernetes cluster
How do I check if my cluster has sufficient resources to provision all the softwares even before actual deployment of the softwares
AFAIK kubernetes does not support deploying either all or none application.
I think you have to do the maths by yourself.
You said, every information you need is there (Requirements for all the Services).
This should help you planning your clusters dimensions.
Know you should calculate this on node basis. Lets say, you need 16GB Memory. Your nodes bring 8gb per Machine. Your Cluster should provide at least 24GB (3 Nodes) Memory for your application (beside monitoring tools etc.).
Always calculate something on top, because OS and Monitoring-Tools will take a little bit of your nodes resource.

What's the maximum number of Kubernetes namespaces?

Is there a maximum number of namespaces supported by a Kubernetes cluster? My team is designing a system to run user workloads via K8s and we are considering using one namespace per user to offer logical segmentation in the cluster, but we don't want to hit a ceiling with the number of users who can use our service.
We are using Amazon's EKS managed Kubernetes service and Kubernetes v1.11.
This is quite difficult to answer which has dependency on a lot of factors, Here are some facts which were created on the k8s 1.7 cluster kubernetes-theresholds the Number of namespaces (ns) are 10000 with few assumtions
The are no limits from the code point of view because is just a Go type that gets instantiated as a variable.
In addition to link that #SureshVishnoi posted, the limits will depend on your setup but some of the factors that can contribute to how your namespaces (and resources in a cluster) scale can be:
Physical or VM hardware size where your masters are running
Unfortunately, EKS doesn't provide that yet (it's a managed service after all)
The number of nodes your cluster is handling.
The number of pods in each namespace
The number of overall K8s resources (deployments, secrets, service accounts, etc)
The hardware size of your etcd database.
Storage: how many resources can you persist.
Raw performance: how much memory and CPU you have.
The network connectivity between your master components and etcd store if they are on different nodes.
If they are on the same nodes then you are bound by the server's memory, CPU and storage.
There is no limit on number of namespaces. You can create as many as you want. It doesn't actually consume cluster resources like cpu, memory etc.