Skip to content

Instantly share code, notes, and snippets.

View vishnuhd's full-sized avatar
🎯
Focusing

Vishnu Hari Dadhich vishnuhd

🎯
Focusing
View GitHub Profile
@vishnuhd
vishnuhd / KOPS-KubeCluster.md
Last active September 3, 2019 13:03
Managing kubernetes cluster with KOPS

Managing kubernetes cluster with KOPS

Prerequisite

  • kops
  • kubectl
  • awscli configured

Create the kops cluster

  • For cluster creating we need to add more env variables. NAME will be the name of the cluster, since we wont do DNS settings we will use gossip based DNS and for that cluster name needs to end with .k8s.local and before that you can put almost anything.
@vishnuhd
vishnuhd / jenkinsk8shelm.md
Last active September 8, 2019 20:24
Deploy Jenkins to K8s using Helm
@vishnuhd
vishnuhd / killmysqlprocess.md
Created September 6, 2019 09:50
How to kill a stuck MySql Process

To kill a stuck MySql Process

Find the ID :

# mysqladmin processlist -hmysql-service -uroot -proot_password

Kill the process :

@vishnuhd
vishnuhd / .zshrc
Created September 13, 2019 09:28
kubectl aliases
alias k="kubectl"
alias kc="kubectl create -f"
alias kaf="kubectl apply -f"
alias kdf="kubectl delete -f"
alias kg="kubectl get"
alias pods="kubectl get pods"
alias allpods="kubectl get pods --all-namespaces"
alias rcs="kubectl get rc"
alias pvs="kubectl get pv"
alias allpvs="kubectl get pv --all-namespaces"
@vishnuhd
vishnuhd / nginx-deploy-svc-kube.yml
Last active June 27, 2020 20:04
Nginx sample kubernetes deployment and service
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-nginx
labels:
app: nginx
spec:
selector:
matchLabels:
@vishnuhd
vishnuhd / nginx-ingress.md
Last active September 18, 2019 06:31
Nginx Ingress | Docker for Mac

Nginx Ingress | Docker for Mac

  • The following Mandatory Command is required for all deployments
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/mandatory.yaml
  • Docker for Mac Kubernetes is available in Docker for Mac (from version 18.06.0-ce)

Create a service

@vishnuhd
vishnuhd / adfs-aws-win2016.md
Last active October 9, 2019 05:27
Setting Up ADFS on AWS Windows Server 2016 instance

Setting Up ADFS on AWS Windows Server 2016 instance

  • Create an Windows Server 2016 instance with t3.medium atleast, 30 GB storage and ports - 80, 22, 53, 389, 3389, 443, 3268 open.

  • Install AD Domain Services, AD Federation Services and DotNet 3.5.

  • Promote current server as Domain Controller.

  • Setup IIS for https binding with self-signed certificate.

@vishnuhd
vishnuhd / install-docker-ubuntu.md
Last active October 21, 2019 07:07
Install Docker in Ubuntu 18.04

There are two versions of Docker – Docker CE (Community Edition) and Docker EE (Enterprise Edition). If you have a small-scale project, or you’re just learning, you’ll want to use Docker CE.

In this gist, we will cover how to install Docker on Ubuntu 18.04.

Prerequisites

  • Ubuntu 18.04 64-bit operating system
  • A user account with sudo privileges
  • Command line / terminal (CTRL-ALT-T or Applications menu > Accessories > Terminal)
  • Docker software repositories (optional)
@vishnuhd
vishnuhd / ram-eaters.sh
Created October 21, 2019 19:10
WTF is eating my RAM
#!/bin/bash
# WTF is eating my RAM
ps aux | awk '{print $6/1024 "MB\t\t" $11}' | sort -rn | head -10
@vishnuhd
vishnuhd / pod.yaml
Last active December 20, 2019 14:07
Test pod to quickly test scenarios
apiVersion: v1
kind: Pod
metadata:
name: nginx
labels:
env: test
spec:
containers:
- name: nginx
image: nginx