Skip to content

Instantly share code, notes, and snippets.

View rvennam's full-sized avatar

Ram Vennam rvennam

View GitHub Profile
[
{
"moonrise": "2016-12-01T08:40:16-0500",
"snow_code": "",
"qpf": 0,
"expire_time_gmt": 1480613926,
"lunar_phase": "Waxing Crescent",
"num": 1,
"lunar_phase_code": "WXC",
"min_temp": 36,
@rvennam
rvennam / kubernetes.sh
Last active September 6, 2018 15:13
IBM Cloud, Kubernetes and Istio cheat sheet
# Token
kubectl config view | grep token | cut -f 2 -d ":" | tr -d " ";
# Ease of use
ibmcloud cr info
ibmcloud cr namespace-list
export MYNAMESPACE=<NAMESPACE> # export MYNAMESPACE=rvennam
export MYREGISTRY=<REGISTRY> # export MYREGISTRY=registry.ng.bluemix.net
# Build image
#!/bin/bash
# IBM Cloud Kubernetes Service cluster config dir
clustersdir=~/.bluemix/plugins/container-service/clusters
#Produce a Kubernetes merged config string to be used with the KUBECONF environment variable.
# CHANGE VALUE
# Note the value is the IBM ID used to log into ibmcloud. This is the same
# value that appears in the downloaded IKS cluster config files for the
export CTX_LOCAL=demo-multicluster1
export CTX_REMOTE=demo-multicluster2
# Enable automatic sidecar injection for default
kubectl label --context=$CTX_LOCAL namespace default istio-injection=enabled
kubectl label --context=$CTX_REMOTE namespace default istio-injection=enabled
# Deploy BookInfo with no reviews v3 on LOCAL
kubectl apply --context=$CTX_LOCAL -f bookinfo-no-reviews-v3.yaml
kubectl delete --context=$CTX_LOCAL -f bookinfo-no-reviews-v3.yaml
#!/bin/bash
if [ -z "$1" ]
then
echo "No argument supplied"
exit 1
fi
ibmcloud ks cluster-addon-disable istio --cluster $1 -f
apiVersion: apps/v1
kind: Deployment
metadata:
name: travelapp
labels:
app: travelapp
spec:
replicas: 1
selector:
matchLabels:
---
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
name: travelapp-hpa
labels:
app: travelapp
spec:
scaleTargetRef:
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: travelapp
labels:
app: travelapp
spec:
replicas: 1
selector:
matchLabels:
apiVersion: apps/v1
kind: Deployment
metadata:
name: travelapp
labels:
app: travelapp
version: v1
spec:
replicas: 1
selector:
apiVersion: apps/v1
kind: Deployment
metadata:
name: travelapp
labels:
app: travelapp
version: v2
spec:
replicas: 1
selector: