解决AWS EKS error You must be logged in to the server (Unauthorized)

问题描述 当获取了 EKS kubeconfig 后,使用该 kubeconfig 提示如下报错 bash 1 2 $ kubectl get pod --kubeconfig kubeconfig error: You must be logged in to the server (Unauthorized) 但该 IAM 用户已经存在了管理员权限了 问题原因 该文章有对这个问题进行描述 quote 您不是集群创建者 如果您的 IAM 实体未用于创建集群,说明您不是集群创建者。在这种情况下,请完成以下步骤,将您的 IAM 实体映射到 aws-auth ConfigMap 以允许访问集群 [1] 这里检查和文章描述一致, 但还是这样的问题 bash 1 2 3 4 5 6 $ aws sts get-caller-identity { "UserId": "AIDAXxxxxxxxIIWKMR22Q", "Account": "55555555496", "Arn": "arn:aws:iam::55555555496:user/eks-user" } quote 这是因为,必须将该用户作为集群的 Access 进行关联,而不是授权 “EKS*” 相关权限 图 - 集群用户 选择已经存在的 IAM 用户...

 ·  · 

解决openvpn与其他vpn路由冲突问题

需求分析 openvpn在调研时不支持分流配置,需求是openvpn的开启不要影响现有的网络环境。在经过调研,发现 openvpn配置文件可以使用一些指令来指定访问某些地址的路由经过openvpn的设备,这样就可以实现了流量分流。 配置指令说明 这里主要用到了下面的参数 指令 说明 dhcp-option 添加额外的网络参数,可以是在客户端配置,或者服务端推送,这里有指定 DNS redirect-gateway def1 使用这个 def1 flag 可以使用0.0.0.0/1 and 128.0.0.0/1 来覆盖默认路由,这里的好处是不会擦除原有的默认网关 route 可以在建立连接后,自动添加一些路由,并且在TUN/TAP设备关闭后,自动销毁 gateway 默认来自 第二参数或者默认网关,第二参数为 vpn_gateway 指远端的vpn地址 net_gateway 指 per-existing IP默认网关 route-nopull 当在客户端使用时,此选项有效禁止从Server将路由添加到客户端的路由表中,但是请注意,此选项仍然允许 Server 设置TCP/IP 客户端TUN/TAP接口的属性 (这里主要用作创建openvpn自己的网络接口)。 pull-filter 忽略server端push 的资源,这些选项就是来自 —pul 或者其他选项的,例如其他选项 dhcp-option/route/gateway 等。 最终的配置为 text 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 client proto udp explicit-exit-notify remote x....

 ·  · 

物理机断电导致osd故障排查记录

ceph版本 nautilus 处理过程 查看 ceph 集群状态 bash 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 ceph -s cluster: id: baf87797-3ec1-4f2c-8126-bf0a44051b13 health: HEALTH_WARN 3 osds down 1 host (3 osds) down 1 pools have many more objects per pg than average Degraded data redundancy: 1167403/4841062 objects degraded (24.115%), 391 pgs degraded, 412 pgs undersized services: mon: 3 daemons, quorum 10....

 ·  · 

Goswagger - Skipping '', recursion detected

问题:当使用的结构体为嵌套格式,会提示 recursion detected 或 cannot find type definition go 1 2 3 4 5 6 7 8 9 10 11 type Instance struct { metav1.TypeMeta Instances []InstanceItem `json:"instances" yaml:"instances" form:"instances" binding:"required"` ServiceSelector map[string]string `json:"serivce_selector" yaml:"serivce_selector" form:"serivce_selector"` } type InstanceItem struct { Name string `json:"name" yaml:"name" form:"name" binding:"required"` PromEndpoint string `json:"prom_endpoint" yaml:"prom_endpoint" form:"prom_endpoint" binding:"required"` Labels map[string]string `json:"labels" yaml:"labels" form:"labels"` } go swagger 注释为 text 1 2 3 4 5 6 7 8 9 10 // deleteInstance godoc // @Summary Remove prometheus instance....

 ·  · 

Gin - 参数默认值问题

遇到问题:gin 使用 Bind 时无法填充,改成下面代码可以获取到 go 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 type User struct { Name string `form:"name,default=user1" json:"name,default=user2"` Age int `form:"age,default=10" json:"age,default=20"` } r := gin.Default() // way1 curl 127.0.0.1:8900/bind?name=aa // way2 curl -X POST 127.0.0.1:8900/bind -d "name=aa&age=30" // way3 curl -X POST 127.0.0.1:8900/bind -H "Content-Type: application/json" -d "{\"name\": \"aa\"}" r....

 ·  ·