Skip to content

Instantly share code, notes, and snippets.

View yogendra's full-sized avatar

Yogendra Rampuria - Yogi yogendra

View GitHub Profile
@yogendra
yogendra / local-storage-yb-master.yaml
Last active November 20, 2023 13:37
K8s Local PV Sample
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: local-storage-yb-master
provisioner: kubernetes.io/no-provisioner
volumeBindingMode: WaitForFirstConsumer
sudo yum install -qy https://s3.us-west-2.amazonaws.com/downloads.yugabyte.com/repos/reporpms/yb-yum-repo-1.1-0.noarch.rpm
sudo yum install -qy https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
sudo yum install -qy pgdg-redhat-repo oracle-instant-clients-repo
sudo dnf -qy module disable postgresql
sudo yum install -qy --downloadonly --downloaddir=yb-voyager/ perl-open.noarch
sudo yum install -qy --downloadonly --downloaddir=yb-voyager/ yb-voyager
tar -czvf yb-voyager-centos8-airgapped.tgz
@yogendra
yogendra / Sea-x10.vcf
Last active September 21, 2022 05:17
Vcards
BEGIN:VCARD
VERSION:2.1
N:Limpanichsakul;Natta;;;
FN:Natta Limpanichsakul
X-ANDROID-CUSTOM:vnd.android.cursor.item/nickname;Sea;1;;;;;;;;;;;;;
TEL;CELL:+66950368179
TEL;WORK:+6626931989
EMAIL;HOME:natta.l@extend-it-resource.com
ADR;HOME:;;;Bangkok;;;Thailand
ORG:X10-IT
@yogendra
yogendra / 9xs2-f89t.sql
Last active June 13, 2022 12:44
Sample SQL Datasets
-- Source Website: https://data.cityofchicago.org/Education/Chicago-Public-Schools-Progress-Report-Cards-2011-/9xs2-f89t
-- Source CSV: https://data.cityofchicago.org/api/views/9xs2-f89t/rows.csv
-- Coverted with https://sqlizer.io with minor tweaks (table name and couple of column names changed)
DROP TABLE IF EXISTS schools;
CREATE TABLE schools
(
"School ID" int8,
"Name of School" text,
"Elementary, Middle, or High School" varchar(2),
"Street Address" varchar(100),
@yogendra
yogendra / base-ubuntu-minimal.sh
Last active November 19, 2021 16:17
Vagrant Hacks
echo "vagrant ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/vagrant
sed -i "s/^#UseDNS no/UseDNS no/g" /etc/ssh/sshd_config
curl -L https://raw.githubusercontent.com/hashicorp/vagrant/main/keys/vagrant.pub >> ~/.ssh/authorized_keys
apt update
apt install open-vm-tools -qqy
curl https://raw.githubusercontent.com/boxcutter/ubuntu/master/script/cleanup.sh | bash
@yogendra
yogendra / README.md
Last active March 11, 2024 19:44
Run a Docker Registry with TLS

Run Docker Registry with TLS

There are many instances that I need to do this. Especially if I am installing K8s in an internet restricted environment (example: [Install TKG in Internet restricted env][install-tkg-internet-restricted])

So I like to use [docker registry][docker-registry] and [mkcert][mkcert] to play with this scenario

  1. Create directories for certs and data

    mkdir -p data certs
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
k8s-app: metrics-server
name: metrics-server
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
@yogendra
yogendra / README.md
Last active February 17, 2021 12:18 — forked from rhardt-pivotal/node-ca-updater-daemonset.yaml
add a trusted CA to all the worker nodes in a TKG cluster

Kubernetes - Private Registry

When you use your own custom private registry, you may end up using your own private CA signed or self signed certificates. This will cause container runtime to complain about untrusted cert, etc.

Here is a simple code that can fix this for you.

kubectl apply -f https://gist.github.com/yogendra/9937ead35a4ceb6f58ab5c4dc181cec3/node-ca-updater-daemons.yaml
@yogendra
yogendra / 1.README.md
Last active May 23, 2021 09:34
K8s Tools

Simple Ingress + TLS setup

  1. Update /etc/hosts to point web.corp.local to your ingress IP

    sudo echo "10.40.14.36 web.corp.local" >> /etc/hosts
    
  2. Create certs

    1. Create certificates
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allow-apps-egress-ent-svc
spec:
podSelector: {}
policyTypes:
- Egress
egress:
- to: