This is an automated email from the ASF dual-hosted git repository.

tokers pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix-ingress-controller.git


The following commit(s) were added to refs/heads/master by this push:
     new 0b15c20  chore: remove ApisixService CRD (#230)
0b15c20 is described below

commit 0b15c20d15ded6c8c9c149ef5f9ba2bb7e3b961b
Author: Alex Zhang <[email protected]>
AuthorDate: Fri Feb 5 10:55:23 2021 +0800

    chore: remove ApisixService CRD (#230)
---
 Makefile                                           |   1 -
 README.md                                          |   2 +-
 .../crds/customresourcedefinitions.yaml            |  18 --
 docs/CRD-specification.md                          |  37 ----
 docs/design.md                                     |  17 +-
 docs/usage.md                                      |  66 +------
 pkg/ingress/apisix/service.go                      | 104 ----------
 pkg/ingress/controller/apisix_service.go           | 216 ---------------------
 pkg/ingress/controller/apisix_tls.go               |   2 +-
 pkg/ingress/controller/controller.go               |  13 --
 pkg/kube/apisix/apis/config/v1/register.go         |   2 -
 pkg/kube/apisix/apis/config/v1/types.go            |  27 ---
 .../apisix/apis/config/v1/zz_generated.deepcopy.go |  87 ---------
 .../versioned/typed/config/v1/apisixservice.go     | 178 -----------------
 .../versioned/typed/config/v1/config_client.go     |   5 -
 .../typed/config/v1/fake/fake_apisixservice.go     | 130 -------------
 .../typed/config/v1/fake/fake_config_client.go     |   4 -
 .../typed/config/v1/generated_expansion.go         |   2 -
 .../externalversions/config/v1/apisixservice.go    |  90 ---------
 .../externalversions/config/v1/interface.go        |   7 -
 .../client/informers/externalversions/generic.go   |   2 -
 .../client/listers/config/v1/apisixservice.go      |  99 ----------
 .../listers/config/v1/expansion_generated.go       |   8 -
 pkg/seven/state/service_worker.go                  |  22 +--
 samples/deploy/crd/v1beta1/ApisixService.yaml      |  34 ----
 samples/deploy/crd/v1beta1/kustomization.yaml      |   1 -
 samples/deploy/rbac/apisix_view_clusterrole.yaml   |   1 -
 27 files changed, 12 insertions(+), 1163 deletions(-)

diff --git a/Makefile b/Makefile
index 17edd13..c584e2d 100644
--- a/Makefile
+++ b/Makefile
@@ -63,7 +63,6 @@ unit-test:
 e2e-test: ginkgo-check build-image-to-minikube
        kubectl apply -f $(PWD)/samples/deploy/crd/v1beta1/ApisixRoute.yaml
        kubectl apply -f $(PWD)/samples/deploy/crd/v1beta1/ApisixUpstream.yaml
-       kubectl apply -f $(PWD)/samples/deploy/crd/v1beta1/ApisixService.yaml
        kubectl apply -f $(PWD)/samples/deploy/crd/v1beta1/ApisixTls.yaml
        cd test/e2e && ginkgo -cover -coverprofile=coverage.txt -r 
--randomizeSuites --randomizeAllSpecs --trace -p --nodes=$(E2E_CONCURRENCY)
 
diff --git a/README.md b/README.md
index ef52271..327472d 100644
--- a/README.md
+++ b/README.md
@@ -54,7 +54,7 @@ This project is currently considered experimental.
 
 - Define the CRD(CustomResourceDefinition) needed by Apache APISIX
 
-- Currently supports ApisixRoute/ApisixService/ApisixUpstream,and other 
service and route level plugins.
+- Currently supports ApisixRoute/ApisixUpstream,and other service and route 
level plugins.
 
 - Can be packaged as a stand-alone binary, keep in sync with the ingress 
definition.
 
diff --git 
a/charts/apisix-ingress-controller/crds/customresourcedefinitions.yaml 
b/charts/apisix-ingress-controller/crds/customresourcedefinitions.yaml
index 0ce112f..58544a0 100644
--- a/charts/apisix-ingress-controller/crds/customresourcedefinitions.yaml
+++ b/charts/apisix-ingress-controller/crds/customresourcedefinitions.yaml
@@ -68,21 +68,3 @@ spec:
     kind: ApisixUpstream
     shortNames:
       - au
----
-apiVersion: apiextensions.k8s.io/v1beta1
-kind: CustomResourceDefinition
-metadata:
-  name: apisixservices.apisix.apache.org
-spec:
-  group: apisix.apache.org
-  versions:
-    - name: v1
-      served: true
-      storage: true
-  scope: Namespaced
-  names:
-    plural: apisixservices
-    singular: apisixservice
-    kind: ApisixService
-    shortNames:
-      - as
diff --git a/docs/CRD-specification.md b/docs/CRD-specification.md
index c1d6e5e..f5639af 100644
--- a/docs/CRD-specification.md
+++ b/docs/CRD-specification.md
@@ -24,7 +24,6 @@ In order to control the behavior of the proxy ([Apache 
APISIX](https://github.co
 ## CRD Types
 
 - [ApisixRoute](#apisixroute)
-- [ApisixService](#apisixservice)
 - [ApisixUpstream](#apisixupstream)
 - [ApisixTls](#apisixtls)
 
@@ -101,42 +100,6 @@ spec:
 | `k8s.apisix.apache.org/ingress.class`          | string     | Grouping of 
ingress.                                               |
 | `k8s.apisix.apache.org/whitelist-source-range` | array      | Whitelist of 
IPs allowed to be accessed.                           |
 
-## ApisixService
-
-`ApisixService` corresponds to the `Service` object in Apache APISIX.
-A `Service` is an abstraction of an API (which can also be understood as a set 
of Route abstractions). It usually corresponds to the upstream service 
abstraction. Between `Route` and `Service`, usually the relationship of N:1.
-To learn more, please check the [Apache APISIX architecture-design 
docs](https://github.com/apache/apisix/blob/master/doc/architecture-design.md#service).
-
-Structure example:
-
-```yaml
-apiVersion: apisix.apache.org/v1
-kind: ApisixService
-metadata:
-  name: httpserver
-  namespace: cloud  
-spec:
-  upstream: httpserver
-  port: 8080
-  plugins:
-    - name: limit-count
-      enable: true
-      config:
-        count: 2
-        time_window: 60
-        rejected_code: 503
-        key: remote_addr
-```
-
-|     Field     |  Type    | Description    |
-|---------------|----------|----------------|
-| upstream      | string   | The name of the upstream service.    |
-| port          | int      | The port number of the upstream service.    |
-| plugins       | array   | Custom plugin collection (Plugins defined in the 
`service` level). For more plugin information, please refer to the [Apache 
APISIX plugins docs](https://github.com/apache/apisix/tree/master/doc/plugins). 
|
-| name          | string   | The name of the plugin. For more information 
about the example plugin, please check the [limit-count 
docs](https://github.com/apache/apisix/blob/master/doc/plugins/limit-count.md#Attributes).
    |
-| enable        | boolean  | Whether to enable the plugin, `true`: means 
enable, `false`: means disable.      |
-| config        | object   | Configuration of plugin information. Note: The 
check of configuration schema is missing now, so please be careful when 
editing.    |
-
 ## ApisixUpstream
 
 `ApisixUpstream` corresponds to the `Upstream` object in Apache APISIX.
diff --git a/docs/design.md b/docs/design.md
index 2439ae8..e58b7c8 100644
--- a/docs/design.md
+++ b/docs/design.md
@@ -29,7 +29,7 @@ Apache APISIX ingress for Kubernetes.
 
 - defines the CRD(CustomResourceDefinition) needed by Apache APISIX
 
-- currently supports ApisixRoute/ApisixService/ApisixUpstream,and other 
service and route level plugins;
+- currently supports ApisixRoute/ApisixUpstream,and other service and route 
level plugins;
 
 - can be packaged as a stand-alone binary, keep in sync with the ingress 
definition;
 
@@ -57,14 +57,12 @@ Apache APISIX ingress for Kubernetes.
 
 ## CRD design
 
-Currently `apisix-ingress-controller` CRDs consist of 3 parts: 
ApisixRoute/ApisixService/ApisixUpstream. The design follows the following 
ideas.
+Currently `apisix-ingress-controller` CRDs consist of 3 parts: 
ApisixRoute/ApisixUpstream. The design follows the following ideas.
 
 1. The most important part of the gateway is the route part, which is used to 
define the distribution rules of the gateway traffics.
 2. In order to facilitate understanding and configuration, the design 
structure of `ApisixRoute` is basically similar to Kubernetes Ingress.
 3. In the design of annotation, the structure of Kubernetes Ingress is used 
for reference, but the internal implementation is based on the plug-in of 
Apache APISIX.
-4. Both `ApisixRoute` and `ApisixService` can be bound to plug-ins, which is 
consistent with Apache APISIX.
-5. In the simplest case, you only need to define `ApisixRoute`, and the 
Ingress controller will automatically add `ApisixService` and `ApisixUpstream`.
-6. `ApisixService`, like Apache APISIX service, is a grouping of routes, which 
can simplify the configuration complexity of the same plug-in.
+5. In the simplest case, you only need to define `ApisixRoute`, and the 
Ingress controller will automatically add `ApisixUpstream`.
 7. `ApisixUpstream` can define some details on Apache APISIX upstream, such as 
load balancing/health check, etc.
 
 ## Monitoring CRDs
@@ -93,19 +91,12 @@ They are a many-to-many relationship.Therefore, 
`apisix-ingress-controller` has
 
 ### Cascade update
 
-At present, we have defined multiple CRDs, and these CRDs are responsible for 
the definition of their respective fields. `ApisixRoute`/ `ApisixService` / 
`ApisixUpstream` correspond to objects such as `route`/ `service` / `upstream` 
in Apache APISIX. As the strong binding relationship between APISIX objects, 
when modifying and deleting batch data structures such as CRDs, you have to 
consider the impact of cascading between objects.
+At present, we have defined multiple CRDs, and these CRDs are responsible for 
the definition of their respective fields. `ApisixRoute`/ `ApisixUpstream` 
correspond to objects such as `route`/ `service` / `upstream` in Apache APISIX. 
As the strong binding relationship between APISIX objects, when modifying and 
deleting batch data structures such as CRDs, you have to consider the impact of 
cascading between objects.
 
 So, in `apisix-ingress-controller`, a broadcast notification mechanism is 
designed through `channel`, that is, the definition of any object must be 
notified to other objects related to it and trigger the corresponding behavior.
 
 ![hierarchical](./images/cascade-update.png)
 
-In a typical scenario, there is a many-to-many relationship between 
`ApisixRoute` and `ApisixService`, and a one-to-one relationship between 
`ApisixService` and `ApisixUpstream`.
-
-* When the `ApisixService` changes, it needs to be notified upwards to the 
`ApisixRoute`, and also needs to be notified downwards to the corresponding 
`ApisixUpstream`.
-* When one of the `http-route` in `ApisixRoute` changes, the relevant 
`ApisixService` and `ApisixUpstream` need to be notified.
-
-This is particularly prominent in `modify` and `delete`.
-
 **We can initiate discussions in this area and propose a more reasonable 
design plan**
 
 ### Diff rules
diff --git a/docs/usage.md b/docs/usage.md
index 557b386..822c8da 100644
--- a/docs/usage.md
+++ b/docs/usage.md
@@ -55,19 +55,7 @@ spec:
       key: hello
 ```
 
-2. Define Service with `ApisixService`
-
-```yaml
-apiVersion: apisix.apache.org/v1
-kind: ApisixService
-metadata:
-  name: foo
-spec:
-  upstream: foo
-  port: 8080
-```
-
-3. Define Route with `ApisixRoute`
+2. Define Route with `ApisixRoute`
 
 ```yaml
 apiVersion: apisix.apache.org/v1
@@ -120,55 +108,3 @@ curl -XPUT http://127.0.0.1:9080/apisix/admin/routes/3 -H 
'X-API-KEY: edd1c9f034
     "service_id": "2"
 }'
 ```
-
-## Add a plugin
-
-Next, take the `proxy-rewrite` plugin as an example.
-
-Add plug-ins through admin api to achieve the purpose of rewriting upstream 
uri.
-
-e.g. test.apisix.apache.org/hello -> test-rewrite.apisix.apache.org/copy/hello
-
-With CRDs, use `ApisixService` as example.
-
-```yaml
-apiVersion: apisix.apache.org/v1
-kind: ApisixService
-metadata:
-  name: foo
-spec:
-  upstream: foo
-  port: 8080
-  plugins:
-  - enable: true
-    name: proxy-rewrite
-    config:
-    regex_uri:
-    - '^/(.*)'
-    - '/copy/$1'
-    scheme: http
-    host: test-rewrite.apisix.apache.org
-```
-
-For facilitating understanding, show the way with `Admin API` as below.
-
-```shell
-curl http://127.0.0.1:9080/apisix/admin/services/2 -H 'X-API-KEY: 
edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
-{
-    "desc": "foo-service",
-    "upstream_id": "1",
-    "plugins": {
-        "proxy-rewrite": {
-            "regex_uri": ["^/(.*)", "/copy/$1"],
-            "scheme": "http",
-            "host": "test-rewrite.apisix.apache.org"
-        }
-    }
-}'
-```
-
-It can be found that the way of defining plugins is almost the same, except 
that the format is changed from `json` to `yaml`.
-
-By defining the plug-in in CRDs, you can disable the plug-in by setting 
`enable: false` without deleting it. Keep the original configuration for easy 
opening next time.
-
-Tips: ApisixRoute and ApisixService both support plugins definition.
diff --git a/pkg/ingress/apisix/service.go b/pkg/ingress/apisix/service.go
deleted file mode 100644
index c09e8c7..0000000
--- a/pkg/ingress/apisix/service.go
+++ /dev/null
@@ -1,104 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements.  See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License.  You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-package apisix
-
-import (
-       "strconv"
-
-       "github.com/apache/apisix-ingress-controller/pkg/ingress/endpoint"
-       configv1 
"github.com/apache/apisix-ingress-controller/pkg/kube/apisix/apis/config/v1"
-       "github.com/apache/apisix-ingress-controller/pkg/seven/conf"
-       apisix "github.com/apache/apisix-ingress-controller/pkg/types/apisix/v1"
-)
-
-const (
-       ApisixService = "ApisixService"
-)
-
-type ApisixServiceCRD configv1.ApisixService
-
-// Convert convert to  apisix.Service from ingress.ApisixService CRD
-func (as *ApisixServiceCRD) Convert() ([]*apisix.Service, []*apisix.Upstream, 
error) {
-       ns := as.Namespace
-       name := as.Name
-       // meta annotation
-       pluginsInAnnotation, group := BuildAnnotation(as.Annotations)
-       conf.AddGroup(group)
-       services := make([]*apisix.Service, 0)
-       upstreams := make([]*apisix.Upstream, 0)
-       rv := as.ObjectMeta.ResourceVersion
-       port := as.Spec.Port
-       upstreamName := as.Spec.Upstream
-       // apisix upstream name = namespace_upstreamName_svcPort
-       apisixUpstreamName := ns + "_" + upstreamName + "_" + 
strconv.Itoa(int(port))
-       apisixServiceName := ns + "_" + name + "_" + strconv.Itoa(int(port))
-       fromKind := ApisixService
-       // plugins
-       plugins := as.Spec.Plugins
-       pluginRet := apisix.Plugins{}
-       // 1.from annotations
-       for k, v := range pluginsInAnnotation {
-               pluginRet[k] = v
-       }
-       // 2.from service plugins
-       for _, p := range plugins {
-               if p.Enable {
-                       if p.Config != nil {
-                               pluginRet[p.Name] = p.Config
-                       } else if p.ConfigSet != nil {
-                               pluginRet[p.Name] = p.ConfigSet
-                       } else {
-                               pluginRet[p.Name] = make(map[string]interface{})
-                       }
-               }
-       }
-       // fullServiceName
-       fullServiceName := apisixServiceName
-       if group != "" {
-               fullServiceName = group + "_" + apisixServiceName
-       }
-
-       service := &apisix.Service{
-               FullName:        fullServiceName,
-               Group:           group,
-               ResourceVersion: rv,
-               Name:            apisixServiceName,
-               UpstreamName:    apisixUpstreamName,
-               FromKind:        fromKind,
-               Plugins:         pluginRet,
-       }
-       services = append(services, service)
-       // upstream
-       // fullUpstreamName
-       fullUpstreamName := apisixUpstreamName
-       if group != "" {
-               fullUpstreamName = group + "_" + apisixUpstreamName
-       }
-       LBType := DefaultLBType
-       nodes := endpoint.BuildEps(ns, upstreamName, int(port))
-       upstream := &apisix.Upstream{
-               Metadata: apisix.Metadata{
-                       FullName:        fullUpstreamName,
-                       Group:           group,
-                       ResourceVersion: rv,
-                       Name:            apisixUpstreamName,
-               },
-               Type:     LBType,
-               Nodes:    nodes,
-               FromKind: fromKind,
-       }
-       upstreams = append(upstreams, upstream)
-       return services, upstreams, nil
-}
diff --git a/pkg/ingress/controller/apisix_service.go 
b/pkg/ingress/controller/apisix_service.go
deleted file mode 100644
index 162c7c3..0000000
--- a/pkg/ingress/controller/apisix_service.go
+++ /dev/null
@@ -1,216 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements.  See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License.  You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-package controller
-
-import (
-       "fmt"
-       "time"
-
-       "k8s.io/apimachinery/pkg/api/errors"
-       "k8s.io/apimachinery/pkg/util/runtime"
-       "k8s.io/apimachinery/pkg/util/wait"
-       "k8s.io/client-go/kubernetes"
-       "k8s.io/client-go/kubernetes/scheme"
-       "k8s.io/client-go/tools/cache"
-       "k8s.io/client-go/util/workqueue"
-
-       "github.com/apache/apisix-ingress-controller/pkg/ingress/apisix"
-       configv1 
"github.com/apache/apisix-ingress-controller/pkg/kube/apisix/apis/config/v1"
-       clientset 
"github.com/apache/apisix-ingress-controller/pkg/kube/apisix/client/clientset/versioned"
-       apisixscheme 
"github.com/apache/apisix-ingress-controller/pkg/kube/apisix/client/clientset/versioned/scheme"
-       informersv1 
"github.com/apache/apisix-ingress-controller/pkg/kube/apisix/client/informers/externalversions/config/v1"
-       listersv1 
"github.com/apache/apisix-ingress-controller/pkg/kube/apisix/client/listers/config/v1"
-       "github.com/apache/apisix-ingress-controller/pkg/log"
-       "github.com/apache/apisix-ingress-controller/pkg/seven/state"
-)
-
-type ApisixServiceController struct {
-       controller          *Controller
-       kubeclientset       kubernetes.Interface
-       apisixClientset     clientset.Interface
-       apisixServiceList   listersv1.ApisixServiceLister
-       apisixServiceSynced cache.InformerSynced
-       workqueue           workqueue.RateLimitingInterface
-}
-
-func BuildApisixServiceController(
-       kubeclientset kubernetes.Interface,
-       apisixServiceClientset clientset.Interface,
-       apisixServiceInformer informersv1.ApisixServiceInformer,
-       root *Controller) *ApisixServiceController {
-
-       runtime.Must(apisixscheme.AddToScheme(scheme.Scheme))
-       controller := &ApisixServiceController{
-               controller:          root,
-               kubeclientset:       kubeclientset,
-               apisixClientset:     apisixServiceClientset,
-               apisixServiceList:   apisixServiceInformer.Lister(),
-               apisixServiceSynced: apisixServiceInformer.Informer().HasSynced,
-               workqueue:           
workqueue.NewNamedRateLimitingQueue(workqueue.NewItemFastSlowRateLimiter(1*time.Second,
 60*time.Second, 5), "ApisixServices"),
-       }
-       apisixServiceInformer.Informer().AddEventHandler(
-               cache.ResourceEventHandlerFuncs{
-                       AddFunc:    controller.addFunc,
-                       UpdateFunc: controller.updateFunc,
-                       DeleteFunc: controller.deleteFunc,
-               })
-       return controller
-}
-
-type ServiceQueueObj struct {
-       Key    string                  `json:"key"`
-       OldObj *configv1.ApisixService `json:"old_obj"`
-       Ope    string                  `json:"ope"` // add / update / delete
-}
-
-func (c *ApisixServiceController) Run(stop <-chan struct{}) error {
-       // 同步缓存
-       if ok := cache.WaitForCacheSync(stop); !ok {
-               log.Error("同步ApisixService缓存失败")
-               return fmt.Errorf("failed to wait for caches to sync")
-       }
-       go wait.Until(c.runWorker, time.Second, stop)
-       return nil
-}
-
-func (c *ApisixServiceController) runWorker() {
-       for c.processNextWorkItem() {
-       }
-}
-
-func (c *ApisixServiceController) processNextWorkItem() bool {
-       defer recoverException()
-       obj, shutdown := c.workqueue.Get()
-       if shutdown {
-               return false
-       }
-       err := func(obj interface{}) error {
-               defer c.workqueue.Done(obj)
-               var sqo *ServiceQueueObj
-               var ok bool
-               if sqo, ok = obj.(*ServiceQueueObj); !ok {
-                       c.workqueue.Forget(obj)
-                       return fmt.Errorf("expected ServiceQueueObj in 
workqueue but got %#v", obj)
-               }
-               if err := c.syncHandler(sqo); err != nil {
-                       c.workqueue.AddRateLimited(obj)
-                       log.Errorf("sync service %s failed", sqo.Key)
-                       return fmt.Errorf("error syncing '%s': %s", sqo.Key, 
err.Error())
-               }
-
-               c.workqueue.Forget(obj)
-               return nil
-       }(obj)
-       if err != nil {
-               runtime.HandleError(err)
-       }
-       return true
-}
-
-func (c *ApisixServiceController) syncHandler(sqo *ServiceQueueObj) error {
-       namespace, name, err := cache.SplitMetaNamespaceKey(sqo.Key)
-       if err != nil {
-               log.Errorf("invalid resource key: %s", sqo.Key)
-               return fmt.Errorf("invalid resource key: %s", sqo.Key)
-       }
-       apisixServiceYaml := sqo.OldObj
-       if sqo.Ope == DELETE {
-               apisixIngressService, _ := 
c.apisixServiceList.ApisixServices(namespace).Get(name)
-               if apisixIngressService != nil && 
apisixIngressService.ResourceVersion > sqo.OldObj.ResourceVersion {
-                       log.Warnf("Service %s has been covered when retry", 
sqo.Key)
-                       return nil
-               }
-       } else {
-               apisixServiceYaml, err = 
c.apisixServiceList.ApisixServices(namespace).Get(name)
-               if err != nil {
-                       if errors.IsNotFound(err) {
-                               log.Infof("apisixService %s is removed", 
sqo.Key)
-                               return nil
-                       }
-                       runtime.HandleError(fmt.Errorf("failed to list 
apisixService %s/%s", sqo.Key, err.Error()))
-                       return err
-               }
-       }
-       apisixService := apisix.ApisixServiceCRD(*apisixServiceYaml)
-       services, upstreams, _ := apisixService.Convert()
-       comb := state.ApisixCombination{Routes: nil, Services: services, 
Upstreams: upstreams}
-       if sqo.Ope == DELETE {
-               return comb.Remove()
-       } else {
-               _, err = comb.Solver()
-               return err
-       }
-
-}
-
-func (c *ApisixServiceController) addFunc(obj interface{}) {
-       var key string
-       var err error
-       if key, err = cache.MetaNamespaceKeyFunc(obj); err != nil {
-               runtime.HandleError(err)
-               return
-       }
-       if !c.controller.namespaceWatching(key) {
-               return
-       }
-       sqo := &ServiceQueueObj{Key: key, OldObj: nil, Ope: ADD}
-       c.workqueue.AddRateLimited(sqo)
-}
-
-func (c *ApisixServiceController) updateFunc(oldObj, newObj interface{}) {
-       oldService := oldObj.(*configv1.ApisixService)
-       newService := newObj.(*configv1.ApisixService)
-       if oldService.ResourceVersion >= newService.ResourceVersion {
-               return
-       }
-       var key string
-       var err error
-       if key, err = cache.MetaNamespaceKeyFunc(newObj); err != nil {
-               runtime.HandleError(err)
-               return
-       }
-       if !c.controller.namespaceWatching(key) {
-               return
-       }
-       sqo := &ServiceQueueObj{Key: key, OldObj: oldService, Ope: UPDATE}
-       c.workqueue.AddRateLimited(sqo)
-}
-
-func (c *ApisixServiceController) deleteFunc(obj interface{}) {
-       oldService, ok := obj.(*configv1.ApisixService)
-       if !ok {
-               oldState, ok := obj.(cache.DeletedFinalStateUnknown)
-               if !ok {
-                       return
-               }
-               oldService, ok = oldState.Obj.(*configv1.ApisixService)
-               if !ok {
-                       return
-               }
-       }
-
-       var key string
-       var err error
-       key, err = cache.DeletionHandlingMetaNamespaceKeyFunc(obj)
-       if err != nil {
-               runtime.HandleError(err)
-               return
-       }
-       if !c.controller.namespaceWatching(key) {
-               return
-       }
-       sqo := &ServiceQueueObj{Key: key, OldObj: oldService, Ope: DELETE}
-       c.workqueue.AddRateLimited(sqo)
-}
diff --git a/pkg/ingress/controller/apisix_tls.go 
b/pkg/ingress/controller/apisix_tls.go
index 2871396..3ec0d2e 100644
--- a/pkg/ingress/controller/apisix_tls.go
+++ b/pkg/ingress/controller/apisix_tls.go
@@ -77,7 +77,7 @@ func BuildApisixTlsController(
 
 func (c *ApisixTLSController) Run(stop <-chan struct{}) error {
        if ok := cache.WaitForCacheSync(stop); !ok {
-               log.Errorf("sync ApisixService cache failed")
+               log.Errorf("sync ApisixTLS cache failed")
                return fmt.Errorf("failed to wait for caches to sync")
        }
        go wait.Until(c.runWorker, time.Second, stop)
diff --git a/pkg/ingress/controller/controller.go 
b/pkg/ingress/controller/controller.go
index 8160850..a08276d 100644
--- a/pkg/ingress/controller/controller.go
+++ b/pkg/ingress/controller/controller.go
@@ -254,8 +254,6 @@ func (c *Controller) run(ctx context.Context) {
        ac.ApisixRoute(c)
        // ApisixUpstream
        ac.ApisixUpstream(c)
-       // ApisixService
-       ac.ApisixService(c)
        // ApisixTLS
        ac.ApisixTLS(c)
 
@@ -315,17 +313,6 @@ func (api6 *Api6Controller) ApisixUpstream(controller 
*Controller) {
        }
 }
 
-func (api6 *Api6Controller) ApisixService(controller *Controller) {
-       asc := BuildApisixServiceController(
-               api6.KubeClientSet,
-               api6.Api6ClientSet,
-               api6.SharedInformerFactory.Apisix().V1().ApisixServices(),
-               controller)
-       if err := asc.Run(api6.Stop); err != nil {
-               log.Errorf("failed to run ApisixServiceController: %s", err)
-       }
-}
-
 func (api6 *Api6Controller) ApisixTLS(controller *Controller) {
        atc := BuildApisixTlsController(
                api6.KubeClientSet,
diff --git a/pkg/kube/apisix/apis/config/v1/register.go 
b/pkg/kube/apisix/apis/config/v1/register.go
index e9e0e18..28e502e 100644
--- a/pkg/kube/apisix/apis/config/v1/register.go
+++ b/pkg/kube/apisix/apis/config/v1/register.go
@@ -48,8 +48,6 @@ func addKnownTypes(scheme *runtime.Scheme) error {
                &ApisixRouteList{},
                &ApisixUpstream{},
                &ApisixUpstreamList{},
-               &ApisixService{},
-               &ApisixServiceList{},
                &ApisixTls{},
                &ApisixTlsList{},
        )
diff --git a/pkg/kube/apisix/apis/config/v1/types.go 
b/pkg/kube/apisix/apis/config/v1/types.go
index 4275106..ccc9fd0 100644
--- a/pkg/kube/apisix/apis/config/v1/types.go
+++ b/pkg/kube/apisix/apis/config/v1/types.go
@@ -121,33 +121,6 @@ type ApisixUpstreamList struct {
        Items           []ApisixUpstream `json:"items,omitempty"`
 }
 
-// +genclient
-// +genclient:noStatus
-
-// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
-// ApisixService is used to define the Service resource in APISIX, it's
-// useful to use Service to put all common configurations and let Route
-// to reference it.
-type ApisixService struct {
-       metav1.TypeMeta   `json:",inline" yaml:",inline"`
-       metav1.ObjectMeta `json:"metadata,omitempty" yaml:"metadata,omitempty"`
-       Spec              *ApisixServiceSpec `json:"spec,omitempty" 
yaml:"spec,omitempty"`
-}
-
-// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
-type ApisixServiceList struct {
-       metav1.TypeMeta `json:",inline"`
-       metav1.ListMeta `json:"metadata"`
-       Items           []ApisixService `json:"items,omitempty"`
-}
-
-// ApisixServiceSpec describes the ApisixService specification.
-type ApisixServiceSpec struct {
-       Upstream string   `json:"upstream,omitempty"`
-       Port     int      `json:"port,omitempty"`
-       Plugins  []Plugin `json:"plugins,omitempty"`
-}
-
 type Plugin struct {
        Name      string    `json:"name,omitempty"`
        Enable    bool      `json:"enable,omitempty"`
diff --git a/pkg/kube/apisix/apis/config/v1/zz_generated.deepcopy.go 
b/pkg/kube/apisix/apis/config/v1/zz_generated.deepcopy.go
index 93784ed..5ec8da8 100644
--- a/pkg/kube/apisix/apis/config/v1/zz_generated.deepcopy.go
+++ b/pkg/kube/apisix/apis/config/v1/zz_generated.deepcopy.go
@@ -128,93 +128,6 @@ func (in *ApisixSecret) DeepCopy() *ApisixSecret {
 }
 
 // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, 
writing into out. in must be non-nil.
-func (in *ApisixService) DeepCopyInto(out *ApisixService) {
-       *out = *in
-       out.TypeMeta = in.TypeMeta
-       in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
-       if in.Spec != nil {
-               in, out := &in.Spec, &out.Spec
-               *out = new(ApisixServiceSpec)
-               (*in).DeepCopyInto(*out)
-       }
-       return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, 
creating a new ApisixService.
-func (in *ApisixService) DeepCopy() *ApisixService {
-       if in == nil {
-               return nil
-       }
-       out := new(ApisixService)
-       in.DeepCopyInto(out)
-       return out
-}
-
-// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, 
creating a new runtime.Object.
-func (in *ApisixService) DeepCopyObject() runtime.Object {
-       if c := in.DeepCopy(); c != nil {
-               return c
-       }
-       return nil
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, 
writing into out. in must be non-nil.
-func (in *ApisixServiceList) DeepCopyInto(out *ApisixServiceList) {
-       *out = *in
-       out.TypeMeta = in.TypeMeta
-       in.ListMeta.DeepCopyInto(&out.ListMeta)
-       if in.Items != nil {
-               in, out := &in.Items, &out.Items
-               *out = make([]ApisixService, len(*in))
-               for i := range *in {
-                       (*in)[i].DeepCopyInto(&(*out)[i])
-               }
-       }
-       return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, 
creating a new ApisixServiceList.
-func (in *ApisixServiceList) DeepCopy() *ApisixServiceList {
-       if in == nil {
-               return nil
-       }
-       out := new(ApisixServiceList)
-       in.DeepCopyInto(out)
-       return out
-}
-
-// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, 
creating a new runtime.Object.
-func (in *ApisixServiceList) DeepCopyObject() runtime.Object {
-       if c := in.DeepCopy(); c != nil {
-               return c
-       }
-       return nil
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, 
writing into out. in must be non-nil.
-func (in *ApisixServiceSpec) DeepCopyInto(out *ApisixServiceSpec) {
-       *out = *in
-       if in.Plugins != nil {
-               in, out := &in.Plugins, &out.Plugins
-               *out = make([]Plugin, len(*in))
-               for i := range *in {
-                       (*in)[i].DeepCopyInto(&(*out)[i])
-               }
-       }
-       return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, 
creating a new ApisixServiceSpec.
-func (in *ApisixServiceSpec) DeepCopy() *ApisixServiceSpec {
-       if in == nil {
-               return nil
-       }
-       out := new(ApisixServiceSpec)
-       in.DeepCopyInto(out)
-       return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, 
writing into out. in must be non-nil.
 func (in *ApisixTls) DeepCopyInto(out *ApisixTls) {
        *out = *in
        out.TypeMeta = in.TypeMeta
diff --git 
a/pkg/kube/apisix/client/clientset/versioned/typed/config/v1/apisixservice.go 
b/pkg/kube/apisix/client/clientset/versioned/typed/config/v1/apisixservice.go
deleted file mode 100644
index 258c1fc..0000000
--- 
a/pkg/kube/apisix/client/clientset/versioned/typed/config/v1/apisixservice.go
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
-Copyright The Kubernetes Authors.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-// Code generated by client-gen. DO NOT EDIT.
-
-package v1
-
-import (
-       "context"
-       "time"
-
-       v1 
"github.com/apache/apisix-ingress-controller/pkg/kube/apisix/apis/config/v1"
-       scheme 
"github.com/apache/apisix-ingress-controller/pkg/kube/apisix/client/clientset/versioned/scheme"
-       metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
-       types "k8s.io/apimachinery/pkg/types"
-       watch "k8s.io/apimachinery/pkg/watch"
-       rest "k8s.io/client-go/rest"
-)
-
-// ApisixServicesGetter has a method to return a ApisixServiceInterface.
-// A group's client should implement this interface.
-type ApisixServicesGetter interface {
-       ApisixServices(namespace string) ApisixServiceInterface
-}
-
-// ApisixServiceInterface has methods to work with ApisixService resources.
-type ApisixServiceInterface interface {
-       Create(ctx context.Context, apisixService *v1.ApisixService, opts 
metav1.CreateOptions) (*v1.ApisixService, error)
-       Update(ctx context.Context, apisixService *v1.ApisixService, opts 
metav1.UpdateOptions) (*v1.ApisixService, error)
-       Delete(ctx context.Context, name string, opts metav1.DeleteOptions) 
error
-       DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, 
listOpts metav1.ListOptions) error
-       Get(ctx context.Context, name string, opts metav1.GetOptions) 
(*v1.ApisixService, error)
-       List(ctx context.Context, opts metav1.ListOptions) 
(*v1.ApisixServiceList, error)
-       Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, 
error)
-       Patch(ctx context.Context, name string, pt types.PatchType, data 
[]byte, opts metav1.PatchOptions, subresources ...string) (result 
*v1.ApisixService, err error)
-       ApisixServiceExpansion
-}
-
-// apisixServices implements ApisixServiceInterface
-type apisixServices struct {
-       client rest.Interface
-       ns     string
-}
-
-// newApisixServices returns a ApisixServices
-func newApisixServices(c *ApisixV1Client, namespace string) *apisixServices {
-       return &apisixServices{
-               client: c.RESTClient(),
-               ns:     namespace,
-       }
-}
-
-// Get takes name of the apisixService, and returns the corresponding 
apisixService object, and an error if there is any.
-func (c *apisixServices) Get(ctx context.Context, name string, options 
metav1.GetOptions) (result *v1.ApisixService, err error) {
-       result = &v1.ApisixService{}
-       err = c.client.Get().
-               Namespace(c.ns).
-               Resource("apisixservices").
-               Name(name).
-               VersionedParams(&options, scheme.ParameterCodec).
-               Do(ctx).
-               Into(result)
-       return
-}
-
-// List takes label and field selectors, and returns the list of 
ApisixServices that match those selectors.
-func (c *apisixServices) List(ctx context.Context, opts metav1.ListOptions) 
(result *v1.ApisixServiceList, err error) {
-       var timeout time.Duration
-       if opts.TimeoutSeconds != nil {
-               timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
-       }
-       result = &v1.ApisixServiceList{}
-       err = c.client.Get().
-               Namespace(c.ns).
-               Resource("apisixservices").
-               VersionedParams(&opts, scheme.ParameterCodec).
-               Timeout(timeout).
-               Do(ctx).
-               Into(result)
-       return
-}
-
-// Watch returns a watch.Interface that watches the requested apisixServices.
-func (c *apisixServices) Watch(ctx context.Context, opts metav1.ListOptions) 
(watch.Interface, error) {
-       var timeout time.Duration
-       if opts.TimeoutSeconds != nil {
-               timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
-       }
-       opts.Watch = true
-       return c.client.Get().
-               Namespace(c.ns).
-               Resource("apisixservices").
-               VersionedParams(&opts, scheme.ParameterCodec).
-               Timeout(timeout).
-               Watch(ctx)
-}
-
-// Create takes the representation of a apisixService and creates it.  Returns 
the server's representation of the apisixService, and an error, if there is any.
-func (c *apisixServices) Create(ctx context.Context, apisixService 
*v1.ApisixService, opts metav1.CreateOptions) (result *v1.ApisixService, err 
error) {
-       result = &v1.ApisixService{}
-       err = c.client.Post().
-               Namespace(c.ns).
-               Resource("apisixservices").
-               VersionedParams(&opts, scheme.ParameterCodec).
-               Body(apisixService).
-               Do(ctx).
-               Into(result)
-       return
-}
-
-// Update takes the representation of a apisixService and updates it. Returns 
the server's representation of the apisixService, and an error, if there is any.
-func (c *apisixServices) Update(ctx context.Context, apisixService 
*v1.ApisixService, opts metav1.UpdateOptions) (result *v1.ApisixService, err 
error) {
-       result = &v1.ApisixService{}
-       err = c.client.Put().
-               Namespace(c.ns).
-               Resource("apisixservices").
-               Name(apisixService.Name).
-               VersionedParams(&opts, scheme.ParameterCodec).
-               Body(apisixService).
-               Do(ctx).
-               Into(result)
-       return
-}
-
-// Delete takes name of the apisixService and deletes it. Returns an error if 
one occurs.
-func (c *apisixServices) Delete(ctx context.Context, name string, opts 
metav1.DeleteOptions) error {
-       return c.client.Delete().
-               Namespace(c.ns).
-               Resource("apisixservices").
-               Name(name).
-               Body(&opts).
-               Do(ctx).
-               Error()
-}
-
-// DeleteCollection deletes a collection of objects.
-func (c *apisixServices) DeleteCollection(ctx context.Context, opts 
metav1.DeleteOptions, listOpts metav1.ListOptions) error {
-       var timeout time.Duration
-       if listOpts.TimeoutSeconds != nil {
-               timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
-       }
-       return c.client.Delete().
-               Namespace(c.ns).
-               Resource("apisixservices").
-               VersionedParams(&listOpts, scheme.ParameterCodec).
-               Timeout(timeout).
-               Body(&opts).
-               Do(ctx).
-               Error()
-}
-
-// Patch applies the patch and returns the patched apisixService.
-func (c *apisixServices) Patch(ctx context.Context, name string, pt 
types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) 
(result *v1.ApisixService, err error) {
-       result = &v1.ApisixService{}
-       err = c.client.Patch(pt).
-               Namespace(c.ns).
-               Resource("apisixservices").
-               Name(name).
-               SubResource(subresources...).
-               VersionedParams(&opts, scheme.ParameterCodec).
-               Body(data).
-               Do(ctx).
-               Into(result)
-       return
-}
diff --git 
a/pkg/kube/apisix/client/clientset/versioned/typed/config/v1/config_client.go 
b/pkg/kube/apisix/client/clientset/versioned/typed/config/v1/config_client.go
index 66f2843..2044c95 100644
--- 
a/pkg/kube/apisix/client/clientset/versioned/typed/config/v1/config_client.go
+++ 
b/pkg/kube/apisix/client/clientset/versioned/typed/config/v1/config_client.go
@@ -27,7 +27,6 @@ import (
 type ApisixV1Interface interface {
        RESTClient() rest.Interface
        ApisixRoutesGetter
-       ApisixServicesGetter
        ApisixTlsesGetter
        ApisixUpstreamsGetter
 }
@@ -41,10 +40,6 @@ func (c *ApisixV1Client) ApisixRoutes(namespace string) 
ApisixRouteInterface {
        return newApisixRoutes(c, namespace)
 }
 
-func (c *ApisixV1Client) ApisixServices(namespace string) 
ApisixServiceInterface {
-       return newApisixServices(c, namespace)
-}
-
 func (c *ApisixV1Client) ApisixTlses(namespace string) ApisixTlsInterface {
        return newApisixTlses(c, namespace)
 }
diff --git 
a/pkg/kube/apisix/client/clientset/versioned/typed/config/v1/fake/fake_apisixservice.go
 
b/pkg/kube/apisix/client/clientset/versioned/typed/config/v1/fake/fake_apisixservice.go
deleted file mode 100644
index 9a06684..0000000
--- 
a/pkg/kube/apisix/client/clientset/versioned/typed/config/v1/fake/fake_apisixservice.go
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
-Copyright The Kubernetes Authors.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-// Code generated by client-gen. DO NOT EDIT.
-
-package fake
-
-import (
-       "context"
-
-       configv1 
"github.com/apache/apisix-ingress-controller/pkg/kube/apisix/apis/config/v1"
-       v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
-       labels "k8s.io/apimachinery/pkg/labels"
-       schema "k8s.io/apimachinery/pkg/runtime/schema"
-       types "k8s.io/apimachinery/pkg/types"
-       watch "k8s.io/apimachinery/pkg/watch"
-       testing "k8s.io/client-go/testing"
-)
-
-// FakeApisixServices implements ApisixServiceInterface
-type FakeApisixServices struct {
-       Fake *FakeApisixV1
-       ns   string
-}
-
-var apisixservicesResource = schema.GroupVersionResource{Group: 
"apisix.apache.org", Version: "v1", Resource: "apisixservices"}
-
-var apisixservicesKind = schema.GroupVersionKind{Group: "apisix.apache.org", 
Version: "v1", Kind: "ApisixService"}
-
-// Get takes name of the apisixService, and returns the corresponding 
apisixService object, and an error if there is any.
-func (c *FakeApisixServices) Get(ctx context.Context, name string, options 
v1.GetOptions) (result *configv1.ApisixService, err error) {
-       obj, err := c.Fake.
-               Invokes(testing.NewGetAction(apisixservicesResource, c.ns, 
name), &configv1.ApisixService{})
-
-       if obj == nil {
-               return nil, err
-       }
-       return obj.(*configv1.ApisixService), err
-}
-
-// List takes label and field selectors, and returns the list of 
ApisixServices that match those selectors.
-func (c *FakeApisixServices) List(ctx context.Context, opts v1.ListOptions) 
(result *configv1.ApisixServiceList, err error) {
-       obj, err := c.Fake.
-               Invokes(testing.NewListAction(apisixservicesResource, 
apisixservicesKind, c.ns, opts), &configv1.ApisixServiceList{})
-
-       if obj == nil {
-               return nil, err
-       }
-
-       label, _, _ := testing.ExtractFromListOptions(opts)
-       if label == nil {
-               label = labels.Everything()
-       }
-       list := &configv1.ApisixServiceList{ListMeta: 
obj.(*configv1.ApisixServiceList).ListMeta}
-       for _, item := range obj.(*configv1.ApisixServiceList).Items {
-               if label.Matches(labels.Set(item.Labels)) {
-                       list.Items = append(list.Items, item)
-               }
-       }
-       return list, err
-}
-
-// Watch returns a watch.Interface that watches the requested apisixServices.
-func (c *FakeApisixServices) Watch(ctx context.Context, opts v1.ListOptions) 
(watch.Interface, error) {
-       return c.Fake.
-               InvokesWatch(testing.NewWatchAction(apisixservicesResource, 
c.ns, opts))
-
-}
-
-// Create takes the representation of a apisixService and creates it.  Returns 
the server's representation of the apisixService, and an error, if there is any.
-func (c *FakeApisixServices) Create(ctx context.Context, apisixService 
*configv1.ApisixService, opts v1.CreateOptions) (result 
*configv1.ApisixService, err error) {
-       obj, err := c.Fake.
-               Invokes(testing.NewCreateAction(apisixservicesResource, c.ns, 
apisixService), &configv1.ApisixService{})
-
-       if obj == nil {
-               return nil, err
-       }
-       return obj.(*configv1.ApisixService), err
-}
-
-// Update takes the representation of a apisixService and updates it. Returns 
the server's representation of the apisixService, and an error, if there is any.
-func (c *FakeApisixServices) Update(ctx context.Context, apisixService 
*configv1.ApisixService, opts v1.UpdateOptions) (result 
*configv1.ApisixService, err error) {
-       obj, err := c.Fake.
-               Invokes(testing.NewUpdateAction(apisixservicesResource, c.ns, 
apisixService), &configv1.ApisixService{})
-
-       if obj == nil {
-               return nil, err
-       }
-       return obj.(*configv1.ApisixService), err
-}
-
-// Delete takes name of the apisixService and deletes it. Returns an error if 
one occurs.
-func (c *FakeApisixServices) Delete(ctx context.Context, name string, opts 
v1.DeleteOptions) error {
-       _, err := c.Fake.
-               Invokes(testing.NewDeleteAction(apisixservicesResource, c.ns, 
name), &configv1.ApisixService{})
-
-       return err
-}
-
-// DeleteCollection deletes a collection of objects.
-func (c *FakeApisixServices) DeleteCollection(ctx context.Context, opts 
v1.DeleteOptions, listOpts v1.ListOptions) error {
-       action := testing.NewDeleteCollectionAction(apisixservicesResource, 
c.ns, listOpts)
-
-       _, err := c.Fake.Invokes(action, &configv1.ApisixServiceList{})
-       return err
-}
-
-// Patch applies the patch and returns the patched apisixService.
-func (c *FakeApisixServices) Patch(ctx context.Context, name string, pt 
types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) 
(result *configv1.ApisixService, err error) {
-       obj, err := c.Fake.
-               
Invokes(testing.NewPatchSubresourceAction(apisixservicesResource, c.ns, name, 
pt, data, subresources...), &configv1.ApisixService{})
-
-       if obj == nil {
-               return nil, err
-       }
-       return obj.(*configv1.ApisixService), err
-}
diff --git 
a/pkg/kube/apisix/client/clientset/versioned/typed/config/v1/fake/fake_config_client.go
 
b/pkg/kube/apisix/client/clientset/versioned/typed/config/v1/fake/fake_config_client.go
index 0d33dae..57cfd9c 100644
--- 
a/pkg/kube/apisix/client/clientset/versioned/typed/config/v1/fake/fake_config_client.go
+++ 
b/pkg/kube/apisix/client/clientset/versioned/typed/config/v1/fake/fake_config_client.go
@@ -32,10 +32,6 @@ func (c *FakeApisixV1) ApisixRoutes(namespace string) 
v1.ApisixRouteInterface {
        return &FakeApisixRoutes{c, namespace}
 }
 
-func (c *FakeApisixV1) ApisixServices(namespace string) 
v1.ApisixServiceInterface {
-       return &FakeApisixServices{c, namespace}
-}
-
 func (c *FakeApisixV1) ApisixTlses(namespace string) v1.ApisixTlsInterface {
        return &FakeApisixTlses{c, namespace}
 }
diff --git 
a/pkg/kube/apisix/client/clientset/versioned/typed/config/v1/generated_expansion.go
 
b/pkg/kube/apisix/client/clientset/versioned/typed/config/v1/generated_expansion.go
index c83626b..6606ba7 100644
--- 
a/pkg/kube/apisix/client/clientset/versioned/typed/config/v1/generated_expansion.go
+++ 
b/pkg/kube/apisix/client/clientset/versioned/typed/config/v1/generated_expansion.go
@@ -20,8 +20,6 @@ package v1
 
 type ApisixRouteExpansion interface{}
 
-type ApisixServiceExpansion interface{}
-
 type ApisixTlsExpansion interface{}
 
 type ApisixUpstreamExpansion interface{}
diff --git 
a/pkg/kube/apisix/client/informers/externalversions/config/v1/apisixservice.go 
b/pkg/kube/apisix/client/informers/externalversions/config/v1/apisixservice.go
deleted file mode 100644
index 5822285..0000000
--- 
a/pkg/kube/apisix/client/informers/externalversions/config/v1/apisixservice.go
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
-Copyright The Kubernetes Authors.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-// Code generated by informer-gen. DO NOT EDIT.
-
-package v1
-
-import (
-       "context"
-       time "time"
-
-       configv1 
"github.com/apache/apisix-ingress-controller/pkg/kube/apisix/apis/config/v1"
-       versioned 
"github.com/apache/apisix-ingress-controller/pkg/kube/apisix/client/clientset/versioned"
-       internalinterfaces 
"github.com/apache/apisix-ingress-controller/pkg/kube/apisix/client/informers/externalversions/internalinterfaces"
-       v1 
"github.com/apache/apisix-ingress-controller/pkg/kube/apisix/client/listers/config/v1"
-       metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
-       runtime "k8s.io/apimachinery/pkg/runtime"
-       watch "k8s.io/apimachinery/pkg/watch"
-       cache "k8s.io/client-go/tools/cache"
-)
-
-// ApisixServiceInformer provides access to a shared informer and lister for
-// ApisixServices.
-type ApisixServiceInformer interface {
-       Informer() cache.SharedIndexInformer
-       Lister() v1.ApisixServiceLister
-}
-
-type apisixServiceInformer struct {
-       factory          internalinterfaces.SharedInformerFactory
-       tweakListOptions internalinterfaces.TweakListOptionsFunc
-       namespace        string
-}
-
-// NewApisixServiceInformer constructs a new informer for ApisixService type.
-// Always prefer using an informer factory to get a shared informer instead of 
getting an independent
-// one. This reduces memory footprint and number of connections to the server.
-func NewApisixServiceInformer(client versioned.Interface, namespace string, 
resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
-       return NewFilteredApisixServiceInformer(client, namespace, 
resyncPeriod, indexers, nil)
-}
-
-// NewFilteredApisixServiceInformer constructs a new informer for 
ApisixService type.
-// Always prefer using an informer factory to get a shared informer instead of 
getting an independent
-// one. This reduces memory footprint and number of connections to the server.
-func NewFilteredApisixServiceInformer(client versioned.Interface, namespace 
string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions 
internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
-       return cache.NewSharedIndexInformer(
-               &cache.ListWatch{
-                       ListFunc: func(options metav1.ListOptions) 
(runtime.Object, error) {
-                               if tweakListOptions != nil {
-                                       tweakListOptions(&options)
-                               }
-                               return 
client.ApisixV1().ApisixServices(namespace).List(context.TODO(), options)
-                       },
-                       WatchFunc: func(options metav1.ListOptions) 
(watch.Interface, error) {
-                               if tweakListOptions != nil {
-                                       tweakListOptions(&options)
-                               }
-                               return 
client.ApisixV1().ApisixServices(namespace).Watch(context.TODO(), options)
-                       },
-               },
-               &configv1.ApisixService{},
-               resyncPeriod,
-               indexers,
-       )
-}
-
-func (f *apisixServiceInformer) defaultInformer(client versioned.Interface, 
resyncPeriod time.Duration) cache.SharedIndexInformer {
-       return NewFilteredApisixServiceInformer(client, f.namespace, 
resyncPeriod, cache.Indexers{cache.NamespaceIndex: 
cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
-}
-
-func (f *apisixServiceInformer) Informer() cache.SharedIndexInformer {
-       return f.factory.InformerFor(&configv1.ApisixService{}, 
f.defaultInformer)
-}
-
-func (f *apisixServiceInformer) Lister() v1.ApisixServiceLister {
-       return v1.NewApisixServiceLister(f.Informer().GetIndexer())
-}
diff --git 
a/pkg/kube/apisix/client/informers/externalversions/config/v1/interface.go 
b/pkg/kube/apisix/client/informers/externalversions/config/v1/interface.go
index ac21eb6..d606865 100644
--- a/pkg/kube/apisix/client/informers/externalversions/config/v1/interface.go
+++ b/pkg/kube/apisix/client/informers/externalversions/config/v1/interface.go
@@ -26,8 +26,6 @@ import (
 type Interface interface {
        // ApisixRoutes returns a ApisixRouteInformer.
        ApisixRoutes() ApisixRouteInformer
-       // ApisixServices returns a ApisixServiceInformer.
-       ApisixServices() ApisixServiceInformer
        // ApisixTlses returns a ApisixTlsInformer.
        ApisixTlses() ApisixTlsInformer
        // ApisixUpstreams returns a ApisixUpstreamInformer.
@@ -50,11 +48,6 @@ func (v *version) ApisixRoutes() ApisixRouteInformer {
        return &apisixRouteInformer{factory: v.factory, namespace: v.namespace, 
tweakListOptions: v.tweakListOptions}
 }
 
-// ApisixServices returns a ApisixServiceInformer.
-func (v *version) ApisixServices() ApisixServiceInformer {
-       return &apisixServiceInformer{factory: v.factory, namespace: 
v.namespace, tweakListOptions: v.tweakListOptions}
-}
-
 // ApisixTlses returns a ApisixTlsInformer.
 func (v *version) ApisixTlses() ApisixTlsInformer {
        return &apisixTlsInformer{factory: v.factory, namespace: v.namespace, 
tweakListOptions: v.tweakListOptions}
diff --git a/pkg/kube/apisix/client/informers/externalversions/generic.go 
b/pkg/kube/apisix/client/informers/externalversions/generic.go
index b588a1f..ffd2686 100644
--- a/pkg/kube/apisix/client/informers/externalversions/generic.go
+++ b/pkg/kube/apisix/client/informers/externalversions/generic.go
@@ -55,8 +55,6 @@ func (f *sharedInformerFactory) ForResource(resource 
schema.GroupVersionResource
        // Group=apisix.apache.org, Version=v1
        case v1.SchemeGroupVersion.WithResource("apisixroutes"):
                return &genericInformer{resource: resource.GroupResource(), 
informer: f.Apisix().V1().ApisixRoutes().Informer()}, nil
-       case v1.SchemeGroupVersion.WithResource("apisixservices"):
-               return &genericInformer{resource: resource.GroupResource(), 
informer: f.Apisix().V1().ApisixServices().Informer()}, nil
        case v1.SchemeGroupVersion.WithResource("apisixtlses"):
                return &genericInformer{resource: resource.GroupResource(), 
informer: f.Apisix().V1().ApisixTlses().Informer()}, nil
        case v1.SchemeGroupVersion.WithResource("apisixupstreams"):
diff --git a/pkg/kube/apisix/client/listers/config/v1/apisixservice.go 
b/pkg/kube/apisix/client/listers/config/v1/apisixservice.go
deleted file mode 100644
index 1dc4dc1..0000000
--- a/pkg/kube/apisix/client/listers/config/v1/apisixservice.go
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
-Copyright The Kubernetes Authors.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-// Code generated by lister-gen. DO NOT EDIT.
-
-package v1
-
-import (
-       v1 
"github.com/apache/apisix-ingress-controller/pkg/kube/apisix/apis/config/v1"
-       "k8s.io/apimachinery/pkg/api/errors"
-       "k8s.io/apimachinery/pkg/labels"
-       "k8s.io/client-go/tools/cache"
-)
-
-// ApisixServiceLister helps list ApisixServices.
-// All objects returned here must be treated as read-only.
-type ApisixServiceLister interface {
-       // List lists all ApisixServices in the indexer.
-       // Objects returned here must be treated as read-only.
-       List(selector labels.Selector) (ret []*v1.ApisixService, err error)
-       // ApisixServices returns an object that can list and get 
ApisixServices.
-       ApisixServices(namespace string) ApisixServiceNamespaceLister
-       ApisixServiceListerExpansion
-}
-
-// apisixServiceLister implements the ApisixServiceLister interface.
-type apisixServiceLister struct {
-       indexer cache.Indexer
-}
-
-// NewApisixServiceLister returns a new ApisixServiceLister.
-func NewApisixServiceLister(indexer cache.Indexer) ApisixServiceLister {
-       return &apisixServiceLister{indexer: indexer}
-}
-
-// List lists all ApisixServices in the indexer.
-func (s *apisixServiceLister) List(selector labels.Selector) (ret 
[]*v1.ApisixService, err error) {
-       err = cache.ListAll(s.indexer, selector, func(m interface{}) {
-               ret = append(ret, m.(*v1.ApisixService))
-       })
-       return ret, err
-}
-
-// ApisixServices returns an object that can list and get ApisixServices.
-func (s *apisixServiceLister) ApisixServices(namespace string) 
ApisixServiceNamespaceLister {
-       return apisixServiceNamespaceLister{indexer: s.indexer, namespace: 
namespace}
-}
-
-// ApisixServiceNamespaceLister helps list and get ApisixServices.
-// All objects returned here must be treated as read-only.
-type ApisixServiceNamespaceLister interface {
-       // List lists all ApisixServices in the indexer for a given namespace.
-       // Objects returned here must be treated as read-only.
-       List(selector labels.Selector) (ret []*v1.ApisixService, err error)
-       // Get retrieves the ApisixService from the indexer for a given 
namespace and name.
-       // Objects returned here must be treated as read-only.
-       Get(name string) (*v1.ApisixService, error)
-       ApisixServiceNamespaceListerExpansion
-}
-
-// apisixServiceNamespaceLister implements the ApisixServiceNamespaceLister
-// interface.
-type apisixServiceNamespaceLister struct {
-       indexer   cache.Indexer
-       namespace string
-}
-
-// List lists all ApisixServices in the indexer for a given namespace.
-func (s apisixServiceNamespaceLister) List(selector labels.Selector) (ret 
[]*v1.ApisixService, err error) {
-       err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m 
interface{}) {
-               ret = append(ret, m.(*v1.ApisixService))
-       })
-       return ret, err
-}
-
-// Get retrieves the ApisixService from the indexer for a given namespace and 
name.
-func (s apisixServiceNamespaceLister) Get(name string) (*v1.ApisixService, 
error) {
-       obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
-       if err != nil {
-               return nil, err
-       }
-       if !exists {
-               return nil, errors.NewNotFound(v1.Resource("apisixservice"), 
name)
-       }
-       return obj.(*v1.ApisixService), nil
-}
diff --git a/pkg/kube/apisix/client/listers/config/v1/expansion_generated.go 
b/pkg/kube/apisix/client/listers/config/v1/expansion_generated.go
index be19d49..6be057c 100644
--- a/pkg/kube/apisix/client/listers/config/v1/expansion_generated.go
+++ b/pkg/kube/apisix/client/listers/config/v1/expansion_generated.go
@@ -26,14 +26,6 @@ type ApisixRouteListerExpansion interface{}
 // ApisixRouteNamespaceLister.
 type ApisixRouteNamespaceListerExpansion interface{}
 
-// ApisixServiceListerExpansion allows custom methods to be added to
-// ApisixServiceLister.
-type ApisixServiceListerExpansion interface{}
-
-// ApisixServiceNamespaceListerExpansion allows custom methods to be added to
-// ApisixServiceNamespaceLister.
-type ApisixServiceNamespaceListerExpansion interface{}
-
 // ApisixTlsListerExpansion allows custom methods to be added to
 // ApisixTlsLister.
 type ApisixTlsListerExpansion interface{}
diff --git a/pkg/seven/state/service_worker.go 
b/pkg/seven/state/service_worker.go
index 54e5f76..d57d781 100644
--- a/pkg/seven/state/service_worker.go
+++ b/pkg/seven/state/service_worker.go
@@ -24,8 +24,6 @@ import (
        v1 "github.com/apache/apisix-ingress-controller/pkg/types/apisix/v1"
 )
 
-const ApisixService = "ApisixService"
-
 type serviceWorker struct {
        *v1.Service
        Event     chan Event
@@ -112,21 +110,11 @@ func SolverSingleService(svc *v1.Service, rwg 
RouteWorkerGroup, wg *sync.WaitGro
                        }
                        log.Infof("create service %s, %s", svc.Name, 
svc.UpstreamId)
                } else {
-                       needToUpdate := true
-                       if currentService.FromKind == ApisixService { // update 
from ApisixUpstream
-                               if svc.FromKind != ApisixService {
-                                       // currentService > svc
-                                       // set lb && health check
-                                       needToUpdate = false
-                               }
-                       }
-                       if needToUpdate {
-                               if _, err := 
conf.Client.Cluster(cluster).Service().Update(context.TODO(), svc); err != nil {
-                                       errNotify = err
-                                       log.Errorf("failed to update service: 
%s, id:%s", err, svc.ID)
-                               } else {
-                                       log.Infof("updated service, id:%s, 
upstream_id:%s", svc.ID, svc.UpstreamId)
-                               }
+                       if _, err := 
conf.Client.Cluster(cluster).Service().Update(context.TODO(), svc); err != nil {
+                               errNotify = err
+                               log.Errorf("failed to update service: %s, 
id:%s", err, svc.ID)
+                       } else {
+                               log.Infof("updated service, id:%s, 
upstream_id:%s", svc.ID, svc.UpstreamId)
                        }
                }
        }
diff --git a/samples/deploy/crd/v1beta1/ApisixService.yaml 
b/samples/deploy/crd/v1beta1/ApisixService.yaml
deleted file mode 100644
index c1bc379..0000000
--- a/samples/deploy/crd/v1beta1/ApisixService.yaml
+++ /dev/null
@@ -1,34 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-apiVersion: apiextensions.k8s.io/v1beta1
-kind: CustomResourceDefinition
-metadata:
-  name: apisixservices.apisix.apache.org
-spec:
-  group: apisix.apache.org
-  versions:
-    - name: v1
-      served: true
-      storage: true
-  scope: Namespaced
-  names:
-    plural: apisixservices
-    singular: apisixservice
-    kind: ApisixService
-    shortNames:
-      - as
diff --git a/samples/deploy/crd/v1beta1/kustomization.yaml 
b/samples/deploy/crd/v1beta1/kustomization.yaml
index 4d22446..27a979f 100644
--- a/samples/deploy/crd/v1beta1/kustomization.yaml
+++ b/samples/deploy/crd/v1beta1/kustomization.yaml
@@ -18,5 +18,4 @@
 resources:
   - ./ApisixRoute.yaml
   - ./ApisixUpstream.yaml
-  - ./ApisixService.yaml
   - ./ApisixTls.yaml
diff --git a/samples/deploy/rbac/apisix_view_clusterrole.yaml 
b/samples/deploy/rbac/apisix_view_clusterrole.yaml
index 35a65cd..572b063 100644
--- a/samples/deploy/rbac/apisix_view_clusterrole.yaml
+++ b/samples/deploy/rbac/apisix_view_clusterrole.yaml
@@ -137,7 +137,6 @@ rules:
   resources:
   - apisixroutes
   - apisixupstreams
-  - apisixservices
   - apisixtlses
   verbs:
   - get

Reply via email to