apache / apache/apisix-go-plugin-runner

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

Open
#111 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
198
Forks
68
PR merge metrics
No merged PRs in 30d

Description

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

`APISIX-SERVER`部署在`GKE`中,并且配置文件中也指定了执行Go插件
```
ext-plugin:
cmd: ["/plugins/go-runner", "run"]
```
但是在集群中启动时无法获取`K8S`的配置信息。

初始化代码如下:
```go
config, err := rest.InClusterConfig()
```

```text
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
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.