Skip to content

Instantly share code, notes, and snippets.

Wenzhi Liang wzhliang

View GitHub Profile
View gist:40640b6e332106879b39b0a996b0a073
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"networking.istio.io/v1alpha3","kind":"VirtualService","metadata":{"annotations":{},"name":"bookinfo","namespace":"bookinfo"},"spec":{"gateways":["bookinfo-gateway"],"hosts":["*"],"http":[{"match":[{"uri":{"exact":"/productpage"}},{"uri":{"exact":"/login"}},{"uri":{"exact":"/logout"}},{"uri":{"prefix":"/api/v1/products"}}],"route":[{"destination":{"host":"productpage","port":{"number":9080}}}]}]}}
creationTimestamp: null
name: bookinfo
namespace: bookinfo
resourceVersion: "556881"
View 001.yaml
- args:
- proxy
- sidecar
- --configPath
- /etc/istio/proxy
- --binaryPath
- /usr/local/bin/envoy
- --serviceCluster
- details
- --drainDuration
@wzhliang
wzhliang / init.yaml
Created Oct 31, 2018
istio init container
View init.yaml
initContainers:
- args:
- -p
- "15001"
- -u
- "1337"
- -m
- REDIRECT
- -i
- '*'
View vimrc
" Vimrc file, http://phuzz.org
set nocompatible " use vim defaults
set ls=2 " allways show status line
set tabstop=4 " numbers of spaces of tab character
set shiftwidth=4 " numbers of spaces to (auto)indent
set scrolloff=3 " keep 3 lines when scrolling
set showcmd " display incomplete commands
set hlsearch " highlight searches
set incsearch " do incremental searching
View b.har
{
"log": {
"entries": [
{
"startedDateTime": "2018-12-24T23:38:18.574150+00:00",
"cache": {},
"request": {
"headers": [
{
"name": "Host",
@wzhliang
wzhliang / start.sh
Created Jan 9, 2019
Starting Minikube behind proxy on MacOS
View start.sh
minikube start --docker-env=http_proxy=http://192.168.1.6:2080 --docker-env=https_proxy=http://192.168.1.6:2080
@wzhliang
wzhliang / testvm.yaml
Created Jan 9, 2019
kubectl get vms output (kubevirt)
View testvm.yaml
apiVersion: kubevirt.io/v1alpha2
kind: VirtualMachine
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"kubevirt.io/v1alpha2","kind":"VirtualMachine","metadata":{"annotations":{},"name":"testvm","namespace":"default"},"spec":{"running":false,"template":{"metadata":{"labels":{"kubevirt.io/domain":"testvm","kubevirt.io/size":"small"}},"spec":{"domain":{"devices":{"disks":[{"disk":{"bus":"virtio"},"name":"containerdisk","volumeName":"containervolume"},{"disk":{"bus":"virtio"},"name":"cloudinitdisk","volumeName":"cloudinitvolume"}],"interfaces":[{"bridge":{},"name":"default"}]},"resources":{"requests":{"memory":"64M"}}},"networks":[{"name":"default","pod":{}}],"volumes":[{"containerDisk":{"image":"kubevirt/cirros-registry-disk-demo"},"name":"containervolume"},{"cloudInitNoCloud":{"userDataBase64":"SGkuXG4="},"name":"cloudinitvolume"}]}}}}
creationTimestamp: 2019-01-09T00:47:00Z
generation: 1
name: testvm
namespace: default
@wzhliang
wzhliang / 001.txt
Created Jan 25, 2019
prometheus alert configuration
View 001.txt
groups:
- name: etcd
rules:
- alert: NoLeader
expr: etcd_server_has_leader{job="kube-etcd"} == 0
for: 1m
labels:
severity: critical
k8s-component: etcd
annotations:
@wzhliang
wzhliang / prom-storage-conf.txt
Created Jan 25, 2019
Prometheus storage configuration
View prom-storage-conf.txt
containers:
- args:
- --storage.tsdb.path=/data
- --storage.tsdb.retention=400d
@wzhliang
wzhliang / prom-operator-am.txt
Created Jan 25, 2019
Prometheus operator AM CRD
View prom-operator-am.txt
kubectl get alertmanager main -n monitoring -o yaml
apiVersion: monitoring.coreos.com/v1
kind: Alertmanager
metadata:
clusterName: ""
creationTimestamp: 2018-08-28T09:15:25Z
labels:
alertmanager: main
name: main
namespace: monitoring
You can’t perform that action at this time.