Skip to main content

Posts

Showing posts with the label AWS

Install AWS CLI on Ubuntu localhost using Ansible Playbook

Install AWS CLI on Ubuntu localhost using Ansible Playbook --- - hosts: localhost tasks: - name: Installing Unzip package package: name: unzip state: present when: ansible_facts['os_family'] == "Debian" become: true - name: Create awscli directory in home directory file: path: ~/awscli state: directory mode: '0755' - name: Download bundled installer zip file get_url: url: https://s3.amazonaws.com/aws-cli/awscli-bundle.zip dest: ~/awscli/awscli-bundle.zip - name: Extract zip file unarchive: src: ~/awscli/awscli-bundle.zip dest: ~/awscli - name: Run install command shell: /home/ubuntu/awscli/awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws become: true Same script is also avail...

EFS Provisioning using TF

Full script is available at https://github.com/JaydeepUniverse/terraform/tree/master/aws/efs Prerequisites - Along with EFS creation we'd need to mount on subnet as well where we would going to use it, hence To get existing subnet details follow below steps Import existing subnet details by adding below code to main.tf and resource "aws_subnet" "subnet-aaa" { } resource "aws_subnet" "subnet-aaa" { } Run terraform import command - terraform import aws_subnet.subnet-aaa subnet-aaa terraform import aws_subnet.subnet-aaa subnet-aaa Then add subnet values from terraform.tfstateto main.tf else terraform will add/remove parameters accordingly for the same subnet ex. ...

Install Jenkins on AWS EKS using Helm

Prerequisites Create namespace for jenkins kubectl create ns jenkins We'll store jenkins data on AWS EBS as persistent storage hence for that Create storage class apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: jenkins-sc provisioner: kubernetes.io/aws-ebs parameters: type: gp2 fsType: ext4 Create persistent volume claim apiVersion: v1 kind: PersistentVolumeClaim metadata: name: jenkins-pvc namespace: devops-tools spec: storageClassName: jenkins-sc resources: requests: storage: 50Gi accessModes: - ReadWriteOnce ...

EKS Provisioning Using TF

Full script is available at https://github.com/JaydeepUniverse/terraform/tree/master/aws/eks Prerequisites Install kubectl Install AWS CLI Install AWS IAM Authenticator Update kubeconfig file if needed aws eks update-kubeconfig --name eksClusterName Please keep in mind about below commented notes while changing names of name,cluster,environment else EKS,ASG,VPC all resources will be created but while running kubectl get nodes command it won't show any worker nodes provider "aws" { region = "us-east-2" # region } module "vpc" { source = "../../modules/vpc" vpc-location = "Ohio" # location name as per region namespace = "nextgen-c...

Install AWS CLI on Ubuntu localhost using Ansible Playbook

Install AWS CLI on Ubuntu localhost using Ansible Playbook --- - hosts: localhost tasks: - name: Installing Unzip package package: name: unzip state: present when: ansible_facts['os_family'] == "Debian" become: true - name: Create awscli directory in home directory file: path: ~/awscli state: directory mode: '0755' - name: Download bundled installer zip file get_url: url: https://s3.amazonaws.com/aws-cli/awscli-bundle.zip dest: ~/awscli/awscli-bundle.zip - name: Extract zip file unarchive: src: ~/awscli/awscli-bundle.zip dest: ~/awscli - name: Run install command shell: /home/ubuntu/awscli/awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws become: true Same script is also avail...

Nexus installation on EKS

Create nexus namespace apiVersion: v1 kind: Namespace metadata: name: nexus Create storage class for nexus to store data on AWS EBS apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: nexus provisioner: kubernetes.io/aws-ebs parameters: type: gp2 fsType: ext4 allowVolumeExpansion: true Create persistent volume claim apiVersion: v1 kind: PersistentVolumeClaim metadata: name: nexus namespace: nexus labels: app: nexus spec: storageClassName: nexus resources: requests: storage: 50Gi accessModes: - ReadWriteOnce Create deployment for p...

Install Grafana on AWS EKS using Helm

Create namespace for Grafana kubectl create ns grafana We'll store Grafana data on AWS EBS as persistent storage, hence for that create storage class apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: grafana provisioner: kubernetes.io/aws-ebs parameters: type: gp2 fsType: ext4 allowVolumeExpansion: true Install using Helm - In this command we've set few values like namespace, service type, storageclass and its size helm install grafana stable/grafana --namespace grafana --set service.type=LoadBalancer,persistence.enabled=true,persistence.type=pvc,persistence.size=100Gi,persistence.st...

Install InfluxDB on AWS EKS using Helm

Create namespace for influxdb kubectl create ns influxdb We'll store InfluxDB data on AWS EBS as persistent storage, hence for that create storage class apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: influxdb provisioner: kubernetes.io/aws-ebs parameters: type: gp2 fsType: ext4 allowVolumeExpansion: true Install using Helm - In this command we've set few values like namespace, service type, storageclass and its size helm install influxdb stable/influxdb --namespace influxdb --set service.type=LoadBalancer,persistence.enabled=true,persistence.storageClass=influxdb,persistence.size=...

Show Jenkins Build Metrics on Grafana Using InfluxDB

Install InfluxDB - Here's the link for how to install influxdb on AWS EKS - https://devopsautomationblogs.blogspot.com/2020/04/install-influxdb-on-aws-eks-using-helm.html Configure InfluxDB for jenkins build metrics collection Go inside the influxdb pod and Run below 2 commands kubectl exec -it -n influxdb influxdbPodName /bin/bash influx # open influx database CREATE DATABASE jenkins_db # create jenkins database CREATE USER jenkins WITH PASSWORD 'admin' WITH ALL PRIVILEGES # create jenkins username Install Grafana - Here's the link for how to install influxdb on AWS EKS - https://devopsautomati...

Install Prometheus on AWS EKS using Helm

Create Namespace for Prometheus kubectl create ns prometheus Persistent Storage We'll store Prometheus data on AWS EBS as persistent storage, for that create we'll create storage class and persitent volument claim. We need to create 2 SC and PVC for 2 different component of Prometheus - Server and AlertManager. StorageClass - AlertManager apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: prometheus-alertmanager provisioner: kubernetes.io/aws-ebs parameters: type: gp2 fsType: ext4 allowVolumeExpansion: true StorageClass - Server apiVersion: storage.k8s.io/v1 kind: StorageClass metad...