Skip to content

Instantly share code, notes, and snippets.

View hgautam's full-sized avatar

Himanshu Gautam hgautam

View GitHub Profile

List compute disks:

  • gcloud compute disks list

Delete the disks:

  • gcloud compute disks delete --quiet --zone us-central1-a

Note: Disk name should include following string as part of its name: gke-lfs268-lab. Default zone is us-central1-a.

@hgautam
hgautam / values.yml
Last active February 21, 2023 15:32
Jenkins Helm install values.yaml
controller:
tag: "alpine"
componentName: "jenkins-controller"
image: "jenkins/jenkins"
imagePullPolicy: "Always"
serviceType: ClusterIP
installPlugins:
- durable-task:latest
- workflow-durable-task-step:latest
- blueocean:latest
@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:
@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 / 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 / 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 / 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 / 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-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 / 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