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 / argocd imager updater application config
Created February 27, 2022 08:15
argocd imager updater application config for kube-ops-view demo application
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 / docker-compose file grafana agent
Created February 27, 2022 07:11
docker-compose file which collects container & node metrics via grafana agent and sends to prometheus server via remote write
version: "3"
services:
grafana-agent:
image: grafana/agent:v0.23.0
container_name: grafana-agent
volumes:
- /path/to/data/:/etc/agent/data
- /path/to/agent.yaml:/etc/agent/agent.yaml
server:
log_level: info
http_listen_port: 12345
metrics:
global:
scrape_interval: 30s
external_labels:
environment: test-server
configs:
@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'
@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 / 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 / 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 / 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 / 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 / .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: