Posts

Showing posts with the label AWS EC2 instance

Controlling EC2 Instance from CLI: AWS automations

Image
When you start learning few commands about AWS CLI you can plan to automate the process with simple bash shell script where you can include set of aws commands into it with simple bash script controls.  How to automate AWS EC2 stop/start using aws cli? Objective of this post is to develop a simple controlling script which can use the AWS CLI commands for start-instances, describe-instances, stop-instances and adding bash scripting logic to it. First we start experiment with each aws ec2 command, then we can proceed by collecting those successful commands to form a automation script. Let's explore now. How to automate AWS EC2 instance using aws-cli How to start an AWS EC2 instance "start-instances" command To start the aws instance you need to pass the instance-id as argument. Following is the command example. aws ec2 start-instances --instance-id i-instancenumber Please change to your instance-id value replace the instancenumber with yours. Execution output looks like ...

K8s Storage NFS Server on AWS EC2 Instance

Image
Hello DevOps enthuiast, In this psot we would like to explore the options available on Kubernetes Storage and Volume configurations. Especially in AWS environment if we have provisioned the Kubernetes Cluster then how we can use the storage effectively, need to know all the options. In the sequence of learning on 'Kubernetes Storage' experimenting on the NFS server on AWS EC2 instance creation and using it as Persistent Volume. In the later part, we would use the PVC to claim the required space from the available PV. That in turn used inside the Pod as specifying a Volume.  Assumptions Assuming that you have AWS Console access to create EC2 instances.  Basic awareness of the Docker Container Volumes Understand the need for Persistency requirements Login to your aws console Go to EC2 Dashboard, click on the Launch instance button Step 1: Choose an AMI: "CentOS 7 (x86_64) - with updates HVM" Continue from Marketplace Step 2: Choose instance type: Step 3: Add stora...