Skip to content

Instantly share code, notes, and snippets.

View initcron's full-sized avatar

Gourav Shah initcron

View GitHub Profile
@initcron
initcron / vote-deploy.yaml
Created May 10, 2024 05:11
vote deployment with resources and strategy defined
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
labels:
app: vote
name: vote
annotations:
kubernetes.io/change-cause: "updated image to v2"
spec:
@initcron
initcron / kind-nginx-ingress-all.yaml
Last active May 9, 2024 09:39
Nginx Ingress Setup for KIND
apiVersion: v1
kind: Namespace
metadata:
labels:
app.kubernetes.io/instance: ingress-nginx
app.kubernetes.io/name: ingress-nginx
name: ingress-nginx
---
apiVersion: v1
automountServiceAccountToken: true
@initcron
initcron / redis-sts.yaml
Created May 9, 2024 07:28
Redis Statefulset with PVC Templaet and 3 Replicas
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: redis
labels:
app: redis
spec:
selector:
matchLabels:
role: master
@initcron
initcron / vote-ing.yaml
Last active May 8, 2024 05:11
Ingress Rule for Vote App for Traefik
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: vote
namespace: instavote
spec:
ingressClassName: nginx
rules:
- host: vote.example.com
@initcron
initcron / user-data-k8s-v1.28.sh
Created March 12, 2024 11:25
Kubernetes Installation v1.28 User Data
#!/bin/bash
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -y git wget net-tools
# Prereqs
modprobe overlay
@initcron
initcron / vote-hpa.yaml
Last active May 5, 2024 05:17
HPA v2 Spec for Vote App
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: vote
spec:
minReplicas: 2
maxReplicas: 10
metrics:
- type: ContainerResource
containerResource:
@initcron
initcron / kind-install-metrics-server.md
Created January 23, 2024 05:38
Install Metrics Server on KIND Cluster
2023-11-22 10:19:12 ERROR - An error occurred in the application:
Traceback (most recent call last):
File "app.py", line 27, in <module>
result = divide(15, 3)
File "app.py", line 15, in divide
return x / y
ZeroDivisionError: division by zero
@initcron
initcron / dev-app.yaml
Last active October 6, 2023 06:13
Argocd Application Spec for Dev Env
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: vote-dev
namespace: argocd
spec:
destination:
namespace: dev
server: https://kubernetes.default.svc
project: default
cd bootcamp/jenkins
git pull origin main
docker-compose build
docker-compose up -d