Skip to content

Instantly share code, notes, and snippets.

View arnathan2k's full-sized avatar

Anand R arnathan2k

View GitHub Profile
All nodes
echo "net.bridge.bridge-nf-call-iptables=1" | sudo tee -a /etc/sysctl.conf
sudo sysctl -p
Master Node
kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/bc79dd1505b0c8681ece4de4c0d86c5cd2643275/Documentation/kube-flannel.yml
kubectl get nodes
Check if all three Flannel Pods are running
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
cat << EOF | sudo tee /etc/apt/sources.list.d/kubernetes.list
deb https://apt.kubernetes.io/ kubernetes-xenial main
EOF
sudo apt-get update
sudo apt-get install -y kubelet=1.12.2-00 kubeadm=1.12.2-00 kubectl=1.12.2-00
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
sudo apt-get update
sudo apt-get install -y docker-ce=18.06.1~ce~3-0~ubuntu
aws ec2 attach-internet-gateway --vpc-id "vpc-0e5bxxxxxxxxx" --internet-gateway-id "igw-03yyyyyyyyyy" --region us-east-2
#top of the file
sed -i '1s/^/your text\n/' file
#End of the file
sed -i "2i192.241.xx.xx venus.example.com radious" /etc/hosts
or
echo "192.241.xx.xx venus.example.com radious" >> /etc/hosts
Attach IGW to a VPC
aws ec2 attach-internet-gateway --vpc-id "vpc-f3cbfe8a" --internet-gateway-id "igw-6a631b0c" --region us-west-2
@arnathan2k
arnathan2k / gist:30c8fc5b3fda7e3e100877bdd1eef995
Last active October 6, 2022 01:56
Lambda SSM Send Command Boto3
from __future__ import print_function
import json
import boto3
import urllib.request
print('Loading function')
@arnathan2k
arnathan2k / CloudWatchEventLambda
Last active April 19, 2018 02:27
Auto Scaling Life Cycle Event processing with Lambda
//RunCommandlambda.java Source Code
package net.anandus.captureloglamda;
import com.amazonaws.services.lambda.runtime.Context;
import com.amazonaws.services.lambda.runtime.RequestHandler;
import java.util.List;
public class RunCommandLambda implements RequestHandler<Request, Response> {
/**
@arnathan2k
arnathan2k / aws-asg-from-running-instance
Last active April 18, 2018 19:48
Create AWS autoscaling Launch configuration from running instance
# creating launch config from running instance
aws autoscaling create-launch-configuration --launch-configuration-name web-demo-launch-config --instance-id i-a8exxxxxx
# Creating ASG from running instance
aws autoscaling create-auto-scaling-group --auto-scaling-group-name web-demo-asg --instance-id i-7f12e649 --min-size 1 --max-size 2 --desired-capacity 2
@arnathan2k
arnathan2k / Python-pip-aws-cli-win
Created April 18, 2018 19:31
AWS python pip install Windows
AWS - CLI Link https://docs.aws.amazon.com/cli/latest/userguide/awscli-install-windows.html
Install Python using msi
# Check python version
python -version
# Check pip version
pip -version
# install aws cli