-
Notifications
You must be signed in to change notification settings - Fork 2
Build and Deploy instructions
Aarti edited this page Jun 2, 2020
·
10 revisions
- Create an AWS instance. For this, go to the AWS console
- Go to EC2
- Running instances > launch instances
- In the search box, "Ubuntu Server 18.04 LTS (HVM), SS Volume Type"
- Select t2.medium (the management cluster needs to be big enough, anything smaller than this didn't work at the time of doing this). Click on Next
- Add Storage, and then go to Add tag button
- Add "key name" as Name and "cloud_test" as Value
- Click on configure security group
- Select all default security groups by clicking on all the checkboxes
- Click on launch
- From the dropdown select "Create a new pair"
- Select key pair name as "cloud_test"
- Click download key pair(use this key to ssh into the instance). Save it in ~/
- Click on launch instance.
- Finally, use the "IPv4 Public IP" to ssh into the instance.
- On the AWS console, go to EC2 instances
- For the EC2 instance that you created, copy the
IPv4 public address - on your terminal,
ssh -i <pem_file_created_above> ubuntu@<ip_adress from step2>
sudo su
curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.18.0/bin/linux/amd64/kubectl
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl
curl -Lo ./kind "https://kind.sigs.k8s.io/dl/v0.8.0/kind-$(uname)-amd64"
chmod +x ./kind
sudo mv ./kind /usr/local/bin/kind
kind version
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
apt-cache policy docker-ce
sudo apt-get install -y docker-ce
assuming you are still in your cloud instance
cd /home/ubuntu
mkdir -p /home/ubuntu/cloud/kubernetes
mkdir -p /home/ubuntu/cloud/bin
sudo su
curl -O https://dl.google.com/go/go1.14.3.linux-amd64.tar.gz
tar xvf go1.14.3.linux-amd64.tar.gz
sudo chown -R root:root ./go
sudo mv go /usr/local
export GOPATH=$HOME/work
export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin
mkdir -p $HOME/work/src
cd $HOME/work/src
You should be in $HOME/work/src directory
git clone https://github.com/AartiJivrajani/All-On-Cloud-9.git
cd All-On-Cloud-9
export GO111MODULE=on
export INSTANCE=<ip_address_of EC2 instance>
make deploy //ensure your pem file is present in ~/
ssh -i <pem_file> ubuntu@<ip_address_of_ec2_instance>
sudo su
cd /home/ubuntu/cloud
docker build -t aartij17/cloud:nats -f Dockerfile.nats --no-cache .
docker build -t aartij17/server:v1 -f Dockerfile.server --build-arg basedir=. --no-cache .
docker build -t aartij17/orderer:v1 -f Dockerfile.orderer --build-arg basedir=. --no-cache .
kind load docker-image aartij17/orderer:v1
kind load docker-image aartij17/server:v1
kind load docker-image aartij17/cloud:nats
cd kubernetes
kubectl create -f .
// now check if all the pods are running
kubectl get pods (all the pods should be in running state)