- instanceId: ""
regionId: "cn-zhangjiakou"
{
"inputs": [
{
"detail": {
"Stderr": true,
"IncludeLabel": {
"io.kubernetes.pod.namespace": "YOUR NS"
},
"Stdout": true
},
"type": "service_docker_stdout"
}
]
}
job_name:
variables:
CI_DEBUG_TRACE: "true"
:~/golang-image-extra$ cat /etc/docker/daemon.json
{
"data-root": "/data",
"storage-driver": "overlay2"
}
# Change mongo-75f59d57f4-4nd6q to the name of the Pod
kubectl port-forward mongo-75f59d57f4-4nd6q 28015:27017
{{- /*
This is a comment.
*/}}
type: frobnitz
发现了一个在k8s快速调试的办法,在本地build latest镜像,然后push 覆盖云上的,imagepull改为always,deletepod,新pod就会用最新的代码重启了
aliyun
kubectl create secret docker-registry regsecret --docker-server=registry.cn-zhangjiakou.aliyuncs.com --docker-username=xxxx --docker-password=xxxxxxx注意image不要带https!service.beta.kubernetes.io/alibaba-cloud-loadbalancer-address-type: "intranet". https://help.aliyun.com/document_detail/86531.htm?spm=a2c4g.11186623.0.0.2bacc00dVOK3Y7#task-1425948systemctl restart rsyslog---未验证/run/containerd/io.containerd.runtime.v2.task/k8s.iocat /etc/kubernetes/kubelet-customized-args.confhttps://segmentfault.com/a/1190000022163856pvc
k8s to sls
{ "inputs": [ { "detail": { "Stderr": true, "IncludeLabel": { "io.kubernetes.pod.namespace": "YOUR NS" }, "Stdout": true }, "type": "service_docker_stdout" } ] }* and eventId.reason: Started相关告警即可, 用自带的那个好像不好使(也许好使),但是即使好使,也无法展现podnamesls 数据加工
gitlab
-f ./trunk/Dockerfile .sudo docker build-t rdqa/zzzzzz:test -f ./trunk/Dockerfile .docker tag SOURCE_IMAGE[:TAG] TARGET_IMAGE[:TAG]docker push registry.cn-zhangjiakou.aliyuncs.com/xxxx/zzzzz:teststandard_init_linux.go:211: exec user process caused "exec format error"在m1编的镜像 linux用不了 : https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/4558image:entrypointtotal:\s+\(statements\)\s+(\d+.\d+\%)To push a commit without triggering a pipeline, add [ci skip] or [skip ci], using any capitalization, to your commit message.yum install a && yum install b 改为 install a b && yum clean all && rm -rf /var/cache/yumstrategy: dependNo permissions to trigger downstream pipeline提升commiter的权限就好了,不知道为啥[-red-][-green-][-red-] [-green-]docker
-p 8935:1935docker run -v /xxxxxxxxx/trunk:/srstrunk --name srs3 -P -dit srsdev /bin/bashdocker run -it centosdocker run --entrypoint '/bin/sh' -it k8s.gcr.io/kustomize/kustomize:v3.8.7sudo docker system prune -a -fdocker开发srs
cicd
argocd
kubectl get Application -n argocd然后delete,但是不行,改一下finilizer:finalizer: []. done.helm template . <options> | kubectl apply -f -argo rollout
aliyun asm
k8s
KUBE_EDITOR="nano"kubectl get pod -o=custom-columns=NAME:.metadata.name,STATUS:.status.phase,NODE:.spec.nodeName --all-namespacesdig srv srs-origin-service.wzjinlei.svc.cluster.localSRV.NS.svc.cluster.local.kubectl delete pods <pod> --grace-period=0 --forcekubectl get pods | grep redash | awk '{print $1}' | xargs kubectl delete pod --grace-period=0 --forcekubectl get po --all-namespaces -o=jsonpath="{range .items[*]}{.metadata.namespace}:{.metadata.name}{''}{range .spec.containers[*]} {.name}:{.resources.requests.cpu}{'\n'}{end}{'\n'}{end}" | grep -e ':\d*m'alias util='kubectl get nodes --no-headers | awk '\''{print $1}'\'' | xargs -I {} sh -c '\''echo {} ; kubectl describe node {} | grep Allocated -A 5 | grep -ve Event -ve Allocated -ve percent -ve -- ; echo '\'''.kubectl describe nodeskubectl patch svc argocd-server -n argocd -p '{"spec": {"type": "LoadBalancer"}}'访问模式有: ReadWriteOnce 卷可以被一个节点以读写方式挂载。 ReadWriteOnce 访问模式也允许运行在同一节点上的多个 Pod 访问卷。 ReadOnlyMany 卷可以被多个节点以只读方式挂载。 ReadWriteMany 卷可以被多个节点以读写方式挂载。 ReadWriteOncePod 卷可以被单个 Pod 以读写方式挂载。 如果你想确保整个集群中只有一个 Pod 可以读取或写入该 PVC, 请使用ReadWriteOncePod 访问模式。这只支持 CSI 卷以及需要 Kubernetes 1.22 以上版本。https://www.qikqiak.com/post/boosting-kubeclt-productivity/k cp ns/pod:x.log ./akustomize
helm
helm template --debug比 helm lint方便, lint解决不了,用template看看原因{{range $i, $e := until (.Values.replicas | int)}} {{$i}} {{end}}如果报float的话,用int: spec.persistentvolumesource is immutable after creation: 要把所有的用pvc的pod停了就行 scale.{{ .Release.Namespace }}prometheus
快速调试
发现了一个在k8s快速调试的办法,在本地build latest镜像,然后push 覆盖云上的,imagepull改为always,deletepod,新pod就会用最新的代码重启了
tips