GeekCoding101

  • Home
  • GenAI
    • Daily AI Insights
    • Machine Learning
    • Transformer
    • Azure AI
  • DevOps
    • Kubernetes
    • Terraform
  • Technology
    • Cybersecurity
    • System Design
    • Coding Notes
  • About
  • Contact
rocky linux
Kubernetes

Ultimate Kubernetes Tutorial Part 3: A Streamlined Kubernetes cluster setup

Introduction Welcome back to the Kubernetes tutorial series! Now that our base image and local server are ready, it’s time for the real action—Kubernetes cluster setup with Flannel. I'll spin up one Kubernetes master and 4 worker nodes, forming a local Kubernetes cluster that’s ready for real workloads. No more theory—let’s build something real! 🚀 Clone baseimage to k8s-1 as The Kubernetes VM Base Image Before jump on our Kubernetes cluster setup, let's start from my Mac's terminal, clone from Base Image - Rocky 9 as k8s-base: ❯ vmrun clone /Users/geekcoding101.com/Virtual\ Machines.localized/baseimage-rocky9.vmwarevm/baseimage-rocky9.vmx /Users/geekcoding101.com/Virtual\ Machines.localized/k8s-1.vmwarevm/k8s-1.vmx full ❯ sed -i '' 's/displayName = "Clone of baseimage-rocky9"/displayName = "k8s-1"/' "/Users/geekcoding101.com/Virtual Machines.localized/k8s-1.vmwarevm/k8s-1.vmx" Make sure you've stopped the baseimage VM, start the k8s-base VM. The steps here I've mentioned details in Part 2, in short, after above command, we need to rescan in VMFusion and SSH as root into the k8s-base using the IP172.16.211.3 of the base VM, preapre the input file /opt/share_tools/init_data/k8s-1_vm_input.json: { "hostname": "k8s-1", "ip": "172.16.8.11", "subnet": "24", "gateway": "172.16.211.2", "dns1": "172.16.211.100", "dns2": "8.8.8.8", "domain": "dev.geekcoding101local.com", "ansible_key_path": "~/.ssh/ansible_ed25519", "ssh_key_path": "~/.ssh/ssh_ed25519" } Then using VMFusion console to login into the VM, perform below command to generate SSH keys and setup networking: ansible-playbook /opt/share_tools/bin/configure_vm.yml -e "input_file_path=/opt/share_tools/init_data/k8s-1_vm_input.json" Now I can connect from SSH passwordlessly via the new IP 172.16.8.11. Test DNS Please note here is testing our local DNS server to ensure it's working in our Kubernetes cluster setup. But it's not going to replace CoreDNS... Anyway, ensure the DNS server localserver(172.16.211.100) we setup in Part 2 is running. Ensure the 172.16.211.100 is on top of  /etc/resolv.conf , should…

March 9, 2025 0comments 246hotness 0likes Geekcoding101 Read all
Kubernetes

Ultimate Kubernetes Tutorial Part 2: DNS server and NTP server Configuration

Introduction Hey there! Ready to take this Kubernetes setup to the next level? 🚀 In Part 1, we got our base VM image up and running—nice work! Now, in Part 2, I am going to clone that image to set up a local server as a DNS server and NTP server. I was considering to incorporate the steps to setup Kubernetes master and worker nodes, but seems too much. Anyway, a real cluster is coming soon! 😎 Excited? Let’s dive in and make some magic happen. 🔥 Create localserver VM Clone from Base Image Rocky 9 vmrun clone /Users/geekcoding101.com/Virtual\ Machines.localized/baseimage-rocky9.vmwarevm/baseimage-rocky9.vmx /Users/geekcoding101.com/Virtual\ Machines.localized/localserver.vmwarevm/localserver.vmx full sed -i '' 's/displayName = "Clone of baseimage-rocky9"/displayName = "localserver"/' "/Users/geekcoding101.com/Virtual Machines.localized/localserver.vmwarevm/localserver.vmx" cat "/Users/geekcoding101.com/Virtual Machines.localized/localserver.vmwarevm/localserver.vmx" | grep disp Above commands is to clone the base VM image (display name in VMFusion is Clone of baseimage-rocky9) as a new one, then update the display name of the new VM to localserver instead of Clone of baseimage-rocky9. Now, you probably need to run a scan in VMware Fusion to see the newly added VM: Customize the Local Server VM First, stop the baseimage VM and start the localserver VM to avoid network conflict. Now we can SSH as root into the localserver VM by using the IP172.16.211.3 of the base VM. Remember the script /opt/share_tools/bin/configure_vm.yml we created in Ultimate Kubernetes Tutorial - Setting Up a Thriving Multi-Node Cluster on Mac: Part 1. Let's preapre the input file /opt/share_tools/init_data/localserver_vm_input.json: { "hostname": "localserver", "ip": "172.16.211.100", "subnet": "24", "gateway": "172.16.211.2", "dns1": "8.8.8.8", "dns2": "8.8.4.4", "domain": "dev.geekcoding101local.com", "ansible_key_path": "~/.ssh/ansible_ed25519", "ssh_key_path": "~/.ssh/ssh_ed25519" } I…

March 3, 2025 0comments 134hotness 0likes Geekcoding101 Read all
Newest Hotest Random
Newest Hotest Random
A 12 Factor Crash Course in Python: Build Clean, Scalable FastAPI Apps the Right Way Golang Range Loop Reference - Why Your Loop Keeps Giving You the Same Pointer (and How to Fix It) Terraform Associate Exam: A Powerful Guide about How to Prepare It Terraform Meta Arguments Unlocked: Practical Patterns for Clean Infrastructure Code Mastering Terraform with AWS Guide Part 1: Launch Real AWS Infrastructure with VPC, IAM and EC2 ExternalName and LoadBalancer - Ultimate Kubernetes Tutorial Part 5
Mastering Terraform with AWS Guide Part 1: Launch Real AWS Infrastructure with VPC, IAM and EC2Terraform Meta Arguments Unlocked: Practical Patterns for Clean Infrastructure CodeTerraform Associate Exam: A Powerful Guide about How to Prepare ItGolang Range Loop Reference - Why Your Loop Keeps Giving You the Same Pointer (and How to Fix It)A 12 Factor Crash Course in Python: Build Clean, Scalable FastAPI Apps the Right Way
Finished Machine Learning for Absolute Beginners - Level 1 Supervised Machine Learning – Day 6 Git Notes Empower Your AI Journey: Foundation Models Explained Ultimate Kubernetes Tutorial Part 3: A Streamlined Kubernetes cluster setup Terraform Meta Arguments Unlocked: Practical Patterns for Clean Infrastructure Code
Newest comment
Tag aggregation
Daily.AI.Insight notes AI Machine Learning Transformer Supervised Machine Learning security cybersecurity

COPYRIGHT © 2024 GeekCoding101. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang