Skip to content

Instantly share code, notes, and snippets.

View yogendra's full-sized avatar

Yogendra Rampuria - Yogi yogendra

View GitHub Profile
@yogendra
yogendra / bumpme
Created July 20, 2019 14:08
Concourse Tutorial Gist
foo
@yogendra
yogendra / .vimrc
Last active May 23, 2021 09:41
Kubernetes Environment Helpers
" Install minimal vimrc using:
" wget -q https://yogendra.me/minimal-vimrc -O ~/.vimrc
let g:netrw_liststyle=3
set autoindent
set cursorcolumn
set cursorline
set expandtab
set history=50
set hlsearch
set ignorecase
@yogendra
yogendra / README.md
Last active August 21, 2023 09:24
Jenkins on Docker

Run Jenkins on Docker

(Option 1) Docker Compose way

  1. You should have docker-compose installed. If you don't have it, get it from [docker/compose][docker-compose] release page.
  2. Get the [docker-compose.yml][docker-compose.yml]
  3. Go to command line / terminal
  4. Go to directory containing docker-compose.yml. Generally it will be Downloads directory
  5. Run docker compose and dertach
    docker-compose up -d
@yogendra
yogendra / scratch
Last active April 19, 2020 07:20
Scratc
docker volume create mlab-mongo
docker container run --rm --name mlab-mongo --network-alias mlab-mongo -p 27017:27017 -v mlab-mongo-data:/data/db -d mongo
docker container run --rm --name mlab -p 5000:5000 -e VCAP_SERVICES='{"mlab": ["credentials": {"uri":"mongodb://mlab-mongo:27017/mlab"}]}' -v config.py:/usr/src/app/config.py cloudgeek007/devopspipeline:6
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allow-apps-egress-ent-svc
spec:
podSelector: {}
policyTypes:
- Egress
egress:
- to:
@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
@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
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 April 26, 2025 14:46
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
@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