云原生临时记录

2021-11-20
2分钟阅读时长

Crane

云原生

https://kubernetes.io/zh/docs/tasks/extend-kubectl/kubectl-plugins/

https://github.com/kubernetes/sample-cli-plugin

https://mp.weixin.qq.com/s/r7RzGUuem1GPuKnLc8XEuw

kubectl plugin

question

kubectl get ns kubesphere-controls-system -o json | jq '.spec.finalizers=[]' > ns-without-finalizers.json
cat ns-without-finalizers.json

kubectl get ns kubesphere-monitoring-system -o json | jq '.metadata.finalizers=[]' > ns-without-finalizers.json
cat ns-without-finalizers.json

kubectl proxy &
PID=$!
curl -X PUT http://localhost:8001/api/v1/namespaces/kubesphere-monitoring-system/finalize -H "Content-Type: application/json" --data-binary @ns-without-finalizers.json
kill $ID


helm repo add gocrane https://finops-helm.pkg.coding.net/gocrane/gocrane
helm repo add prometheus-community https://finops-helm.pkg.coding.net/gocrane/prometheus-community
helm repo add grafana https://finops-helm.pkg.coding.net/gocrane/grafana
helm repo update

helm install prometheus -n crane-system --set pushgateway.enabled=false --set alertmanager.enabled=false --set server.persistentVolume.enabled=false -f https://finops.coding.net/p/gocrane/d/helm-charts/git/raw/main/integration/prometheus/override_values.yaml?download=false --create-namespace  prometheus-community/prometheus

helm install grafana -f https://finops.coding.net/p/gocrane/d/helm-charts/git/raw/main/integration/grafana/override_values.yaml?download=false -n crane-system --create-namespace grafana/grafana

helm install crane -n crane-system --create-namespace gocrane/crane
helm install fadvisor -n crane-system --create-namespace gocrane/fadvisor

caddy2

https://www.json2yaml.com/convert-yaml-to-json

腾讯云 https://segmentfault.com/u/tcloudnative/articles

容器环境cpu读取

127.0.0.1 - - [15/Apr/2022:07:42:16 +0000] "GET /grafana/api/live/ws HTTP/1.1" 400 12 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.88 Safari/537.36" "-"


proxy_set_header  Host $http_host;
proxy_set_header  Upgrade $http_upgrade;
proxy_set_header  Connection $connection_upgrade;
                    
map $http_upgrade $connection_upgrade {
    default upgrade;
    '' close;
}

# 清理 Terminating namespace
namespace=crane-system
kubectl get ns $namespace -o json | jq '.spec.finalizers=[]' > ns-without-finalizers.json
cat ns-without-finalizers.json
kubectl proxy &
PID=$!
curl -X PUT http://localhost:8001/api/v1/namespaces/$namespace/finalize -H "Content-Type: application/json" --data-binary @ns-without-finalizers.json
kill $PID

LGTM : code review 行话

程序员这个行业,不管你是大佬还是小弟,代码code review是必不可少的。那么在git上,大家日常交流的缩写语,往往一下就能看出你道行的深浅,至少是入行时间,哈哈,不要露怯,勇敢的跟大佬过招拆招。

收集了一些实用的缩写,方便大家日常交流(装B)

LGTM  —  Looks good to me,表示认可这次PR,同意merge 合并代码到远程仓库

ASAP -— as soon as possible! 尽快

ACK  —  acknowledgement, i.e. agreed/accepted change

NACK/NAK — negative acknowledgement, i.e. disagree with change and/or concept

RFC  —  request for comments, i.e. I think this is a good idea, lets discuss

WIP:Work In Progress 「进展中」,常见词汇,这里做为 Best Practice 单独提出来,主要针对改动较多的 PR,可以先提交部分,标题或 Tag 加上 WIP,表示尚未完成,这样别人可以先 review 已提交的部分

AFAIK/AFAICT  —  as far as I know / can tell IIRC  —  if I recall correctly

IANAL  — “ I am not a lawyer ”, but I smell licensing issues

IMO  — (In my opinion),在我看来

TL;DR  —  Too Long; Didn’t Read 「太长懒得看」,README 文档常见。

PR  —  Pull request「合并请求」

CR  —  Code Review 「代码审查」

PTAL  —  Please Take A Look. 你来瞅瞅?用来提示别人来看一下

TBR  —  To Be Reviewed. 提示维护者进行 review

TBD  —  To Be Done(or Defined/Discussed/Decided/Determined). 根据语境不同意义有所区别,但一般都是还没搞定的意思。

TBH  —  To be honest 「老实说」

atm  —  at the moment 「现阶段」,

作者:前端大飞 链接:https://www.jianshu.com/p/238a1e1f4037

关注公众号获得更多精彩文章

公众号:程序员大兵