Skip to content

Instantly share code, notes, and snippets.

View tanmay-bhat's full-sized avatar

Tanmay Bhat tanmay-bhat

View GitHub Profile
@tanmay-bhat
tanmay-bhat / adblock setup script
Last active September 3, 2019 07:39
command to install and configure adblock
sudo mkdir -p /usr/local/bin && sudo curl -\# https://raw.githubusercontent.com/MattiSG/adblock/master/adblock --output /usr/local/bin/adblock && sudo chmod u+x /usr/local/bin/adblock
@tanmay-bhat
tanmay-bhat / keybase.md
Created September 12, 2019 05:27
my github keybase

Keybase proof

I hereby claim:

  • I am tanmay-bhat on github.
  • I am tanmay1337 (https://keybase.io/tanmay1337) on keybase.
  • I have a public key ASDgjDTvLAgikgjfbQI-tDqFKUPgUbNnTmZ_9oLZWQ79WAo

To claim this, I am signing this object:

@tanmay-bhat
tanmay-bhat / gitlab-ci.yml
Last active January 4, 2025 04:17
gitlab-CI file to build the Docker image and pushes to ECR
image: "python:3.6" # base dockerimage on which the stages will run. Can be different for each stage.
stages: # each stage runs on a new Docker image. data is not persisted between stages by default.
- publish_image # build docker image and push to registry
build and push docker image:
stage: publish_image
only: # only runs the step when git tag is done and it matches one of the mentioned regex patterns
variables:
- $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+-[0-9]+\.[0-9]+\.[0-9]+$/
@tanmay-bhat
tanmay-bhat / .gitlab-ci.yml
Last active January 30, 2025 10:53
Using Kaniko to build and push images through Gitlab-CI to ECR
#base image in which all stages are executed
image: alpine
# Ordered stages of the CI pipeline
stages:
- build_and_push
build and push docker image:
stage: build_and_push
only:
variables:
@tanmay-bhat
tanmay-bhat / go-action.yaml
Created December 18, 2021 11:14
Github Action file to build Dockerfile, Push to DigitalOcean Repository and update Image tag using Kustomize
name: Go
on:
push:
branches: [ main ]
tags:
- 'v*.*.*'
jobs:
build:
@tanmay-bhat
tanmay-bhat / spot_ondemand_deployment.yaml
Created December 18, 2021 11:50
Deployment file to distrubute pods inside replicaset to both SPOT and ON_DEMAND instance nodes or node-groups.
kind: Deployment
metadata:
name: nginx
spec:
replicas: 10
selector:
matchLabels:
app: nginx
template:
metadata:
@tanmay-bhat
tanmay-bhat / restart.sh
Created January 4, 2022 15:12
Shell script to restart all deployments in all namespace except kube-system
#!/bin/bash
#if any namespace needs to be excluded, add that in grep section
ns=$(kubectl get ns --no-headers | grep -Ev 'kube-system|kube-public' | cut -d ' ' -f1 )
for namespace in $ns; do
kubectl -n $namespace rollout restart deploy
done
@tanmay-bhat
tanmay-bhat / argocd-image-updater-application-example.yaml
Created January 18, 2022 15:33
An eample Application definition yaml file to demonstrate argocd-image updater.
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: kube-ops-view-demo
finalizers:
- resources-finalizer.argocd.argoproj.io
namespace: argocd
annotations:
argocd-image-updater.argoproj.io/image-list: registry.digitalocean.com/tanmaybhat/kube-ops-view
argocd-image-updater.argoproj.io/write-back-method: git:secret:argocd/gitlab-token
@tanmay-bhat
tanmay-bhat / loki-gcs.yaml
Created January 23, 2022 13:27
Helm chart configuration values to configure Google Cloud Storage ( GCS) as Loki storage medium
image:
repository: grafana/loki
tag: 2.4.1
pullPolicy: IfNotPresent
## Optionally specify an array of imagePullSecrets.
## Secrets must be manually created in the namespace.
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
##
# pullSecrets:
@tanmay-bhat
tanmay-bhat / Prometheus remote write reciever config
Created February 27, 2022 07:05
How to configure Prometheus server as a remote receiver
- name: prometheus-server
image: quay.io/prometheus/prometheus:v2.33.3
args:
- '--storage.tsdb.retention.time=15d'
- '--config.file=/etc/config/prometheus.yml'
- '--storage.tsdb.path=/data'
- '--web.console.libraries=/etc/prometheus/console_libraries'
- '--web.console.templates=/etc/prometheus/consoles'
- '--web.enable-lifecycle'
- '--web.enable-remote-write-receiver'