Skip to content

Instantly share code, notes, and snippets.

mohanpedala / 1-way-ssl.jpg
Last active November 23, 2023 17:44
One-Way SSL and Two-Way SSL
mohanpedala /
Last active August 30, 2023 20:40
Different Container Design Patterns

Container Design Patterns

1. The single-container design pattern

Employing the single-container pattern means just putting your application into a container. It's how you usually start your container journey. But it's important to keep in mind that this pattern is all about simplicity, meaning that the container must have only one responsibility. That means it's an anti-pattern to have a web server and a log processor in the same container.

Containers are commonly used for web apps, where you expose an HTTP endpoint. But they can be used for many different things.

In Docker, you have the ability to change the behavior of a container at runtime, thanks to the CMD and ENTRYPOINT instructions. So I'm not limited to using containers for HTTP services. I can also use them for any bash script that accepts some parameters at runtime.

By letting containers change behavior at runtime, you can create a base container that can be reused in different contexts. So you'd use the single-container pattern to expose

mohanpedala /
Last active January 18, 2023 21:25
helm 2 and helm 3 installation on a linux machine

Helm 3 installation

  • Download the package and untar it.

tar xvf helm-v3.0.2-linux-amd64.tar.gz
  • Move the package to the below location
mv linux-amd64/helm /usr/local/bin/helm3
mohanpedala /
Created September 7, 2019 19:44 — forked from lemiorhan/
How to make a release with Git and Maven via JGitFlow

How to make a release with Git and Maven via JGitFlow

Imagine that you are versioning your sourcecode in git and building your code via maven. You need to make releases before deploying to production regularly. What should be the strategy we need to follow for releasing?

I've used maven-release-plugin for years to make releases. It worked perfectly with maven and svn, but we started to face problems when we migrated our code to git and to make releases on git.

After checking the literature, we decided to use JGit-Flow which is a maven plugin based on and is a replacement for the maven-release-plugin enabling support for git-flow style releases via maven.

I do not want to explain the details much because there are many great posts explaining all.

mohanpedala / Chart.yaml
Created August 14, 2019 18:33 — forked from jeroenr/Chart.yaml
Env specific helm deployment
name: my-app-chart
version: 0.0.1 # Use Jenkinsfile for versioning
description: My App
- app
- name: Jeroen Rosenberg
engine: gotpl
mohanpedala /
Created August 13, 2019 22:50 — forked from tuannvm/
#Helm #Kubernetes #cheatsheet, happy helming!
mohanpedala /
Last active December 8, 2023 17:37
k8s Network Trobleshooting

Network Troubleshooting

Inspecting Conntrack Connection Tracking

  • Prior to version 1.11, Kubernetes used iptables NAT and the conntrack kernel module to track connections. To list all the connections currently being tracked, use the conntrack command:
  • To list conntrack-tracked connections to a particular destination address, use the -d flag:
    conntrack -L -d

Node connection table full (issues making reliable connections to services)

  • It's possible your connection tracking table is full and new connections are being dropped. If that's the case you may see messages like the following in your system logs:
mohanpedala /
Last active April 24, 2019 20:57
k8s service accounts
  1. Create service account for user Alice
kubectl create sa alice
  1. Get related secret
secret=$(kubectl get sa alice -o json | jq -r .secrets[].name)
  1. Get ca.crt from secret (using OSX base64 with -D flag for decode)
mohanpedala /
Last active June 25, 2019 20:47
k8s Metrics and Horizontal Pod Scaling

Create a Kubernetes Metrics Server

  1. To clone the GitHub repository of metrics-server, run the following command:
git clone
cd metrics-server/
  1. To install Metrics Server from the root of the Metrics Server directory, run the following command:
kubectl create -f deploy/1.8+/