Skip to content

Instantly share code, notes, and snippets.

View rajivreddy's full-sized avatar
💻
Focusing

Rajiv Reddy rajivreddy

💻
Focusing
  • Work From Home
View GitHub Profile
@rajivreddy
rajivreddy / deletens.sh
Created April 1, 2025 07:04
Script to delete all the rescues in namespace
#!/bin/bash
NAMESPACE=$1
if [ -z "$NAMESPACE" ]; then
echo "Usage: $0 <namespace>"
exit 1
fi
echo "💥 Deleting all resources in namespace: $NAMESPACE"
@rajivreddy
rajivreddy / Kubernetes Auto Scaling Best Practices.md
Created February 10, 2025 04:55
Kubernetes Auto Scaling Best Practices

Resource Allocation,Scaling in Kubernetes

Namespace limits

When you decide to segregate your cluster in namespaces, you should protect against misuses in resources.

You shouldn't allow your user to use more resources than what you agreed in advance.

Cluster administrators can set constraints to limit the number of objects or amount of computing resources that are used in your project with quotas and limit ranges.

@rajivreddy
rajivreddy / ecs-task-export-import.sh
Created April 24, 2024 18:20 — forked from pahud/ecs-task-export-import.sh
ECS Task export/import
# export the task def
family='TaskDefName'
$ aws ecs describe-task-definition --task-definition $family \
--query "taskDefinition.{family:family, taskRoleArn:taskRoleArn, executionRoleArn:executionRoleArn, networkMode:networkMode, containerDefinitions:containerDefinitions, volumes:volumes, placementConstraints:placementConstraints, requiresCompatibilities:requiresCompatibilities, cpu:cpu, memory:memory, tags:tags, pidMode:pidMode, ipcMode:ipcMode, proxyConfiguration:proxyConfiguration}" | jq 'del(.[] | nulls)' > taskDef.json
# import the task def into newFamily task family
$ aws ecs register-task-definition --cli-input-json file://taskDef.json --family newFamily
# one-liner
aws ecs describe-task-definition --task-definition $family \
@rajivreddy
rajivreddy / ingress.yaml
Created March 25, 2024 17:03
kubernetes-ingress-azure-lb
---
# Source: ingress-nginx/templates/controller-serviceaccount.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
helm.sh/chart: ingress-nginx-4.10.0
app.kubernetes.io/name: ingress-nginx
app.kubernetes.io/instance: ingress-nginx
app.kubernetes.io/version: "1.10.0"
@rajivreddy
rajivreddy / kubernetes-best-pratices.md
Last active April 25, 2023 08:08
kubernetes-best-pratices

Governance

Best practices for creating, managing and administering namespaces.

Namespace limits

When you decide to segregate your cluster in namespaces, you should protect against misuses in resources.

You shouldn't allow your user to use more resources than what you agreed in advance.

@rajivreddy
rajivreddy / jq-cheetsheet.md
Created April 13, 2023 18:01 — forked from olih/jq-cheetsheet.md
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

Useful Commands

Get kubectl version

kubectl version

Get cluster info:

@rajivreddy
rajivreddy / github.sh
Created May 4, 2021 02:31 — forked from StevenACoffman/github.sh
Jenkins Scripts For Build Status to Github Pull Request
#!/bin/bash
#Jenkins provides:
#GIT_COMMIT like ce9a3c1404e8c91be604088670e93434c4253f03
#GIT_BRANCH like origin/master
#BUILD_URL like http://jenkins.test.cirrostratus.org/job/Article_View_c20n_Full_Non_Destructive_Full_Suite/1334/
# per https://wiki.jenkins-ci.org/display/JENKINS/GitHub+pull+request+builder+plugin
# The jenkins pull request builder plugin (if configured) will provide these:
#ghprbPullId
pipeline {
// run on jenkins nodes tha has java 8 label
agent { label 'java8' }
// global env variables
environment {
EMAIL_RECIPIENTS = '[email protected]'
}
stages {
stage('Build with unit testing') {
@rajivreddy
rajivreddy / Jenkinsfile
Created April 29, 2021 09:57 — forked from merikan/Jenkinsfile
Some Jenkinsfile examples
Some Jenkinsfile examples