opskumu / issues

利用 issues 管理技术 tips
https://github.com/opskumu/issues/issues
80 stars 5 forks source link

学习周报「2022」 #30

Closed opskumu closed 1 year ago

opskumu commented 2 years ago

2022 占个位

opskumu commented 2 years ago

04-18~24

CPU 隔离

SUSE 官方一系列关于 CPU 隔离的文章,推荐阅读,包括 isolcpus 和 cpuset 相关都有说明

opskumu commented 2 years ago

curl 通过 serviceaccount token 访问 apiserver

$ kubectl exec -it sa-example -- /bin/sh 
# export CURL_CA_BUNDLE=/var/run/secrets/kubernetes.io/serviceaccount/ca.crt
# TOKEN=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token)
# curl -H "Authorization: Bearer $TOKEN" https://kubernetes/api/v1/namespaces/default/pods
{
  "kind": "PodList",
  "apiVersion": "v1",
  "metadata": {
    "selfLink": "/api/v1/namespaces/default/pods",
    "resourceVersion": "10377013"
  },
  "items": [
    {
      "metadata": {
        "name": "sa-example",
        "namespace": "default",
        "selfLink": "/api/v1/namespaces/default/pods/sa-example",
        "uid": "c969fb72-ad72-4111-a9f1-0a8b148e4a3f",
        "resourceVersion": "10362903",
        "creationTimestamp": "2020-07-15T06:19:26Z"
      },
      "spec": {
...

更快捷的方式

token=`kubectl get secret <secret>  -o yaml  -n <namespace> |grep "token:" |awk '{print $2}'|base64 -d`
curl -k -H "Authorization: Bearer $token"  https://127.0.0.1:8443/api/v1/pods
opskumu commented 2 years ago

bridge fdb show 查看 fdb 表

# bridge fdb show dev flannel.1
92:f3:c8:b2:6e:f0 dst 10.100.139.246 self permanent
ba:10:0e:7b:74:89 dst 10.100.139.247 self permanent

判断类似 calico/flannel vxlan 对应网络

opskumu commented 1 year ago

say bye 2022