Skip to main content

Posts

Showing posts with the label Kubernetes

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...

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 kubectl on Ubuntu localhost using Ansible Playbook

Install kubectl on Ubuntu localhost using Ansible Playbook --- - hosts: localhost tasks: - name: Installing Kubectl step-1 package: name: apt-transport-https state: present when: ansible_facts['os_family'] == "Debian" - name: Installing Kubectl step-2 shell: sudo curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - when: ansible_facts['os_family'] == "Debian" - name: Installing Kubectl step-3 command: sudo echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee -a /etc/apt/sources.list.d/kubernetes.list when: ansible_facts['os_family'] == "Debian" - name: Installing Kubectl step-4 snap: name: kubectl classic: yes when: ansible_facts['os_family'] == "Debian" - name: Ins...

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...

How to create Service type LoadBalancer with private ip address from assigned vnet-subnet

Use-case - To expose the service within virtual network as Internal LoadBalancer By default, when we create service type LoadBalancer without customized annotations in AKS(Azure Kubernetes Service), then AKS will create Load Balancer with Public IP attached to it, through which application can be accessible to internet world. However, it is possible that we may need to create service to be exposed within virtual network only, however with service type Load Balancer. For this, we need to add service.beta.kubernetes.io/azure-load-balancer-internal: "true" in annotations in kubernetes service manifest file. Create an Internal LoadBalancer apiVersion: v1 kind: Service metadata: name: nameOfService annotations: service.beta.kubernetes.io/azure-load-balancer-internal: "true" spec: type: LoadBalancer ports: - port: 8080 targe...