Skip to content

Instantly share code, notes, and snippets.

View resouer's full-sized avatar
🏡
Sunnyvale

Lei Zhang (Harry) resouer

🏡
Sunnyvale
View GitHub Profile
@resouer
resouer / scale.md
Last active February 27, 2018 19:45
Autoscaling demo
  1. Start the autoscaler
root@d8dd5a58836b:~/workspace/DLworkspace/src/ClusterBootstrap# ./cluster-autoscaler --v=4 --stderrthreshold=error --logtostderr=true --cloud-provider=aztools --skip-nodes-with-local-storage=false --nodes=1:10:dlws-worker-asg --leader-elect=false --scale-down-enabled=false --kubeconfig=./deploy/kubeconfig.yaml
  1. Scale a existing deployment to many instances.
root@d8dd5a58836b:~/workspace/DLworkspace/src/ClusterBootstrap# ./deploy.py kubectl scale --replicas=8 deploy/nginx-deployment
===============================================
Checking Available Nodes for Deployment...
@resouer
resouer / scale down
Created March 5, 2018 20:35
scale down
```
./cluster-autoscaler --v=5 --stderrthreshold=error --logtostderr=true --cloud-provider=aztools --skip-nodes-with-local-storage=false --nodes=1:10:dlws-worker-asg --leader-elect=false --scale-down-enabled=true --kubeconfig=./deploy/kubeconfig.yaml
```
```
I0305 20:20:54.209418 2996 scale_down.go:175] Scale-down calculation: ignoring 2 nodes, that were unremovable in the last 5m0s
I0305 20:20:54.209449 2996 scale_down.go:207] Node harrydevbox-worker01 - utilization 0.883802
I0305 20:20:54.209475 2996 scale_down.go:211] Node harrydevbox-worker01 is not suitable for removal - utilization too big (0.883802)
I0305 20:20:54.209494 2996 scale_down.go:207] Node harrydevbox-worker03 - utilization 0.030000
I0305 20:20:54.209651 2996 static_autoscaler.go:332] harrydevbox-worker03 is unneeded since 2018-03-05 20:10:54.176130596 +0000 UTC m=+71.982770098 duration 10m0.032698796s
@resouer
resouer / gist:5f9cdcd2889da7c4a183c277016b5412
Last active May 19, 2018 02:18
Test result of equivalence cache
8-core VM on GCE
Code base: master branch
Commit ID: 1e689a8
Performance test with:
`./test-performance.sh`
// 100 nodes 3k pods
cd $GOPATH/src/k8s.io/kubernetes
git clone https://github.com/kubernetes/kubernetes .
./hack/install-etcd.sh
export PATH=$GOPATH/src/k8s.io/kubernetes/third_party/etcd:${PATH}
make test-e2e-node ARCH=arm64 PARALLELISM=1 RUNTIME=remote CONTAINER_RUNTIME_ENDPOINT=/var/run/frakti.sock IMAGE_SERVICE_ENDPOINT=/var/run/frakti.sock TEST_ARGS="--prepull-images=false" FOCUS="\[Conformance\]"
apiVersion: v1
kind: PersistentVolume
metadata:
name: pv0001
spec:
capacity:
storage: 1Gi
accessModes:
- ReadWriteOnce
hostPath:
@resouer
resouer / git_rebase.md
Created November 10, 2018 08:39 — forked from ravibhure/git_rebase.md
Git rebase from remote fork repo

In your local clone of your forked repository, you can add the original GitHub repository as a "remote". ("Remotes" are like nicknames for the URLs of repositories - origin is one, for example.) Then you can fetch all the branches from that upstream repository, and rebase your work to continue working on the upstream version. In terms of commands that might look like:

Add the remote, call it "upstream":

git remote add upstream https://github.com/whoever/whatever.git

Fetch all the branches of that remote into remote-tracking branches, such as upstream/master:

git fetch upstream

apiVersion: core.oam.dev/v1alpha1
kind: ApplicationConfiguration
metadata:
name: first-app
spec:
components:
- componentName: helloworld-python-v1
instanceName: first-app-helloworld-python-v1
parameterValues:
- name: target
# -------------------------- Step 1: Define and install WorkloadType and Trait ---------------------
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: radius.cache.crossplane.io
annotations:
core.oam.dev/oam-type: WorkloadType
scope: Namespaced
names:
# Step 1: Define and install WorkloadType and Trait
---
apiVersion: core.oam.dev/v1alpha1
kind: WorkloadType
metadata:
name: cache.crossplane.io/v1.Radius # we endorse G/V/K convension as WorkloadType name
spec:
schematic: |
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
---
apiVersion: core.oam.dev/v1alpha1
kind: WorkloadDefinition
metadata:
name: service.serving.knative.dev
spec:
definitionRef:
# reference to the name of real-world crd
name: service.serving.knative.dev
---