Skip to content

Instantly share code, notes, and snippets.

View vishnuhd's full-sized avatar
🎯
Focusing

Vishnu Hari Dadhich vishnuhd

🎯
Focusing
View GitHub Profile
Questions are not from any actual exam!!!
Q: Create a secret that has the following username password data:
username=missawesome
password=123kube321
Create a pod running nginx that has access to those data items in a volume mount path at /tmp/secret-volume
log into the nginx pod you created and list the items and cat the output of the data items to a file "credentials.txt"
@vishnuhd
vishnuhd / vimtutor
Created April 4, 2020 10:57
vimtutor lesson summaries
Lesson 1 SUMMARY
1. The cursor is moved using either the arrow keys or the hjkl keys.
h (left) j (down) k (up) l (right)
2. To start Vim from the shell prompt type: vim FILENAME <ENTER>
3. To exit Vim type: <ESC> :q! <ENTER> to trash all changes.
OR type: <ESC> :wq <ENTER> to save the changes.
@vishnuhd
vishnuhd / command.md
Created December 25, 2019 13:28
Debug pod to be used for debugging issues in kubernetes

kubectl run curl-debug -n monitoring --generator=run-pod/v1 --image=radial/busyboxplus:curl -i --tty --rm

@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
@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 / 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 / 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 / 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 / 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 / .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"