Skip to content

Instantly share code, notes, and snippets.

View vnugent's full-sized avatar

Viet Nguyen vnugent

View GitHub Profile
@vnugent
vnugent / Digital-ocean-cheatsheet.txt
Last active October 28, 2019 14:06
Digital Ocean K8s cheatsheet
Step 1 - Config `kubectl` client to work with a new cluster
1. Download cluster yaml config from K8s dashboard
2. `export KUBECONFIG=~/.kube/config:<new yaml file>`
3. `kubectl config view --flatten > config.new`
4 Remove ~/.kube/config. Rename config.new to config
kubectl config get-contexts
kubectl config use-context <new context>
Step 2 - Add K8s cluster to Gitlab
db.pandas.find({}, {_id: 1, title: 1, meta: 1}).sort({insert_ts: -1})
# enable featured post
db.pandas.update({_id: {$in: ["<uuid>"]}}, {$set: {'meta.featured': "true"}}, false, true)
@vnugent
vnugent / istio-minikube.md
Last active October 26, 2018 14:48
Istio with minikube

Install Notes for Minikube, Istio and Kiali via Helm on Fedora 28

Use this link for 1.1 release https://preliminary.istio.io/

Step 0

Follow official docs to install kvm2, libvirtd, kubectl and helm

Step 1

Start minikube.

cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: Secret
metadata:
name: kiali
namespace: $NAMESPACE
labels:
app: kiali
type: Opaque
data:

Label (enable) project for auto injection

 oc label namespace $(oc project -q)  istio-injection=enabled

clean up sidecar containers part of deployment pods

oc get pod |grep deploy | awk '{print $1}' | xargs --no-run-if-empty -I {} oc rsh -c istio-proxy {} pkill -f istio
@vnugent
vnugent / leaning-tower-of-pisa.geojson
Last active March 13, 2018 17:05
Geojson example
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import yaml
import sys
myParam = {
"description": "Queue size parameter for the collector",
"displayName": "Jaeger Collector Queue Size",
"name": "COLLECTOR_QUEUE_SIZE",
"required": False,
"value": "300000"
}
@vnugent
vnugent / 239pods-30-minutes.txt
Created March 23, 2017 17:09
239 pods/node, 30minutes of raw metrics
/home/vnguyen/git/.pyme/bin/python2.7 /home/vnguyen/git/pyme/pyme/main.py
Number of pods: 239
1
2
3
4
5
6
7
8
Number of pods: 20
{
"promgen/example-5-j6jea": {
"metrics": [
{
"type": "gauge",
"id": "98521d12-0a8b-11e7-a6bf-fa163e4fa2fc_custom_gaugeA",
"data_count": 60
},
{