diff --git a/Dockerfile b/Dockerfile index 770fa8e514..6ee4493b92 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,7 +15,6 @@ # limitations under the License. # FROM golang:1.16 AS build-env -LABEL maintainer="gxthrj@163.com" ARG ENABLE_PROXY=false @@ -33,14 +32,15 @@ COPY . . RUN make build FROM centos:centos7 -LABEL maintainer="gxthrj@163.com" WORKDIR /ingress-apisix -RUN yum -y install ca-certificates libc6-compat \ - && update-ca-trust \ - && echo "hosts: files dns" > /etc/nsswitch.conf +RUN sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo \ + && sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo \ + && sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo \ + && yum -y install ca-certificates libc6-compat \ + && update-ca-trust COPY --from=build-env /build/apisix-ingress-controller . COPY --from=build-env /usr/share/zoneinfo/Hongkong /etc/localtime -ENTRYPOINT ["/ingress-apisix/apisix-ingress-controller", "ingress", "--config-path", "/ingress-apisix/conf/config.yaml"] +ENTRYPOINT ["/ingress-apisix/apisix-ingress-controller", "ingress", "--config-path", "/ingress-apisix/conf/config.yaml"] \ No newline at end of file diff --git a/Makefile b/Makefile index 05251b25d4..3502e42725 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,7 @@ # default: help -VERSION ?= 1.4.0 +VERSION ?= 1.4.1-patch3 RELEASE_SRC = apache-apisix-ingress-controller-${VERSION}-src LOCAL_REGISTRY="localhost:5000" IMAGE_TAG ?= dev diff --git a/pkg/ingress/controller.go b/pkg/ingress/controller.go index 0496a78f67..eb3dede64d 100644 --- a/pkg/ingress/controller.go +++ b/pkg/ingress/controller.go @@ -5,7 +5,7 @@ // (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 +// 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, @@ -349,8 +349,8 @@ func (c *Controller) Run(stop chan struct{}) error { } cfg := leaderelection.LeaderElectionConfig{ Lock: lock, - LeaseDuration: 15 * time.Second, - RenewDeadline: 5 * time.Second, + LeaseDuration: 60 * time.Second, + RenewDeadline: 20 * time.Second, RetryPeriod: 2 * time.Second, Callbacks: leaderelection.LeaderCallbacks{ OnStartedLeading: c.run, @@ -447,11 +447,6 @@ func (c *Controller) run(ctx context.Context) { ctx.Done() return } - // compare resources of k8s with objects of APISIX - if err = c.CompareResources(ctx); err != nil { - ctx.Done() - return - } c.goAttach(func() { c.checkClusterHealth(ctx, cancelFunc) diff --git a/pkg/kube/init.go b/pkg/kube/init.go index 20aa23016d..a48077d8ee 100644 --- a/pkg/kube/init.go +++ b/pkg/kube/init.go @@ -5,7 +5,7 @@ // (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 +// 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, @@ -17,6 +17,7 @@ package kube import ( "k8s.io/client-go/informers" "k8s.io/client-go/kubernetes" + "k8s.io/client-go/util/flowcontrol" gatewayclientset "sigs.k8s.io/gateway-api/pkg/client/clientset/gateway/versioned" gatewayexternalversions "sigs.k8s.io/gateway-api/pkg/client/informers/gateway/externalversions" @@ -43,6 +44,9 @@ func NewKubeClient(cfg *config.Config) (*KubeClient, error) { if err != nil { return nil, err } + restConfig.RateLimiter = flowcontrol.NewFakeAlwaysRateLimiter() + restConfig.QPS = 0 + restConfig.Burst = 0 kubeClient, err := kubernetes.NewForConfig(restConfig) if err != nil { return nil, err