Skip to content

Commit

Permalink
chore: remove some useless code about kubernetes and tars stream disc…
Browse files Browse the repository at this point in the history
…overy (#9926)
  • Loading branch information
ronething authored Aug 4, 2023
1 parent d80fc3b commit 6278ae0
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 25 deletions.
7 changes: 1 addition & 6 deletions apisix/discovery/kubernetes/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ local error = error
local pcall = pcall
local setmetatable = setmetatable
local is_http = ngx.config.subsystem == "http"
local support_process, process = pcall(require, "ngx.process")
local process = require("ngx.process")
local core = require("apisix.core")
local util = require("apisix.cli.util")
local local_conf = require("apisix.core.config_local").local_conf()
Expand Down Expand Up @@ -520,11 +520,6 @@ end


function _M.init_worker()
if not support_process then
core.log.error("kubernetes discovery not support in subsystem: ", ngx.config.subsystem,
", please check if your openresty version >= 1.19.9.1 or not")
return
end
local discovery_conf = local_conf.discovery.kubernetes
core.log.info("kubernetes discovery conf: ", core.json.delay_encode(discovery_conf))
if #discovery_conf == 0 then
Expand Down
8 changes: 1 addition & 7 deletions apisix/discovery/tars/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ local local_conf = require("apisix.core.config_local").local_conf()
local core = require("apisix.core")
local mysql = require("resty.mysql")
local is_http = ngx.config.subsystem == "http"
local support_process, process = pcall(require, "ngx.process")
local process = require("ngx.process")

local endpoint_dict

Expand Down Expand Up @@ -343,12 +343,6 @@ local function get_endpoint_dict()
end

function _M.init_worker()
if not support_process then
core.log.error("tars discovery not support in subsystem: ", ngx.config.subsystem,
", please check if your openresty version >= 1.19.9.1 or not")
return
end

endpoint_dict = get_endpoint_dict()
if not endpoint_dict then
error("failed to get lua_shared_dict: tars, please check your APISIX version")
Expand Down
6 changes: 0 additions & 6 deletions docs/en/latest/discovery/kubernetes.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@ The [_Kubernetes_](https://kubernetes.io/) service discovery [_List-Watch_](http

Discovery also provides a node query interface in accordance with the [_APISIX Discovery Specification_](../discovery.md).

:::note

use kubernetes discovery in L4 require OpenResty version >= 1.19.9.1

:::

## How To Use

Kubernetes service discovery both support single-cluster and multi-cluster modes, applicable to the case where the service is distributed in single or multiple Kubernetes clusters.
Expand Down
6 changes: 0 additions & 6 deletions docs/zh/latest/discovery/kubernetes.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@ Kubernetes 服务发现以 [_List-Watch_](https://kubernetes.io/docs/reference/u

同时遵循 [_APISIX Discovery 规范_](../discovery.md) 提供了节点查询接口。

:::note

在四层中使用 Kubernetes 服务发现要求 OpenResty 版本大于等于 1.19.9.1

:::

## Kubernetes 服务发现的使用

目前 Kubernetes 服务发现支持单集群和多集群模式,分别适用于待发现的服务分布在单个或多个 Kubernetes 的场景。
Expand Down

0 comments on commit 6278ae0

Please sign in to comment.