Skip to content

Instantly share code, notes, and snippets.

View hvks1509's full-sized avatar
💭
I may be slow to respond.

Harshvardhan Kumar Singh hvks1509

💭
I may be slow to respond.
  • Bengaluru
  • 04:44 (UTC +05:30)
  • LinkedIn in/hvks
View GitHub Profile
@hvks1509
hvks1509 / kubeadm_ubuntu.sh
Created December 7, 2024 19:02 — forked from Flagro/kubeadm_ubuntu.sh
Single Node Kubernetes (K8s) v1.29 Cluster Installation on Ubuntu 22.04 LTS
# Installation of kubeadm cluster on Ubuntu 22.04 that I personally use on my ubuntu VPS machines to deploy pods via github actions
# 1. Disable swap:
sudo swapoff -a
sudo sed -i '/ swap / s/^\(.*\)$/#\1/g' /etc/fstab
# 2. Test the ports:
# On the server: nc -l 6443
# On the local machine: nc x.x.x.x 6443
@hvks1509
hvks1509 / HOWTO-setup-rancher-on-the-cheap.md
Created December 7, 2024 19:01 — forked from onpaws/HOWTO-setup-rancher-on-the-cheap.md
Easily set up a single node Kubernetes+Rancher instance for fun

Kubernetes and Rancher Adventures...on the cheap

TL, DR: a guide to setup k8s clusters quickly and cheaply, optionally with Rancher for easy GUI-based admin and role management.

I wanted to learn more about k8s but didn't particularly want to commit to paying substantial $ for hosting a 'normal' Kubernetes cluster somewhere. I wanted to stick to the lowest possible budget, but still have real k8s running on a server somewhere.

This doc explains how I did that. It happens to go into Rancher but it could be any cloud native app. Intended for my own learning purposes and edification. If things go well, I might stand up some real apps with external users one day.

Cheap unmanaged k8s option

Hetzner offers 'just compute' at pretty competitive prices. While you don't get managed Kubernetes, if you're early in your k8s journey, it may be in your interest from a lowest possible cost perspective. Consider e.g. k3s_hetzner

@hvks1509
hvks1509 / list_k8s_services.py
Created September 5, 2024 16:17 — forked from initcron/list_k8s_services.py
Show the CoreDNS Service Entries in Tabular Format
from kubernetes import client, config
from prettytable import PrettyTable
# Load kube config from the default location (~/.kube/config)
config.load_kube_config()
# Initialize the Kubernetes API client
v1 = client.CoreV1Api()
# Create a table for displaying the output