Skip to content

Instantly share code, notes, and snippets.

# Running Jenkins In Kubernetes #
# Tutorial And Review #
# #
# Referenced videos:
# - GitHub CLI - How to manage repositories more efficiently:
# - Kaniko - Building Container Images In Kubernetes Without Docker:
# - Kustomize - How to Simplify Kubernetes Configuration Management:
hayderimran7 /
Created Dec 17, 2020 — forked from ameenkhan07/
Facebook Production Engineering Interview

What to Expect and Tips

• 45-minute systems interview, focus on responding to real world problems with an unhealthy service, such as a web server or database. The interview will start off at a high level troubleshooting a likely scenario, dig deeper to find the cause and some possible solutions for it. The goal is to probe your knowledge of systems at scale and under load, so keep in mind the challenges of the Facebook environment.
• Focus on things such as tooling, memory management and unix process lifecycle.


More specifically, linux troubleshooting and debugging. Understanding things like memory, io, cpu, shell, memory etc. would be pretty helpful. Knowing how to actually write a unix shell would also be a good idea. What tools might you use to debug something? On another note, this interview will likely push your boundaries of what you know (and how to implement it).


Interview is all about taking an ambiguous question of how you might build a system and letting

hayderimran7 /
Last active Dec 1, 2020
Automatically deploy GoDaddy External Secrets Controller for SSM/Secrets Manager in K8s with IAM role for service account
#!/bin/bash -xe
cat << EOF > policy.json
hayderimran7 /
Last active Apr 14, 2020
get IAM Role matching a name using jq and aws cli


To use aws cli, its common to invoke built-in features like --filters and --query however they aren't avaiable for all the commands.

for my use case i wanted to get a role matching a name, i.e. regex pattern . that was very easy using jq

one-liner to get Role ARN of a role macthing name

if i want to get a role matching name eksctl-dev-cluster-addon-iamserviceaccount then to get ARN of that role is simply doing

hayderimran7 /
Last active Apr 2, 2021
VPC Peering Between EKS and RDS postgres
#!/bin/bash -xe
## Create a VPC Peering connection between EKS and RDS Postgres
echo """ run this script as:
+ read -p 'Enter name of EKS Cluster: ' EKS_CLUSTER
Enter name of EKS Cluster: xolv-dev-cluster
+ EKS_VPC=eksctl-xolv-dev-cluster-cluster/VPC
+ EKS_PUBLIC_ROUTING_TABLE=eksctl-xolv-dev-cluster-cluster/PublicRouteTable
+ read -p 'Enter name of RDS: ' RDS_DB_NAME
Enter name of RDS: sfstackuat
hayderimran7 /
Last active Mar 12, 2020
aws cross account access to EKS


When you want your users in IAM to access EKS cluster in another account, its very simple to do via cross account role. This assumes you have already created the role in account B to users in account A.

steps to access EKS in second account

  1. first make sure you have a IAM role cross-account-role created in Account B and having added trusted relationship for users in that you would like to from account A to access it.
  2. Once thats done , make sure you have access to the EKS cluster in account B(this needs to be done in order to edit the permissions of EKS).
  3. now edit the aws-auth configmap of that EKS cluster as:
hayderimran7 / Traffic Routing in canary deployments using
Created Mar 9, 2020
Traffic Routing in canary deployments using nginx-ingress
View Traffic Routing in canary deployments using

Canary deployments in gitlab AutoDevops using nginx-ingress

Gitlab AutoDevops is a great feature in Gitlab which allows us to Build,Test,Deploy our apps seamlessly to Kubernetes. This tutorial will not walk over steps to configure kubernetes integration in Gitlab as its already well documented here.

AutoDevops Helm Chart setup for canary-deployments

This chart is the modified form of official auto-deploy-app that is intended to achieve traffic routing in canary deployment using nginx-ingress. Assuming you have already configured your Gitlab project with AutoDevops, next is to use the modified chart that I created here -> AutoDevops is completely customizable, so in order to use this chart instead of official chart, all you need to do is copy the files and move under `

View Azure load balancer backend pool update python

this python script can be used to automate updating AZ load balancer backend pool with the vms you like. this is knda custom as the dcos_vm and maint_vm are what this script is used to switch between .

#!/usr/bin/env python3
import argparse
import configparser
import logging.config
import os
import sys
hayderimran7 / pipeline.groovy
Created Jan 29, 2019 — forked from paulchubatyy/pipeline.groovy
Jenkins pipeline to read the repository list for Github Organization and create multibranch pipeline projects for them
View pipeline.groovy
import org.kohsuke.github.*
* This pipeline uses the Jenkins Job DSL plugin to create the multi-branch pipelines
* for your Github Organization repositories.
* @see
* It does not consumes 5k requests in 6 minutes, but actually queries the Github API
* for the repositories in organization and creates the Multi-Branch Pipelines in Jenkins.
View jenkins_pipeline_nested_conditions_when.groovy
// This example shows how to use nested conditions for `when` in jenkinsfile for declarative pipeline syntax
def skip_docker = true
pipeline {
agent any
stages {
stage('some stage') {
when {
allOf {