-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f1d1ed8
commit 6a03009
Showing
4 changed files
with
120 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
## 下载chart至本地 | ||
|
||
```shell | ||
helm repo add bitnami https://charts.bitnami.com/bitnami | ||
helm pull bitnami/redis --version=17.9.4 --untar | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
## 挂载Pvc失败提示已被占用 | ||
|
||
错误描述: | ||
|
||
```shell | ||
image replicapool/csi-vol-1d14612c-6e37-11ee-a86b-5a729ca4e4e3 is still being used | ||
``` | ||
|
||
**解决流程:** | ||
|
||
查询rbd对象管理端Pod | ||
|
||
```shell | ||
for pod in `kubectl -n rook-ceph get pods|grep rbdplugin|grep -v provisioner|awk '{print $1}'`; do echo $pod; kubectl exec -it -n rook-ceph $pod -c csi-rbdplugin -- rbd device list; done|grep csi-vol-1d14612c-6e37-11ee-a86b-5a729ca4e4e3 -C 3 | ||
``` | ||
连接rbd csi-rbdplugin | ||
```shell | ||
kubectl exec -it csi-rbdplugin-8w8wx -n rook-ceph -c csi-rbdplugin -- bash | ||
``` | ||
确认 | ||
```shell | ||
rbd device list|grep csi-vol-1d14612c-6e37-11ee-a86b-5a729ca4e4e3 | ||
0 replicapool csi-vol-1d14612c-6e37-11ee-a86b-5a729ca4e4e3 - /dev/rbd0 | ||
``` | ||
强制卸载映射 | ||
```shell | ||
rbd unmap -o force /dev/rbd0 | ||
``` | ||
恢复使用 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
## | ||
获取 client ip | ||
|
||
## 环境说明 | ||
|
||
all in one | ||
|
||
kubesphere 版本:v3.4.1 | ||
|
||
kubernetes 版本: v1.23.17 | ||
|
||
client_ip: 192.168.1.2 | ||
|
||
cni: cilium | ||
|
||
cilium_host ip 10.233.64.175 | ||
|
||
server ip 10.8.0.2 | ||
gateway ip 10.8.0.2 | ||
|
||
|
||
## 程序代码片段 | ||
|
||
非常简单的一个 RESTFUL 接口,返回调用者 Request 头相关值信息 | ||
|
||
```golang | ||
package main | ||
|
||
import ( | ||
"github.com/gin-gonic/gin" | ||
) | ||
|
||
func main() { | ||
r := gin.Default() | ||
r.GET("/ppp", func(c *gin.Context) { | ||
c.JSON(200, gin.H{ | ||
"remote_addr": c.RemoteIP(), | ||
"client_ip": c.ClientIP(), | ||
"X-Forwarded-For": c.GetHeader("X-Forwarded-For"), | ||
}) | ||
}) | ||
r.Run() // listen and serve on 0.0.0.0:8080 | ||
} | ||
|
||
``` | ||
|
||
### 调用链路 | ||
|
||
browser -> ks gateway -> svc -> pod | ||
|
||
## 默认方式访问: 获取的客户端地址为node节点ip | ||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
`default_type application/pdf;` | ||
|
||
```shell | ||
location = /pdf_carpet { | ||
alias /var/www/html/pdf_carpet/file.pdf; | ||
default_type application/pdf; | ||
add_header Content-Disposition 'inline'; | ||
} | ||
``` | ||
|
||
如果访问 PDF 文件的 URI 以斜杠结尾(或者它是一个特殊情况的根 URI),则上述配置将不起作用,因为 nginx 会将索引文件名附加到这样的 URI(使location = /path/ { ... }不匹配$uri内部 nginx 变量)。对于这种情况,可以使用另一种技术: | ||
|
||
```shell | ||
location = / { | ||
root /var/www/html/pdf_carpet; | ||
rewrite ^ /file.pdf break; | ||
add_header Content-Disposition 'inline'; | ||
} | ||
``` | ||
|
||
源:https://devpress.csdn.net/cloud/630546977e6682346619dd7e.html |