Skip to content

Instantly share code, notes, and snippets.

View sanudatta11's full-sized avatar
🏠
Working from home

Soumyajit Dutta sanudatta11

🏠
Working from home
View GitHub Profile
@sanudatta11
sanudatta11 / Kubernetes.md
Created May 22, 2019 05:32
You have three nodes/instances, in which you must install the components necessary to build a running Kubernetes cluster. Once the cluster has been built verify all nodes are in the ready status, you need to start testing deployments, pods, services, and port forwarding, as well as executing commands from a pod. You need to perform the following…

Kubernetes Bare Installation and Sample Deployment

Get the Docker gpg, and add it to your repository.

Run the following commands to get the Docker gpg key and add it to your repository:

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"

@sanudatta11
sanudatta11 / chef-server.md
Created May 30, 2019 09:53
Chef Server installation

Documentation For This Video Chef Server Download Chef Server Installation Documentation Chef Manage Creating the Chef Server For this course, we’re going to use the most recent stable release of chef server (which is 12.17.331). Our first step is going to be creating a CentOS 7 cloud server to be used as our Chef server. After that server is running, we need to get the download link for a Redhat 64bit system from the downloads page (here’s the exact link used in this video). Let’s use curl to copy this onto our server so that we can install it. Since we’ll need to run virtually all of these commands using sudo we’ll switch to root at the start:

$ sudo su - [root] $ cd /tmp [root] $ curl -O https://packages.chef.io/files/stable/chef-server/12.17.33/el/7/chef-server-core-12.17.33-1.el7.x86_64.rpm

@sanudatta11
sanudatta11 / kubernetes-ec2-deploy.md
Created June 7, 2019 06:41
Basic Kubernetes Cluster Deployment in 3 EC2 Instances

Install Docker on all three nodes.

Do the following on all three nodes:

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"
AWSTemplateFormatVersion: 2010-09-09
Description: "This is the first CF Template for running Rundeck via UserData!"
Parameters:
NameOfService:
Description: "The name of the service this stack is to be used for."
Type: String
KeyName:
Description: Name of an existing EC2 KeyPair to enable SSH access into the server
Type: AWS::EC2::KeyPair::KeyName
Resources:
AWSTemplateFormatVersion: 2010-09-09
Description: "This is the third CF Template for running Rundeck via UserData with ALB and Autoscale!"
Parameters:
KeyName:
Description: Name of an existing EC2 KeyPair to enable SSH access into the server
Type: AWS::EC2::KeyPair::KeyName
DatabaseName:
Type: String
Default: rundeck
DatabaseUser:
AWSTemplateFormatVersion: 2010-09-09
Description: "This is the first CF Template for running Rundeck via UserData!"
Parameters:
NameOfService:
Description: "The name of the service this stack is to be used for."
Type: String
KeyName:
Description: Name of an existing EC2 KeyPair to enable SSH access into the server
Type: AWS::EC2::KeyPair::KeyName
DatabaseName:
#loglevel.default is the default log level for jobs: ERROR,WARN,INFO,VERBOSE,DEBUG
loglevel.default=INFO
rdeck.base=/rundeckFiles/
#rss.enabled if set to true enables RSS feeds that are public (non-authenticated)
rss.enabled=false
server.address=DNS_REPLACE
grails.serverURL=DNS_REPLACE
dataSource.dbCreate = update
dataSource.url = jdbc:driver://RDS_HOSTNAME:3306/RDS_DBNAME?user=RDS_USERNAME&password=RDS_PASSWORD;MVCC=true
@sanudatta11
sanudatta11 / EFS Mount on Reboot
Created July 1, 2019 06:21
Auto Remount on Reboot EFS
#!/bin/bash
# mount EFS volume
# https://docs.aws.amazon.com/efs/latest/ug/gs-step-three-connect-to-ec2-instance.html
# create a directory to mount our efs volume to
"sudo mkdir -p /mnt/efs",
# mount the efs volume
"sudo mount -t nfs4 -o nfsvers=4.1 ${aws_efs_mount_target.efs-mount-target.dns_name}:/ /mnt/efs",
# create fstab entry to ensure automount on reboots
# https://docs.aws.amazon.com/efs/latest/ug/mount-fs-auto-mount-onreboot.html#mount-fs-auto-mount-on-creation
"sudo su -c \"echo '${aws_efs_mount_target.efs-mount-target.dns_name}:/ /mnt/efs nfs defaults,vers=4.1 0 0' >> /etc/fstab\"" #create fstab entry to ensure automount on reboots
{
"min": $input.params('min');
"max": $input.params('max');
}
@sanudatta11
sanudatta11 / gist-elasticsearch-resp.json
Last active July 11, 2019 05:37
Medium Publication ElasticSearch Response
{
"name" : "elasticsearch",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "W_Ky1DL3QL2vgu3sdafyag",
"version" : {
"number" : "7.2.0",
"build_flavor" : "default",
"build_type" : "deb",
"build_hash" : "508c38a",
"build_date" : "2019-06-20T15:54:18.811730Z",