diff --git a/content/posts/04-container-image-size.md b/content/posts/04-container-image-size.md deleted file mode 100644 index 8da10a3..0000000 --- a/content/posts/04-container-image-size.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: "How to reduce container image size" -date: 2023-01-15T01:33:20+01:00 -summary: "Some optimization method to reduce your container image size! " -tags: [Best Prsactices, Container] -categories: [Container, Best Practices] -weight: "998" -showToc: true -draft: true -cover: - image: "../img/03/cover.png" ---- - diff --git a/content/posts/05-eks.md b/content/posts/05-eks.md deleted file mode 100644 index 7e6250d..0000000 --- a/content/posts/05-eks.md +++ /dev/null @@ -1,66 +0,0 @@ ---- -title: "Eks" -date: 2023-03-15T23:53:31+01:00 -draft: true ---- - -## 0. Brief introduction to Kubernetes - -Kubernetes, also known as K8s, is an open-source container orchestration platform that automates the deployment, scaling, and management of containerized applications. It was originally developed by Google and is now maintained by the Cloud Native Computing Foundation (CNCF). Kubernetes provides a powerful and flexible infrastructure for managing containers, making it easier to deploy and manage complex applications in a cloud-native environment. It is used by organizations of all sizes to improve the reliability, scalability, and agility of their applications, and has become one of the most popular tools for building and running modern, cloud-native applications. - -This is typical Kubernetes architecture - -![Kubernetes](../img/03-EKS/TalkKubernetes.png) - -A few words about the core components of Kubernetes in case this is your first time hearing about it: - -1. **API Server**: It allows us to interact with the cluster via API calls. It is the only component who writes on etcd and to which others turn when they have done their job - -2. **Scheduler**: it checks for newly created pods that do not have a node assigned and, after identifying it, assigns it. The factors taken into consideration in identifying a node to which to assign the execution of a Pod include the request for resources of the Pod itself and of the other workloads present in the system, the constraints of the hardware/software/policies, the indications of affinity and anti-affinity, data/volume availability requirements, interference between different workloads and deadlines - -3. **Controller Manager**: It performs several control loops, one for each type of resource that can be created within the cluster. It takes care of keeping the etcd status aligned with that of the resources located within the cluster. In the event that these two states do not match, the scheduler will be responsible for converging the cluster state to the one desired by the user. - -4. **etcd**: a key-value storage. It keeps cluster’s state - -5. **Kubelet**: an agent that runs on every node of the cluster. It makes sure that the containers are running in a pod and communicates directly with the API-server - -6. **Kube-proxy** It acts as a network proxy and load balancer, routing traffic between pods and services based on network policies and rules defined by the Kubernetes API. - -Using Kubernetes on-premises can provide many benefits, such as improved security and data sovereignty, greater control over infrastructure resources, and increased performance and reliability. However, managing a Kubernetes cluster on-premises can be complex and time-consuming, requiring specialized skills and resources. - -That's why many organizations are turning to cloud-based Kubernetes solutions like managed Kubernetes services, which offer the flexibility and scalability of Kubernetes without the burden of managing it on-premises. With managed Kubernetes services like Amazon EKS, organizations can easily deploy and manage Kubernetes clusters in the cloud, taking advantage of built-in security features, automatic scaling, and seamless integration with other AWS services. - -By adopting a managed Kubernetes service like EKS, organizations can accelerate their adoption of cloud-native technologies, reduce operational overhead, and focus on building and deploying innovative applications that drive business value. - - -## 1. Managed Kubernetes in Cloud: Amazon Elastic Kubernetes Services - -Amazon Elastic Kubernetes Service (EKS) is a fully managed Kubernetes service offered by Amazon Web Services (AWS). It simplifies the process of deploying, managing, and scaling Kubernetes clusters on the AWS cloud, making it easier for developers to build and deploy cloud-native applications. - -With EKS, AWS manages the underlying infrastructure and Kubernetes control plane, allowing developers to focus on building and deploying their applications. EKS integrates with other AWS services, such as Elastic Load Balancing, Auto Scaling, and Amazon S3, to provide a seamless and scalable platform for running containerized applications. - - -![EKS](../img/03-EKS/EKS.png) - -## 2. Main differences between Kubernetes on premise and EKS - -The main difference between the two is that with Kubernetes on-prem, you have full control over the deployment and management of your Kubernetes cluster, including the hardware it runs on, networking configuration, and security. However, this also means you are responsible for managing and maintaining the underlying infrastructure, which can be complex and time-consuming. - -- Control plane - -![control-plane-eks](../img/03-EKS/eks-data-plane-connectivity.jpeg) - -EKS architecture is designed to eliminate any single points of failure that may compromise the availability and durability of the Kubernetes control plane. -The Kubernetes control plane managed by EKS runs inside an EKS managed VPC. The EKS control plane comprises the Kubernetes API server nodes, etcd cluster. Kubernetes API server nodes that run components like the API server, scheduler, and kube-controller-manager run in an auto-scaling group. EKS runs a minimum of two API server nodes in distinct Availability Zones (AZs) within in AWS region. Likewise, for durability, the etcd server nodes also run in an auto-scaling group that spans three AZs. EKS runs a NAT Gateway in each AZ, and API servers and etcd servers run in a private subnet. This architecture ensures that an event in a single AZ doesn’t affect the EKS cluster's availability. - -You can configure whether your Kubernetes cluster’s API server is reachable from the public internet (using the public endpoint) or through your VPC (using the EKS-managed ENIs) or both. - - - -## 3. EKS integration with AWS services - -## 4. AWS VPC CNI - -## 5. Monitoring - -## 6. How can i start? diff --git a/content/posts/18-homelabbers-assemble.md b/content/posts/18-homelabbers-assemble.md index 99ce1ae..b32ab7e 100644 --- a/content/posts/18-homelabbers-assemble.md +++ b/content/posts/18-homelabbers-assemble.md @@ -1,11 +1,11 @@ --- -title: "Homelabbers Assemble: Proxmox and Terraform" -date: 2024-01-01T21:57:02+01:00 +title: "Homelabbers Assemble: Proxmox and Terraform!" +date: 2024-02-01T21:57:02+01:00 summary: "IaC in your Homelab with Proxmox & Terraform!" -draft: true +draft: false weight: 885 -tags: ["How to", "Homelab", "Proxmox", "IaC"] -categories: ["How to", "Homelab", "Proxmox", "IaC"] +tags: ["How to", "Homelab", "Proxmox", "IaC", "Terraform"] +categories: ["How to", "Homelab", "Proxmox", "IaC", "Terraform"] showToc: true cover: image: "../img/18/cover.png" @@ -15,7 +15,7 @@ cover: A few days ago, the first component of my new homelab arrived. I already had a makeshift homelab set up with mostly old laptops that I no longer used. -However, after spending countless hours on subreddits like [r/homelab](https://www.reddit.com/r/homelab/comments/198jn6q/to_those_asking_how_i_powered_the_tesla_p40_and/) or [r/homelabprn](https://www.reddit.com/r/HomeLabPorn/), among many others, the homelab bug got to me, and I decided to build a new one. +However, after spending countless hours on subreddits like [r/homelab](https://www.reddit.com/r/homelab/) or [r/HomeLabPorn](https://www.reddit.com/r/HomeLabPorn/), among many others, the homelab bug got to me, and I decided to build a new one. For months, I searched for the perfect hardware on numerous websites, and it was genuinely challenging to choose from all those fantastic components. In the end, I realized that the perfect homelab for me should be modular, quiet, and not consume too much power. @@ -65,7 +65,8 @@ Proxmox Virtual Environment (Proxmox VE) is an open-source virtualization soluti - Requires modest resources - Supports clustering - No CAPI provider (or at least not at the time of writing this article) -- In the end, the choice fell on Proxmox, even though I was on the verge of scrapping everything and opting for ESXi just to have the option of creating clusters with CAPI. + +In the end, the choice fell on Proxmox, even though I was on the verge of scrapping everything and opting for ESXi just to have the option of creating clusters with CAPI. ## 2 How I install Proxmox on my mini server @@ -74,7 +75,7 @@ I created a bootable USB stick for Proxmox using [Ventoy](https://www.ventoy.net A small tip that might save you a lot of time: in the end, I used a slightly older version of Proxmox due to a compatibility issue between the Proxmox provider for Terraform and the latest Proxmox versions. -The problem is documented in the GitHub issues, which you can find here -> [Error: The terraform-provider-proxmox_v2.9.14 plugin crashed! (Proxmox 8.0.4 latest update) #863](https://github.com/Telmate/terraform-provider-proxmox/issues/863) +The problem is documented in the GitHub issues, which you can find here -> [Error: The terraform-provider-proxmox_v2.9.14 plugin crashed! (Proxmox 8.0.4 latest update) #863](https://github.com/Telmate/terraform-provider-proxmox/issues/863) :cry: I attempted to resolve the issue using other providers recommended by the community, but I had no luck with any of them. In the end, I opted for Proxmox version 7.4, which doesn't present significant issues with the Terraform Telmate provider. @@ -162,6 +163,8 @@ The architecture we aim to achieve looks like this ![architecture](../img/18/architecture.png) +This configuration may change in the future. I would like to deprecate the creation of nodes done via Terraform for Kubernetes clusters in favor of Cluster API. However, at the moment, I have not been able to set up a fully functional cluster using the two Cluster API providers for Proxmox that I have found + ### 5.2 Remote state on S3 and locking with DynamoDB For this project, I will be working alone, but I still want to simulate an environment as close as possible to what I would set up if the infrastructure were critical, especially when the cost of doing so is very close to free. @@ -308,6 +311,8 @@ In Proxmox, we will have our beautiful virtual machines. ![proxmox-panel](../img/18/proxmox-panel.png) +The creation of these resources will change in the future, and everything will be managed by a pipeline. I am following the philosophy of 'make it work, then make it beautiful' :heart: + ## 6 Cost @@ -345,7 +350,7 @@ To calculate daily consumption, we multiply the obtained value by the number of In a month, we consume -0,389 KWh * 30 giorni = 11,67 KWh +0,389 KWh * 30 days = 11,67 KWh The cost of 1 KWh on my utility bill is 0.194 euros, so the monthly cost of the mini PC in terms of power consumption is approximately 2.26 euros. @@ -385,9 +390,9 @@ If these were your first steps with Proxmox, I hope the article was comprehensiv ## 8 Useful Links -- [Trusted certificates via Let’s Encrypt (ACME)](https://pve.proxmox.com/wiki/Certificate_Management) +- [Proxmox: Trusted certificates via Let’s Encrypt (ACME)](https://pve.proxmox.com/wiki/Certificate_Management) -- [Create a template in Promox](https://www.youtube.com/watch?v=MJgIm03Jxdo] +- [Create a template in Promox](https://www.youtube.com/watch?v=MJgIm03Jxdo) - [Mini PC Specs](https://support.hp.com/it-it/document/c06119996)