Wednesday, October 30, 2019

How do I convert a .pem file into a .ppk, and vice versa

Step 1: Check for "puttygen" version
Step 2: update the "apt" package
Step 3: Now install the "puttygen" tools by typing the below command
Step 4: Again check the "puttygen" tools version 

Steps to Convert the ".ppk" to ".pem"

sudo puttygen ppkkey.ppk -O private-openssh -o pemkey.pem

-O (Capital Letter O) private-openssh
-o (Small Letter o) pemkey.pem

Open the terminal from "ubuntu-aws.ppk" file container folder



Now, verify the connection with aws-ec2 instance using converted "ubuntu-aws.pem" by typing the below command

ssh -i </path/of/your/pemfile.pem> <username@host> and type [yes] to establish the connection

Eg: ssh -i /.ssh/ubuntu-aws.pem ubuntu@ec2-18-221-121-111.east2-amazonaws.com and press [Enter]

and type [Yes] to establish the connection




Unix or Linux - convert a .pem file to a .ppk file
On the instance shell, run the puttygen command to convert your .pem file to a .ppk file:
sudo puttygen pemKey.pem -o ppkKey.ppk -O private

Integrate Jenkins with Slack and Notifying to Slack channel

follow the link create a Slack account: Create a Slack account

1. Select Channel and click on "Settings" and click on "Add an app"

2. Type "Jenkins CI " in the search field and click on the [Install] button.
3. Click on [Add to slack] button as shown in the below image
4.  Select the "Channel" name from the dropdown list and click on the [Add Jenkins CI Integration] button 


=================================================================================
Setup Instructions
Here are the steps necessary to add the Jenkins CI integration.
Note: These instructions are for v2.8. To install an older version, go down to Previous Setup Instructions
=================================================================================

Step 1


In your Jenkins dashboard, click on Manage Jenkins from the left navigation.

Step 2


Click on Manage Plugins and search for Slack Notification in the Available tab. Click the checkbox and install the plugin.



Step 3
After it's installed, click on "Job Name" again click on "Configure"  

Step 4: Then you'll need to add Slack Notifications to the Post-build Actions for this project.

Step 5: After adding  "Slack Notifications", Click on [Advanced ] button to add the more information


Step 6: Click on [Add] and select "Jenkins". 
Step 7: Select the "Secret Text" option from the list and provide the name in the ID field as shown in the below image


Step 71: Once the above step is done, then select the "ID name" from the list  & Then provide the Channel Name or Member id in the Channel /Member id field


Step 8:  Click on [Test Connection]  and verify the connection status as "success" and also it should notify to the slack channel like in the below image



We are done with setting up the Jenkins integration with slack channel notification
Run the Jenkins job and check the results in slack channel






Sunday, October 27, 2019

How to Create Slack account

Integration Jenkins with slack
First, we need to configure slack on our machine.
1. Create a slack account: https://slack.com/

2. Enter the Registered email id and press the  "Try For Free" button and you will receive [6] digit OTP number to your email
3. Select [My Team is on Slack] if you are already a part of the member. 
     Select [We`re not using Slack Yet] if you are a new user to Slack 

4. Enter the OTP from Registered mail 

5.  Enter the Name of the team name of the company name and click on [Next]

6. Enter the Project name and click on [Next]
7. Provide the team members email id`s or just click on [skip for now] link  
8. Click on the Dropdown list and select the "IT" field or your field from the list and click on [Continue]
9. Select the "Tools" from the listed and click on [Continue] it will navigate to  slack channel
10. you will see the  [Finish up] button on the slack channel follow the 3 steps by providing your details.



Saturday, October 26, 2019

Docker Commands usage and Working with Docker images





1. docker --version
   Usage: docker --version 
   This command is used to get the currently installed version of docker.
   


2. docker pull 
  Usage: docker pull <image name>
  Eg: docker pull ubuntu 
 This command is used to pull an image or a repository from the docker registry (hub.docker.com)



3. docker run 
    Usage: docker run -it -d <image name>
    Eg: docker run -it -d ubuntu

  -i: -- interactive = keep STDIN open even if  not attached
  -t: --tty = Allocate a pseudo-TTY
  -d: --detach = Run container in background and print container ID
  This command is used to create a container from an Image 


4. docker ps
   Usage: docker ps 
   This command is used to display the running containers    
 

5. docker ps -a
    Usage: docker ps -a 
     -a: --all = show all containers
    This command is used to show all running and exited containers




6. docker ps -l
     Usage: docker ps -l
     -l: --latest = show the latest created container (includes all states like exited/ running)
     This command is used to show the latest created container 


7.  docker exec 
    Usage: docker exec -it <container id> bash
     Eg: docker exec -it 29c10a7bf2ea bash

  -i: -- interactive = keep STDIN open even if  not attached

  -t: --tty = Allocate a pseudo-TTY



8. docker stop
     If we want to stop all the running containers at a time, then use the below command
     Method 1:
   Usage: docker container stop $(docker container ls -aq)



     Method 2: 
Usage: docker stop <container id>

      Eg: docker stop 29c10a7bf2ea 
    This command is used to stop one or more running containers


9. docker commit
     Usage: docker commit <container id>  <username/imagename>
     Eg: docker commit 29c10a7bf2ea krishnadasari610/ubuntu

This command is used to create new image of an edited container on the local system
Once we create a new image


10 docker login
     Usage: docker login
     1. If you are already logged into your docker hub account you will get the output like in the below image
  2. If you are login for the first time, you will get the Username and then the password like in the below image provide the necessary details 

11. docker logout
      Usage: docker logout
      This command is used to logout from the docker hub repository     


   
12. docker push
       Usage: docker push <username/ image name/id> 
  This command is used to push an image to the docker hub repository
   
    Check in the Docker hub repository whether the same repository is available or not. 
    Login required : https://hub.docker.com/?ref=login


13. docker images
      Usage: docker images
       This command will list all the locally stored images



14. docker rm
      If we want to remove all the stopped containers, then we can use the below command 
   Usage:docker rm $(docker ps -a -q)   
    
     
 Usage: docker rm <container id>
       This command is used to delete a stopped container

   1. If the container id is stopped then its status should be "Exited"
   

2. Remove the container and check the containers list 


15 docker rmi 
     Method 1: 
      Usage: docker rmi <Image Name / Image ID>

     This command is used to delete one or more images from the local storage

Method 2: Remove the all locally stored images 
Usage: docker rmi $(docker image -a -q )

16. docker build
      Usage: docker build </path/to/docker file> 
       Eg: docker build .
       This command is used to build an image from a specified docker file.
        Note: Open the terminal from the docker file location
        







How to install and setup Kubernetes cluster using kOps in AWS environment

  Kops: Kops is also known as Kubernetes Operations, it is an open-source project which helps you to create, upgrade, destroy, and maintain ...