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

bug: 在K8S的Pod中无法获取K8S的配置 #111

Open
a11enhuang opened this issue Oct 28, 2022 · 1 comment
Open

bug: 在K8S的Pod中无法获取K8S的配置 #111

a11enhuang opened this issue Oct 28, 2022 · 1 comment

Comments

@a11enhuang
Copy link

apisix-go-plugin-runner中使用了client-go作为K8S客户端,尝试从K8SConfigMaps中获取配置数据,用来初始化插件。

APISIX-SERVER部署在GKE中,并且配置文件中也指定了执行Go插件

ext-plugin:
        cmd: ["/plugins/go-runner", "run"]

但是在集群中启动时无法获取K8S的配置信息。

初始化代码如下:

config, err := rest.InClusterConfig()
2022/10/28 02:51:23 [warn] 65#65: *186 [lua] init.lua:913: W1028 02:51:23.682992 1084 client_config.go:617] Neither --kubeconfig nor --master was specified. Using the inClusterConfig. This might not work.
--
Fri, Oct 28 2022 10:51:23 am | , context: ngx.timer
Fri, Oct 28 2022 10:51:23 am | 2022/10/28 02:51:23 [warn] 65#65: *186 [lua] init.lua:913: W1028 02:51:23.683029 1084 client_config.go:622] error creating inClusterConfig, falling back to default config: unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined
Fri, Oct 28 2022 10:51:23 am | , context: ngx.timer
Fri, Oct 28 2022 10:51:23 am | 2022/10/28 02:51:23 [warn] 65#65: *186 [lua] init.lua:913: panic: invalid configuration: no configuration has been provided, try setting KUBERNETES_MASTER environment variable
@soulbird
Copy link
Contributor

Looks like this is a problem unrelated to apisix-go-plugin-runner.
Try to troubleshoot possible causes based on this error log:

Neither --kubeconfig nor --master was specified. Using the inClusterConfig. This might not work.

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

No branches or pull requests

2 participants