Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
# limitations under the License.
#
FROM golang:1.16 AS build-env
LABEL maintainer="gxthrj@163.com"

ARG ENABLE_PROXY=false

Expand All @@ -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"]
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 3 additions & 8 deletions pkg/ingress/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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)
Expand Down
6 changes: 5 additions & 1 deletion pkg/kube/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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"

Expand All @@ -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
Expand Down