Merge pull request #4221 from aledbf/upgrade-nginx-image

Switch to openresty image
This commit is contained in:
Kubernetes Prow Robot 2019-06-24 09:45:57 -07:00 committed by GitHub
commit 5dfc7e211f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 43 additions and 23 deletions

View file

@ -70,7 +70,7 @@ IMAGE = $(REGISTRY)/$(IMGNAME)
MULTI_ARCH_IMG = $(IMAGE)-$(ARCH) MULTI_ARCH_IMG = $(IMAGE)-$(ARCH)
# Set default base image dynamically for each arch # Set default base image dynamically for each arch
BASEIMAGE?=quay.io/kubernetes-ingress-controller/nginx-$(ARCH):0.87 BASEIMAGE?=quay.io/kubernetes-ingress-controller/nginx-$(ARCH):0.88
ifeq ($(ARCH),arm64) ifeq ($(ARCH),arm64)
QEMUARCH=aarch64 QEMUARCH=aarch64

View file

@ -22,7 +22,7 @@ set -o errexit
set -o nounset set -o nounset
set -o pipefail set -o pipefail
E2E_IMAGE=quay.io/kubernetes-ingress-controller/e2e:v06042019-0c7a34696 E2E_IMAGE=quay.io/kubernetes-ingress-controller/e2e:v06232019-5bb168152
DOCKER_OPTS=${DOCKER_OPTS:-""} DOCKER_OPTS=${DOCKER_OPTS:-""}

View file

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
FROM quay.io/kubernetes-ingress-controller/nginx-amd64:0.87 FROM quay.io/kubernetes-ingress-controller/nginx-amd64:0.88
RUN clean-install \ RUN clean-install \
g++ \ g++ \
@ -21,13 +21,12 @@ RUN clean-install \
libc6-dev \ libc6-dev \
make \ make \
wget \ wget \
luarocks \
python \ python \
pkg-config pkg-config
ENV GOLANG_VERSION 1.12.5 ENV GOLANG_VERSION 1.12.6
ENV GO_ARCH linux-amd64 ENV GO_ARCH linux-amd64
ENV GOLANG_SHA aea86e3c73495f205929cfebba0d63f1382c8ac59be081b6351681415f4063cf ENV GOLANG_SHA dbcf71a3c1ea53b8d54ef1b48c85a39a6c9a935d01fc8291ff2b92028e59913c
RUN set -eux; \ RUN set -eux; \
url="https://golang.org/dl/go${GOLANG_VERSION}.${GO_ARCH}.tar.gz"; \ url="https://golang.org/dl/go${GOLANG_VERSION}.${GO_ARCH}.tar.gz"; \

View file

@ -23,7 +23,7 @@ all: docker-build docker-push
docker-build: docker-build:
$(DOCKER) build \ $(DOCKER) build \
--pull \ --pull \
--build-arg K8S_RELEASE=v1.14.1 \ --build-arg K8S_RELEASE=v1.15.0 \
--build-arg ETCD_VERSION=v3.3.12 \ --build-arg ETCD_VERSION=v3.3.12 \
-t $(IMAGE):$(TAG) . -t $(IMAGE):$(TAG) .

View file

@ -73,7 +73,7 @@ func rlimitMaxNumFiles() int {
} }
const ( const (
defBinary = "/usr/sbin/nginx" defBinary = "/usr/local/openresty/nginx/sbin/nginx"
cfgPath = "/etc/nginx/nginx.conf" cfgPath = "/etc/nginx/nginx.conf"
) )

View file

@ -24,6 +24,13 @@ RUN clean-install \
COPY --chown=www-data:www-data . / COPY --chown=www-data:www-data . /
RUN cp /usr/local/openresty/nginx/conf/mime.types /etc/nginx/mime.types
RUN ln -s /usr/local/openresty/nginx/modules /etc/nginx/modules
# Add LuaRocks paths
ENV LUA_PATH="/usr/local/openresty/site/lualib/?.ljbc;/usr/local/openresty/site/lualib/?/init.ljbc;/usr/local/openresty/lualib/?.ljbc;/usr/local/openresty/lualib/?/init.ljbc;/usr/local/openresty/site/lualib/?.lua;/usr/local/openresty/site/lualib/?/init.lua;/usr/local/openresty/lualib/?.lua;/usr/local/openresty/lualib/?/init.lua;./?.lua;/usr/local/openresty/luajit/share/luajit-2.1.0-beta3/?.lua;/usr/local/share/lua/5.1/?.lua;/usr/local/share/lua/5.1/?/init.lua;/usr/local/openresty/luajit/share/lua/5.1/?.lua;/usr/local/openresty/luajit/share/lua/5.1/?/init.lua;/usr/local/lib/lua/?.lua;/etc/nginx/lua/?.lua;/etc/nginx/lua/vendor/?.lua;;"
ENV LUA_CPATH="/etc/nginx/lua/?.lua;/etc/nginx/lua/vendor/?.lua;/usr/local/openresty/site/lualib/?.so;/usr/local/openresty/lualib/?.so;./?.so;/usr/local/lib/lua/5.1/?.so;/usr/local/openresty/luajit/lib/lua/5.1/?.so;/usr/local/lib/lua/5.1/loadall.so;/usr/local/openresty/luajit/lib/lua/5.1/?.so;;"
# Fix permission during the build to avoid issues at runtime # Fix permission during the build to avoid issues at runtime
# with volumes (custom templates) # with volumes (custom templates)
RUN bash -eu -c ' \ RUN bash -eu -c ' \
@ -42,16 +49,16 @@ RUN bash -eu -c ' \
RUN setcap cap_net_bind_service=+ep /nginx-ingress-controller \ RUN setcap cap_net_bind_service=+ep /nginx-ingress-controller \
&& setcap -v cap_net_bind_service=+ep /nginx-ingress-controller && setcap -v cap_net_bind_service=+ep /nginx-ingress-controller
RUN setcap cap_net_bind_service=+ep /usr/sbin/nginx \ RUN setcap cap_net_bind_service=+ep /usr/local/openresty/nginx/sbin/nginx \
&& setcap -v cap_net_bind_service=+ep /usr/sbin/nginx && setcap -v cap_net_bind_service=+ep /usr/local/openresty/nginx/sbin/nginx
# Create symlinks to redirect nginx logs to stdout and stderr docker log collector
# This only works if nginx is started with CMD or ENTRYPOINT
RUN ln -sf /dev/stdout /var/log/nginx/access.log
RUN ln -sf /dev/stderr /var/log/nginx/error.log
USER www-data USER www-data
# Create symlinks to redirect nginx logs to stdout and stderr docker log collector
RUN ln -sf /dev/stdout /usr/local/openresty/nginx/logs/access.log \
&& ln -sf /dev/stderr /usr/local/openresty/nginx/logs/error.log \
&& ln -s /usr/local/openresty/nginx/logs/* /var/log/nginx
ENTRYPOINT ["/usr/bin/dumb-init", "--"] ENTRYPOINT ["/usr/bin/dumb-init", "--"]
CMD ["/nginx-ingress-controller"] CMD ["/nginx-ingress-controller"]

View file

@ -48,8 +48,8 @@ events {
} }
http { http {
lua_package_cpath "/usr/local/lib/lua/?.so;/usr/lib/lua-platform-path/lua/5.1/?.so;;"; lua_package_path "/usr/local/openresty/site/lualib/?.ljbc;/usr/local/openresty/site/lualib/?/init.ljbc;/usr/local/openresty/lualib/?.ljbc;/usr/local/openresty/lualib/?/init.ljbc;/usr/local/openresty/site/lualib/?.lua;/usr/local/openresty/site/lualib/?/init.lua;/usr/local/openresty/lualib/?.lua;/usr/local/openresty/lualib/?/init.lua;./?.lua;/usr/local/openresty/luajit/share/luajit-2.1.0-beta3/?.lua;/usr/local/share/lua/5.1/?.lua;/usr/local/share/lua/5.1/?/init.lua;/usr/local/openresty/luajit/share/lua/5.1/?.lua;/usr/local/openresty/luajit/share/lua/5.1/?/init.lua;/usr/local/lib/lua/?.lua;;";
lua_package_path "/etc/nginx/lua/?.lua;/etc/nginx/lua/vendor/?.lua;/usr/local/lib/lua/?.lua;;"; lua_package_cpath "/usr/local/openresty/site/lualib/?.so;/usr/local/openresty/lualib/?.so;./?.so;/usr/local/lib/lua/5.1/?.so;/usr/local/openresty/luajit/lib/lua/5.1/?.so;/usr/local/lib/lua/5.1/loadall.so;/usr/local/openresty/luajit/lib/lua/5.1/?.so;;";
{{ buildLuaSharedDictionaries $servers $all.Cfg.DisableLuaRestyWAF }} {{ buildLuaSharedDictionaries $servers $all.Cfg.DisableLuaRestyWAF }}

View file

@ -1,4 +1,4 @@
FROM quay.io/kubernetes-ingress-controller/e2e:v06042019-0c7a34696 AS BASE FROM quay.io/kubernetes-ingress-controller/e2e:v06232019-5bb168152 AS BASE
FROM quay.io/kubernetes-ingress-controller/debian-base-amd64:0.1 FROM quay.io/kubernetes-ingress-controller/debian-base-amd64:0.1
@ -9,7 +9,7 @@ RUN clean-install \
tzdata tzdata
RUN curl -Lo /usr/local/bin/kubectl \ RUN curl -Lo /usr/local/bin/kubectl \
https://storage.googleapis.com/kubernetes-release/release/v1.14.1/bin/linux/amd64/kubectl \ https://storage.googleapis.com/kubernetes-release/release/v1.15.0/bin/linux/amd64/kubectl \
&& chmod +x /usr/local/bin/kubectl && chmod +x /usr/local/bin/kubectl
COPY --from=BASE /go/bin/ginkgo /usr/local/bin/ COPY --from=BASE /go/bin/ginkgo /usr/local/bin/

View file

@ -56,7 +56,7 @@ RUN curl -L https://storage.googleapis.com/etcd/${ETCD_VERSION}/etcd-${ETCD_VERS
&& rm -rf /tmp/etcd-download && rm -rf /tmp/etcd-download
# install go # install go
ENV GO_VERSION 1.12.5 ENV GO_VERSION 1.12.6
ENV GO_TARBALL "go${GO_VERSION}.linux-amd64.tar.gz" ENV GO_TARBALL "go${GO_VERSION}.linux-amd64.tar.gz"
RUN wget -q "https://storage.googleapis.com/golang/${GO_TARBALL}" && \ RUN wget -q "https://storage.googleapis.com/golang/${GO_TARBALL}" && \
tar xzf "${GO_TARBALL}" -C /usr/local && \ tar xzf "${GO_TARBALL}" -C /usr/local && \

View file

@ -9,7 +9,7 @@ all: docker-build docker-push
docker-build: docker-build:
$(DOCKER) build \ $(DOCKER) build \
--pull \ --pull \
--build-arg K8S_RELEASE=v1.14.1 \ --build-arg K8S_RELEASE=v1.15.0 \
--build-arg ETCD_VERSION=v3.3.12 \ --build-arg ETCD_VERSION=v3.3.12 \
-t $(IMAGE):$(TAG) . -t $(IMAGE):$(TAG) .

View file

@ -72,7 +72,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Redirect", func() {
Expect(errs).To(BeNil()) Expect(errs).To(BeNil())
Expect(resp.StatusCode).Should(BeNumerically("==", http.StatusMovedPermanently)) Expect(resp.StatusCode).Should(BeNumerically("==", http.StatusMovedPermanently))
Expect(resp.Header.Get("Location")).Should(Equal(redirectURL)) Expect(resp.Header.Get("Location")).Should(Equal(redirectURL))
Expect(body).Should(ContainSubstring("nginx/")) Expect(body).Should(ContainSubstring("openresty/"))
}) })
It("should respond with a custom redirect code", func() { It("should respond with a custom redirect code", func() {
@ -108,6 +108,6 @@ var _ = framework.IngressNginxDescribe("Annotations - Redirect", func() {
Expect(errs).To(BeNil()) Expect(errs).To(BeNil())
Expect(resp.StatusCode).Should(BeNumerically("==", redirectCode)) Expect(resp.StatusCode).Should(BeNumerically("==", redirectCode))
Expect(resp.Header.Get("Location")).Should(Equal(redirectURL)) Expect(resp.Header.Get("Location")).Should(Equal(redirectURL))
Expect(body).Should(ContainSubstring("nginx/")) Expect(body).Should(ContainSubstring("openresty/"))
}) })
}) })

View file

@ -128,6 +128,20 @@ func (f *Framework) AfterEach() {
Expect(err).ToNot(HaveOccurred()) Expect(err).ToNot(HaveOccurred())
By("Dumping NGINX logs after a failure running a test") By("Dumping NGINX logs after a failure running a test")
Logf("%v", log) Logf("%v", log)
pod, err := getIngressNGINXPod(f.Namespace, f.KubeClientSet)
if err != nil {
return
}
cmd := fmt.Sprintf("cat /etc/nginx/nginx.conf")
o, err := f.ExecCommand(pod, cmd)
if err != nil {
return
}
By("Dumping NGINX configuration after a failure running a test")
Logf("%v", o)
} }
} }