Skip to content

Instantly share code, notes, and snippets.

View satishchennu1's full-sized avatar
💭
Infrastucture as code

schennu satishchennu1

💭
Infrastucture as code
View GitHub Profile
@satishchennu1
satishchennu1 / gist:5df3dbd47772d576484664a6d9f45bc1
Created July 18, 2020 23:12 — forked from ikke-t/gist:7009061545316ccc6e735b544dd02c40
Sample Ansible playbook with openshift_raw module to setup project in multi zone cluster
---
#
# This playbook sets up a project which is locked into some given environment.
# Consider you have cluster labelled to have three zones, e.g.
#
# 1. devtest
# 2. prodA
# 3. prodB
#
# This playbook sets up a new project, and labels it to force all the pods to
@satishchennu1
satishchennu1 / openshift_cli_tricks.MD
Last active August 19, 2020 16:58 — forked from tuxfight3r/openshift_cli_tricks.MD
openshift cli tricks - using go templates

openshift list all pods and thier specs (requests/limits)

oc get pod -o jsonpath='{range .items[*]}{"SPEC:  \n  LIMITS  : "}{.spec.containers[*].resources.limits}{"\n  REQUESTS: "}{.spec.containers[*].resources.requests}{"\n"}{end}'

openshift list all pods and thier specs with name (requests /limits)

oc get pod -o jsonpath='{range .items[*]}{"NAME:  "}{.metadata.name}{"\nSPEC:  \n  LIMITS  : "}{.spec.containers[*].resources.limits}{"\n  REQUESTS: "}{.spec.containers[*].resources.requests}{"\n\n"}{end}'
@satishchennu1
satishchennu1 / my-openshift-template.json
Created July 17, 2020 15:08 — forked from lucywyman/my-openshift-template.json
Example template to create Openshift image from private git repo
{
"kind": "Template",
"apiVersion": "v1",
"metadata": {"name": "my-template"},
"objects": [
{
"kind": "ImageStream",
"apiVersion": "v1",
"metadata": {
"name": "my-app",
// Set your project Prefix using your GUID
def prefix = "user22"
// Routes
def clusterDomain = "apps.cluster-19ae.sandbox478.opentlc.com"
def tasksDevRoute = "tasks-${prefix}-tasks-dev.${clusterDomain}"
def ocpRegistryRoute = "default-route-openshift-image-registry.${clusterDomain}"
def nexusRegistryRoute = "nexus-registry-${prefix}-cicd.${clusterDomain}"
// Set variable globally to be available in all stages