Skip to content

Instantly share code, notes, and snippets.

View hgautam's full-sized avatar

Himanshu Gautam hgautam

View GitHub Profile
@hgautam
hgautam / ansible-summary.md
Created November 16, 2017 19:18 — forked from andreicristianpetcu/ansible-summary.md
This is an ANSIBLE Cheat Sheet from Jon Warbrick

An Ansible summary

Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)

Configuration file

intro_configuration.html

First one found from of

@hgautam
hgautam / gcpCleanup.md
Last active July 14, 2020 20:54
GCP resources cleanup

GCP resource cleanup

  • To list running clusters
gcloud container clusters list
  • To delete running clusters
gcloud container clusters delete <clustername> --zone <zone-name>
@hgautam
hgautam / installJX.md
Last active August 4, 2020 23:54
InstallJenkinsX

Installing Jenkins X in Google Kubernetes Engine (GKE)

  • Run the following command to launch a cluster named jxboot:
jx create cluster gke --skip-installation --skip-login -n jxboot
  • Choose a zone closer to your geographical location. E.g. us-west1-a if you live in California
  • To view a list of zones, run the folowing command:
gcloud compute zones list
@hgautam
hgautam / jenkins-x-prestep.yml
Last active July 10, 2020 00:07
A sample pipeline YAML
buildPack: nop
pipelineConfig:
agent:
label: gcr.io/jenkinsxio/builder-go
env:
- name: JENKINS_X
value: jx
- name: MY_VAR
value: foo
pipelines:
@hgautam
hgautam / jenkins-x-post-step-yml
Created July 10, 2020 00:15
A pipeline with step after an existing step
buildPack: nop
pipelineConfig:
agent:
label: gcr.io/jenkinsxio/builder-go
env:
- name: JENKINS_X
value: jx
- name: MY_VAR
value: foo
pipelines:
@hgautam
hgautam / jenkins-x-replace-step.yml
Created July 10, 2020 00:42
A pipeline file with a replace step
buildPack: nop
pipelineConfig:
agent:
label: gcr.io/jenkinsxio/builder-go
env:
- name: JENKINS_X
value: jx
- name: MY_VAR
value: foo
pipelines:
@hgautam
hgautam / cleanup.md
Last active July 24, 2020 17:58
Clean up staging requirements.yml

Remove old dependencies from requirements.yaml

Staging env dependencies are stored inside: environment-cluster-name-staging repository. You can make changes by accessing this repository on GitHub UI.

The file we want to edit is called requirements.yaml and is located inside env directory. The contents of this should be similar to this:

dependencies:
  - alias: expose
    name: exposecontroller
 repository: http://chartmuseum.jenkins-x.io
@hgautam
hgautam / resetCluster.md
Last active July 24, 2020 17:54
Reset Jenkins X cluster

After you have imported projects into Jenkins X, few dependencies get added to the cluster config inside environment--dev repository. Please follow the following steps to remove all such references:

cd environment-<cluster-name>-dev
git pull origin master
rm -rf dependency-matrix
rm repositories/templates/<$yourGHUserID>-<$imported-repo-name>-sr.yaml

After executing the last command, you should only see one file inside repositories/templates/ dir.

@hgautam
hgautam / create-cluster.bash
Last active December 29, 2023 13:23
Script to create a Kubernets cluster in GKE
#!/bin/bash
######################
# Create The Cluster #
######################
# helm 3 is being used for deploying Helm based Jenkins package
gcloud auth login
CLUSTER_NAME=jenkins
@hgautam
hgautam / jenkins.yml
Last active December 29, 2023 13:24
YAML file to install Jenkins
apiVersion: v1
kind: Namespace
metadata:
name: jenkins
---
apiVersion: v1
kind: Namespace
metadata: