Skip to content

Instantly share code, notes, and snippets.

View initcron's full-sized avatar

Gourav Shah initcron

View GitHub Profile
@initcron
initcron / k8s-user-data.sh
Last active March 28, 2024 02:41
kubernetes user data script
#!/bin/bash
apt-get update
apt-get install -y git wget
# Install Docker
apt-get install -yq \
apt-transport-https \
ca-certificates \
curl \
@initcron
initcron / jenkins_script_console.md
Last active March 26, 2024 11:58
Jenkins Script Tutorial

Jenkins Script Console Tutorial

Jenkins script console allows one to run groovy scripts/code to automate jenkins setup e.g installing plugins, setting configuration parameters. These groovy scripts can be run either through the web ui, or event loaded as scripts using curl from command line. With these groovy scripts, jenkins configurations can be completely automated.

Lets explore this script console and learn how to write/load simple scripts.

Exploring script console

From the jenkins UI, choose Jenkins => Manage Jenkins => Script Console . You should see script console installed, in which run the following,

@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 January 23, 2024 06:19
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 / ec2-ansible.yml
Created December 25, 2017 16:04
provision ec2 instance with ansible with user-data
# link: http://allandenot.com/devops/2015/01/31/provisioning-ec2-hosts-with-ansible.html
---
- name: Provision EC2 Box
local_action:
module: ec2
key_name: "{{ ec2_keypair }}"
group_id: "{{ ec2_security_group }}"
instance_type: "{{ ec2_instance_type }}"
image: "{{ ec2_image }}"
@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
@initcron
initcron / jenkins_configs_dsl.md
Created October 2, 2023 15:56
Jenkins Configuration as a Code Resources