Posts

Showing posts with the label deployment

Setting Up IAM Roles Anywhere instead of Access Keys in AWS

Image
Introduction Setting up IAM Roles Anywhere is the "gold standard" for bringing the power of IAM Roles to external servers (On-premises, Azure, GCP) without needing permanent, risky Access Keys. This mechanism relies on PKI (Public Key Infrastructure): You use a digital certificate to prove your identity to AWS, and in return, AWS provides you with temporary, short-lived credentials. Prerequisites Before we begin, you should have a basic understanding of IAM Identity Center and how to set up AWS Access Keys/Secrets, as this guide builds upon those concepts. Quick Recap If you have already set up a profile and logged in via SSO, you would typically use that profile in a NestJS source code like this: import { Injectable } from '@nestjs/common' import { getSignedUrl } from '@aws-sdk/s3-request-presigner' import { ConfigService } from '@nestjs/config' import {   S3Client ,   ListObjectsV2Command ,   GetObjectCommand , } from '@aws-sdk/client-s3...

Kubernetes Deployment for Zero Downtime

Image
Introduction In Kubernetes (K8s) , a Pod is the smallest resource unit used to run one or more containers during deployment. There are several ways to create a Pod : you can create it directly, use a ReplicationController , or a ReplicaSet . However, the most commonly used resource for managing Pods is the Deployment . When you use a Deployment , it actually creates a ReplicaSet to manage the Pods but comes with many additional benefits that support the deployment process. Some Advantages of Deployment : Ensures Pod Availability : It guarantees that the specified number of Pods are always running according to the configuration, automatically deploying additional Pods if any failures occur. Supports Restart and Undo Deployment : Allows you to easily restart or roll back to previous versions of your Deployment . Zero Downtime Deployment : When updating configurations or scaling Deployments , zero downtime is crucial. This means that new Pods are created while the old Pods are stil...