microservices project
microservices project
unzip awscliv2.zip
sudo ./aws/install
The aws configure command sets up AWS CLI by saving your access key, secret key, default region,
and output format. It helps the CLI authenticate and interact with AWS services.
aws configure
• Install Kubectl
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
chmod +x kubectl
kubectl version
• Install EKSCTL
https://eksctl.io/installation/
curl --silent --location "https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_$(uname -
s)_amd64.tar.gz" | tar xz -C /tmp
eksctl version
--region=ap-south-1 \
--zones=ap-south-1a,ap-south-1b \
--without-nodegroup
Create a OIDC:
--region ap-south-1 \
--cluster praveen-EKS-1 \
--approve
OIDC (OpenID Connect) is an authentication protocol that allows secure identity
verification between applications and identity providers.
In AWS EKS, OIDC is used to link Kubernetes service accounts with AWS IAM roles,
enabling fine-grained access control for AWS resources without using long-lived credentials.
--region=ap-south-1 \
--name=node2 \
--node-type=t3.medium \
--nodes=3 \
--nodes-min=2 \
--nodes-max=4 \
--node-volume-size=20 \
--ssh-access \
--ssh-public-key=NEWKEYPAIR \
--managed \
--asg-access \
--external-dns-access \
--full-ecr-access \
--appmesh-access \
--alb-ingress-access
This command adds a new group of worker nodes (node2) to your EKS cluster (praveen-
EKS-1) in the ap-south-1 (Mumbai) region.
Key points:
Purpose:
This ensures your EKS cluster has enough worker nodes to run your applications efficiently,
with scalability and necessary AWS service access.
SET-UP JENKINS:
https://www.jenkins.io/doc/book/installing/linux/#debianubuntu
Public_IP: 8080
Install Docker:
SET-UP ARGOCD:
Install Argocd:
kubectl create namespace argocd
Username: admin
Password:
To log in, use the default admin credentials. Get the password with:
http://13.127.148.184:8080/multibranch-webhook-trigger/invoke?token=praveen
6. Click Save.
CI Part is done.
• Provide the Github url Where Deployment and Service file available.
• Branch Name: main
. (dot) refers to the root directory of the Git repository where your Kubernetes manifests
are stored.
• App Deployed on EKS Cluster Using argocd.
• Access the App using LoadBalancer.
The previous deployment was ArgoCD-based.
To Use a Service account for Deployment we need to create a token for authentication:
Create a service account ,role ,role binding and Secret add secret to the Jenkins credintails
that secret helps to communicate with jenkins
apiVersion: v1
kind: ServiceAccount
metadata:
name: jenkins-sa
namespace: webapps
2. Create a Role with Required Permissions
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: app-role
namespace: webapps
rules:
- apiGroups:
- ""
- apps
- autoscaling
- batch
- extensions
- policy
- rbac.authorization.k8s.io
resources:
- pods
- componentstatuses
- configmaps
- daemonsets
- deployments
- events
- endpoints
- horizontalpodautoscalers
- ingress
- jobs
- limitranges
- namespaces
- nodes
- pods
- persistentvolumes
- persistentvolumeclaims
- resourcequotas
- replicasets
- replicationcontrollers
- serviceaccounts
- services
3.Create a RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: app-rolebinding
namespace: webapps
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: app-role
subjects:
- namespace: webapps
kind: ServiceAccount
name: jenkins
apiVersion: v1
kind: Secret
metadata:
name: jenkins-sa-token
namespace: webapps
annotations:
kubernetes.io/service-account.name: "jenkins"
type: kubernetes.io/service-account-token
7. Save.
Now, Jenkins can authenticate with the Kubernetes cluster using this secret.
************************************************************************