会员
周边
众包
新闻
博问
闪存
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
liy36
博客园
首页
新随笔
联系
订阅
管理
2025年3月2日
在pod中配置kubectl使用serviceaccount token 访问集群
摘要: kubectl exec -it my-pod -- bash # 配置 kubectl 使用 ServiceAccount 的 Token kubectl config set-credentials in-cluster \ --token=$(cat /var/run/secrets/kube
阅读全文
posted @ 2025-03-02 21:10 liy36
阅读(13)
评论(0)
推荐(0)
2025年1月16日
MacOS常用软件包
摘要: 图形化工具 OneDrive // 网盘 Tencent Lemon // 垃圾清理 Snipaste // 截图工具 VNC Viewer // VNC 客户端 Local Send // 局域网文件传输工具 Microsoft Remote Desktop Beta // Windows 连接工
阅读全文
posted @ 2025-01-16 15:47 liy36
阅读(28)
评论(0)
推荐(0)
Go 重写JSON序列化和反序列化方法
摘要: package main import ( "encoding/json" "fmt" "log" "strings" ) type Structs struct { Name string `json:"name"` Gender int `json:"gender"` } // MarshalJ
阅读全文
posted @ 2025-01-16 13:44 liy36
阅读(24)
评论(0)
推荐(0)
2024年12月20日
bash 脚本执行时自动切换到root用户
摘要: #!/usr/bin/env bash # Author=liy36 export PS4='\[\e[35m\]+ $(basename $0):${FUNCNAME}:$LINENO: \[\e[0m\]' if [ "$(id -u)" -ne 0 ];then echo "Switch to
阅读全文
posted @ 2024-12-20 15:15 liy36
阅读(64)
评论(0)
推荐(0)
2024年9月10日
Go 创建带密码的zip压缩包
摘要: 创建带密码的zip压缩包 package main import ( "io" "io/fs" "log" "os" "path/filepath" "strings" "github.com/alexmullins/zip" ) func init() { log.SetFlags(log.Lsh
阅读全文
posted @ 2024-09-10 13:59 liy36
阅读(178)
评论(0)
推荐(0)
2024年8月7日
基金持仓成本分析脚本
摘要: #!/usr/bin/env python3 # -*- coding: utf-8 -*- # from collections import namedtuple # 定义一个命名元组来存储赎回费率的期限和费率 RedemptionRate = namedtuple("RedemptionRat
阅读全文
posted @ 2024-08-07 13:32 liy36
阅读(16)
评论(0)
推荐(0)
2024年7月23日
Go使用HTTP的私有仓库中的模块
摘要: Go使用HTTP的私有仓库中的模块 1. 导入方设置Go变量 go env -w GOPRIVATE='gitlab.xxe.example.com' go env -w GOINSECURE='gitlab.xxe.example.com' # 因为中间多了一级.xxe导致不能用通配域名 2. 仓
阅读全文
posted @ 2024-07-23 17:47 liy36
阅读(89)
评论(0)
推荐(0)
2024年1月17日
Kubernetes Pod 日志中报 pthread_create failed: Resource temporarily unavailable 错误
摘要: 查看Pod日志中显示 pthread_create failed: Resource temporarily unavailable 通过监控系统查看节点的进程数 topk(3,sum(container_threads{cluster="env",node="worker-13"}) by (po
阅读全文
posted @ 2024-01-17 10:17 liy36
阅读(239)
评论(0)
推荐(0)
2023年7月17日
Prometheus常用查询
摘要: # Prometheus常用查询 ## 集群指标 ``` promql # CPU核心总数 sum(machine_cpu_cores{cluster="$cluster",job="kubelet"}) by(cluster) # CPU请求总数 sum(kube_pod_container_re
阅读全文
posted @ 2023-07-17 09:27 liy36
阅读(641)
评论(0)
推荐(0)
2023年7月15日
jq 命令备忘
摘要: # jq 命令常用语法 > demo数据 ``` json [ { "name": "user_b75b", "password": "UC9NxVUzfEVq", "instance_id": "rm-3aa3c7a51c6d6491d2421822" }, { "name": "user_fc4
阅读全文
posted @ 2023-07-15 20:28 liy36
阅读(24)
评论(0)
推荐(0)
下一页
公告