Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用redis缓存token不生效 #18

Open
lycnothing opened this issue Mar 25, 2021 · 6 comments
Open

使用redis缓存token不生效 #18

lycnothing opened this issue Mar 25, 2021 · 6 comments
Labels
resolved resolved

Comments

@lycnothing
Copy link

如下命令,似乎use_redis_token_cache并没生效,是设置错了么?
docker run --rm --name="webkubectl" -p 8889:8080 --privileged -e GOTTY_OPTIONS="--port 8080 --permit-write --permit-arguments --use_redis_token_cache true --redis_addr x.x.x.x" kubeoperator/webkubectl:v2.8.0

@liqiang-fit2cloud
Copy link
Collaborator

容器日志里有报错么?

@lycnothing
Copy link
Author

容器日志里有报错么?

没有,去掉redis_addr也没报“redis addr must not be null”,

@lycnothing
Copy link
Author

lycnothing commented Mar 25, 2021

容器日志里有报错么?

没有,去掉redis_addr也没报“redis addr must not be null”,

日志如下:
docker run --rm --name="webkubectl" -p 8889:8080 --privileged -e GOTTY_OPTIONS="--port 8081 --permit-write --permit-arguments --use_redis_token_cache true --redis_addr x.x.x.x:6379" kubeoperator/webkubectl:v2.8.0
Environment variables:
GOTTY_OPTIONS=--port 8081 --permit-write --permit-arguments --use_redis_token_cache true --redis_addr x.x.x.x:6379
HOSTNAME=6ef5e269e4fe
WELCOME_BANNER=Welcome to Web Kubectl, try kubectl --help.
PWD=/
HOME=/root
SHLVL=1
KUBECTL_INSECURE_SKIP_TLS_VERIFY=true
SESSION_STORAGE_SIZE=10M
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
KUBECTL_VERSION=v1.20.2
_=/usr/bin/env
2021/03/25 03:43:58 Welcome to use webkubectl.
2021/03/25 03:43:58 GoTTY is starting with command: /opt/webkubectl/start-session.sh
2021/03/25 03:43:58 Permitting clients to write input to the PTY.
2021/03/25 03:43:58 HTTP server is listening at: http://:::8081

@liqiang-fit2cloud
Copy link
Collaborator

已经重现问题,正在尝试修复。

@liqiang-fit2cloud
Copy link
Collaborator

Hi,
请试试最新的2.9.0版本。https://github.com/KubeOperator/webkubectl/releases/tag/2.9.0
image

直接用环境变量就可以:
docker run --name="webkubectl" -p 8080:8080 -e GOTTY_USE_REDIS_TOKEN_CACHE=true -e GOTTY_REDIS_ADDR=10.1.10.56:6379 -d --privileged kubeoperator/webkubectl:v2.9.0
用GOTTY_OPTIONS也可以:
docker run --rm --name="webkubectl" -p 8889:8080 --privileged -e GOTTY_OPTIONS="--port 8080 --permit-write --permit-arguments --use-redis-token-cache true --redis-addr 10.1.10.56:6379" kubeoperator/webkubectl:v2.9.0
其中,redis-addr是ip:port。

@lycnothing
Copy link
Author

Hi,
请试试最新的2.9.0版本。https://github.com/KubeOperator/webkubectl/releases/tag/2.9.0
image

直接用环境变量就可以:
docker run --name="webkubectl" -p 8080:8080 -e GOTTY_USE_REDIS_TOKEN_CACHE=true -e GOTTY_REDIS_ADDR=10.1.10.56:6379 -d --privileged kubeoperator/webkubectl:v2.9.0
用GOTTY_OPTIONS也可以:
docker run --rm --name="webkubectl" -p 8889:8080 --privileged -e GOTTY_OPTIONS="--port 8080 --permit-write --permit-arguments --use-redis-token-cache true --redis-addr 10.1.10.56:6379" kubeoperator/webkubectl:v2.9.0
其中,redis-addr是ip:port。

嗯,可以了~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
resolved resolved
Projects
None yet
Development

No branches or pull requests

3 participants