Merge branch 'kubernetes:main' into pie
This commit is contained in:
commit
04f52f28ab
25 changed files with 59 additions and 50 deletions
0
.gcloudignore
Normal file
0
.gcloudignore
Normal file
2
.github/workflows/scorecards.yml
vendored
2
.github/workflows/scorecards.yml
vendored
|
@ -32,7 +32,7 @@ jobs:
|
|||
persist-credentials: false
|
||||
|
||||
- name: "Run analysis"
|
||||
uses: ossf/scorecard-action@80e868c13c90f172d68d1f4501dee99e2479f7af # v2.1.3
|
||||
uses: ossf/scorecard-action@08b4669551908b1024bb425080c797723083c031 # v2.2.0
|
||||
with:
|
||||
results_file: results.sarif
|
||||
results_format: sarif
|
||||
|
|
|
@ -1 +1 @@
|
|||
registry.k8s.io/ingress-nginx/nginx:v20230527@sha256:cf77c71aa6e4284925ca2233ddf871b5823eaa3ee000347ae25096b07fb52c57
|
||||
registry.k8s.io/ingress-nginx/nginx:v20230623-427f3d2fb@sha256:7b479f66872c0b1cb0f1315e305b8a3e9c6da846c7dd3855db99bc8cfd6791e1
|
||||
|
|
1
TAG
1
TAG
|
@ -1,2 +1 @@
|
|||
v1.8.0
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ function cleanup {
|
|||
}
|
||||
trap cleanup EXIT
|
||||
|
||||
E2E_IMAGE=${E2E_IMAGE:-registry.k8s.io/ingress-nginx/e2e-test-runner:v20230527@sha256:a98ce8ab90f16bdd8539b168a4d000f366afa4eec23a220b3ce39698c5769bfd}
|
||||
E2E_IMAGE=${E2E_IMAGE:-registry.k8s.io/ingress-nginx/e2e-test-runner:v20230623-d50c7193b@sha256:e5c68dc56934c273850bfb75c0348a2819756669baf59fcdce9e16771537b247}
|
||||
|
||||
if [[ "$RUNTIME" == podman ]]; then
|
||||
# Podman does not support both tag and digest
|
||||
|
|
|
@ -144,7 +144,7 @@ controller:
|
|||
enabled: true
|
||||
annotations:
|
||||
# Create internal NLB
|
||||
service.beta.kubernetes.io/aws-load-balancer-scheme: "internet-facing"
|
||||
service.beta.kubernetes.io/aws-load-balancer-scheme: "internal"
|
||||
# Create internal ELB(Deprecated)
|
||||
# service.beta.kubernetes.io/aws-load-balancer-internal: "true"
|
||||
# Any other annotation can be declared here.
|
||||
|
@ -408,12 +408,14 @@ As of version `1.26.0` of this chart, by simply not providing any clusterIP valu
|
|||
| controller.service.externalIPs | list | `[]` | List of IP addresses at which the controller services are available # Ref: https://kubernetes.io/docs/concepts/services-networking/service/#external-ips # |
|
||||
| controller.service.internal.annotations | object | `{}` | Annotations are mandatory for the load balancer to come up. Varies with the cloud service. |
|
||||
| controller.service.internal.enabled | bool | `false` | Enables an additional internal load balancer (besides the external one). |
|
||||
| controller.service.internal.loadBalancerIP | string | `""` | Used by cloud providers to connect the resulting internal LoadBalancer to a pre-existing static IP. Make sure to add to the service the needed annotation to specify the subnet which the static IP belongs to. For instance, `networking.gke.io/internal-load-balancer-subnet` for GCP and `service.beta.kubernetes.io/aws-load-balancer-subnets` for AWS. |
|
||||
| controller.service.internal.loadBalancerSourceRanges | list | `[]` | Restrict access For LoadBalancer service. Defaults to 0.0.0.0/0. |
|
||||
| controller.service.internal.ports | object | `{}` | Custom port mapping for internal service |
|
||||
| controller.service.internal.targetPorts | object | `{}` | Custom target port mapping for internal service |
|
||||
| controller.service.ipFamilies | list | `["IPv4"]` | List of IP families (e.g. IPv4, IPv6) assigned to the service. This field is usually assigned automatically based on cluster configuration and the ipFamilyPolicy field. # Ref: https://kubernetes.io/docs/concepts/services-networking/dual-stack/ |
|
||||
| controller.service.ipFamilyPolicy | string | `"SingleStack"` | Represents the dual-stack-ness requested or required by this Service. Possible values are SingleStack, PreferDualStack or RequireDualStack. The ipFamilies and clusterIPs fields depend on the value of this field. # Ref: https://kubernetes.io/docs/concepts/services-networking/dual-stack/ |
|
||||
| controller.service.labels | object | `{}` | |
|
||||
| controller.service.loadBalancerClass | string | `""` | Used by cloud providers to select a load balancer implementation other than the cloud provider default. https://kubernetes.io/docs/concepts/services-networking/service/#load-balancer-class |
|
||||
| controller.service.loadBalancerIP | string | `""` | Used by cloud providers to connect the resulting `LoadBalancer` to a pre-existing static IP according to https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer |
|
||||
| controller.service.loadBalancerSourceRanges | list | `[]` | |
|
||||
| controller.service.nodePorts.http | string | `""` | |
|
||||
|
|
|
@ -141,7 +141,7 @@ controller:
|
|||
enabled: true
|
||||
annotations:
|
||||
# Create internal NLB
|
||||
service.beta.kubernetes.io/aws-load-balancer-scheme: "internet-facing"
|
||||
service.beta.kubernetes.io/aws-load-balancer-scheme: "internal"
|
||||
# Create internal ELB(Deprecated)
|
||||
# service.beta.kubernetes.io/aws-load-balancer-internal: "true"
|
||||
# Any other annotation can be declared here.
|
||||
|
|
|
@ -28,6 +28,9 @@ spec:
|
|||
{{- if .Values.controller.service.loadBalancerSourceRanges }}
|
||||
loadBalancerSourceRanges: {{ toYaml .Values.controller.service.loadBalancerSourceRanges | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.controller.service.loadBalancerClass }}
|
||||
loadBalancerClass: {{ .Values.controller.service.loadBalancerClass }}
|
||||
{{- end }}
|
||||
{{- if .Values.controller.service.externalTrafficPolicy }}
|
||||
externalTrafficPolicy: {{ .Values.controller.service.externalTrafficPolicy }}
|
||||
{{- end }}
|
||||
|
|
|
@ -426,6 +426,8 @@ controller:
|
|||
# -- Used by cloud providers to connect the resulting `LoadBalancer` to a pre-existing static IP according to https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer
|
||||
loadBalancerIP: ""
|
||||
loadBalancerSourceRanges: []
|
||||
# -- Used by cloud providers to select a load balancer implementation other than the cloud provider default. https://kubernetes.io/docs/concepts/services-networking/service/#load-balancer-class
|
||||
loadBalancerClass: ""
|
||||
enableHttp: true
|
||||
enableHttps: true
|
||||
## Set external traffic policy to: "Local" to preserve source IP on providers supporting it.
|
||||
|
@ -476,7 +478,9 @@ controller:
|
|||
enabled: false
|
||||
# -- Annotations are mandatory for the load balancer to come up. Varies with the cloud service.
|
||||
annotations: {}
|
||||
# loadBalancerIP: ""
|
||||
|
||||
# -- Used by cloud providers to connect the resulting internal LoadBalancer to a pre-existing static IP. Make sure to add to the service the needed annotation to specify the subnet which the static IP belongs to. For instance, `networking.gke.io/internal-load-balancer-subnet` for GCP and `service.beta.kubernetes.io/aws-load-balancer-subnets` for AWS.
|
||||
loadBalancerIP: ""
|
||||
|
||||
# -- Restrict access For LoadBalancer service. Defaults to 0.0.0.0/0.
|
||||
loadBalancerSourceRanges: []
|
||||
|
|
2
go.mod
2
go.mod
|
@ -26,7 +26,7 @@ require (
|
|||
github.com/yudai/gojsondiff v1.0.0
|
||||
github.com/zakjan/cert-chain-resolver v0.0.0-20211122211144-c6b0b792af9a
|
||||
golang.org/x/crypto v0.10.0
|
||||
google.golang.org/grpc v1.56.0
|
||||
google.golang.org/grpc v1.56.1
|
||||
google.golang.org/grpc/examples v0.0.0-20221220003428-4f16fbe410f7
|
||||
gopkg.in/go-playground/pool.v3 v3.1.1
|
||||
gopkg.in/mcuadros/go-syslog.v2 v2.3.0
|
||||
|
|
4
go.sum
4
go.sum
|
@ -661,8 +661,8 @@ google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKa
|
|||
google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk=
|
||||
google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
|
||||
google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
|
||||
google.golang.org/grpc v1.56.0 h1:+y7Bs8rtMd07LeXmL3NxcTLn7mUkbKZqEpPhMNkwJEE=
|
||||
google.golang.org/grpc v1.56.0/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s=
|
||||
google.golang.org/grpc v1.56.1 h1:z0dNfjIl0VpaZ9iSVjA6daGatAYwPGstTjt5vkRMFkQ=
|
||||
google.golang.org/grpc v1.56.1/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s=
|
||||
google.golang.org/grpc/examples v0.0.0-20221220003428-4f16fbe410f7 h1:pPsdyuBif+uoyUoL19yuj/TCfUPsmpJHJZhWQ98JGLU=
|
||||
google.golang.org/grpc/examples v0.0.0-20221220003428-4f16fbe410f7/go.mod h1:8pQa1yxxkh+EsxUK8/455D5MSbv3vgmEJqKCH3y17mI=
|
||||
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
FROM golang:1.20.4-alpine3.18 as builder
|
||||
FROM golang:1.20.5-alpine3.18 as builder
|
||||
|
||||
RUN apk update \
|
||||
&& apk upgrade && apk add git
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
FROM golang:1.20.4-alpine3.18 as builder
|
||||
FROM golang:1.20.5-alpine3.18 as builder
|
||||
RUN mkdir /authsvc
|
||||
WORKDIR /authsvc
|
||||
COPY . ./
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
FROM golang:1.20.4-alpine3.18 as builder
|
||||
FROM golang:1.20.5-alpine3.18 as builder
|
||||
|
||||
WORKDIR /go/src/k8s.io/ingress-nginx/images/fastcgi
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
FROM golang:1.20.4-alpine3.18 as build
|
||||
FROM golang:1.20.5-alpine3.18 as build
|
||||
|
||||
WORKDIR /go/src/greeter-server
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
FROM golang:1.20 AS builder
|
||||
FROM golang:1.20.5 AS builder
|
||||
|
||||
ENV LC_ALL=C.UTF-8
|
||||
ENV LANG=C.UTF-8
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
FROM --platform=$BUILDPLATFORM golang:1.20.1 as builder
|
||||
FROM --platform=$BUILDPLATFORM golang:1.20.5 as builder
|
||||
ARG BUILDPLATFORM
|
||||
ARG TARGETARCH
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
0.0.0
|
||||
0.0.1
|
||||
|
|
|
@ -8,8 +8,6 @@ steps:
|
|||
entrypoint: bash
|
||||
env:
|
||||
- DOCKER_CLI_EXPERIMENTAL=enabled
|
||||
- SHORT_SHA=$SHORT_SHA
|
||||
- BASE_REF=$_PULL_BASE_REF
|
||||
- REGISTRY=gcr.io/k8s-staging-ingress-nginx
|
||||
- HOME=/root
|
||||
args:
|
||||
|
@ -17,7 +15,3 @@ steps:
|
|||
- |
|
||||
gcloud auth configure-docker \
|
||||
&& cd images/nginx && make push
|
||||
substitutions:
|
||||
_GIT_TAG: "12345"
|
||||
_PULL_BASE_REF: "master"
|
||||
_PULL_BASE_SHA: '12345'
|
||||
|
|
|
@ -43,7 +43,7 @@ image:
|
|||
--pull \
|
||||
--push \
|
||||
--build-arg BASE_IMAGE=${NGINX_BASE_IMAGE} \
|
||||
--build-arg GOLANG_VERSION=1.20.4 \
|
||||
--build-arg GOLANG_VERSION=1.20.5 \
|
||||
--build-arg ETCD_VERSION=3.4.3-0 \
|
||||
--build-arg K8S_RELEASE=v1.26.0 \
|
||||
--build-arg RESTY_CLI_VERSION=0.27 \
|
||||
|
@ -64,7 +64,7 @@ build: ensure-buildx
|
|||
--progress=${PROGRESS} \
|
||||
--pull \
|
||||
--build-arg BASE_IMAGE=${NGINX_BASE_IMAGE} \
|
||||
--build-arg GOLANG_VERSION=1.20.4 \
|
||||
--build-arg GOLANG_VERSION=1.20.5 \
|
||||
--build-arg ETCD_VERSION=3.4.3-0 \
|
||||
--build-arg K8S_RELEASE=v1.26.0 \
|
||||
--build-arg RESTY_CLI_VERSION=0.27 \
|
||||
|
|
|
@ -6,8 +6,6 @@ steps:
|
|||
entrypoint: bash
|
||||
env:
|
||||
- DOCKER_CLI_EXPERIMENTAL=enabled
|
||||
- SHORT_SHA=$SHORT_SHA
|
||||
- BASE_REF=$_PULL_BASE_REF
|
||||
- REGISTRY=gcr.io/k8s-staging-ingress-nginx
|
||||
# default cloudbuild has HOME=/builder/home and docker buildx is in /root/.docker/cli-plugins/docker-buildx
|
||||
# set the home to /root explicitly to if using docker buildx
|
||||
|
@ -17,7 +15,3 @@ steps:
|
|||
- |
|
||||
gcloud auth configure-docker \
|
||||
&& cd images/test-runner && make push
|
||||
substitutions:
|
||||
_GIT_TAG: "12345"
|
||||
_PULL_BASE_REF: "master"
|
||||
_PULL_BASE_SHA: '12345'
|
|
@ -1388,13 +1388,11 @@ stream {
|
|||
{{ end }}
|
||||
|
||||
{{/* By default use vhost as Host to upstream, but allow overrides */}}
|
||||
{{ if not (eq $proxySetHeader "grpc_set_header") }}
|
||||
{{ if not (empty $location.UpstreamVhost) }}
|
||||
{{ $proxySetHeader }} Host {{ $location.UpstreamVhost | quote }};
|
||||
{{ else }}
|
||||
{{ $proxySetHeader }} Host $best_http_host;
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
# Pass the extracted client certificate to the backend
|
||||
{{ if not (empty $server.CertificateAuth.CAFileName) }}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
|
||||
E2E_BASE_IMAGE ?= "registry.k8s.io/ingress-nginx/e2e-test-runner:v20230527@sha256:a98ce8ab90f16bdd8539b168a4d000f366afa4eec23a220b3ce39698c5769bfd"
|
||||
E2E_BASE_IMAGE ?= "registry.k8s.io/ingress-nginx/e2e-test-runner:v20230623-d50c7193b@sha256:e5c68dc56934c273850bfb75c0348a2819756669baf59fcdce9e16771537b247"
|
||||
|
||||
image:
|
||||
echo "..entered Makefile in /test/e2e-image"
|
||||
|
|
|
@ -120,6 +120,7 @@ var _ = framework.DescribeAnnotation("backend-protocol - GRPC", func() {
|
|||
|
||||
metadata := res.GetMetadata()
|
||||
assert.Equal(ginkgo.GinkgoT(), metadata["content-type"].Values[0], "application/grpc")
|
||||
assert.Equal(ginkgo.GinkgoT(), metadata[":authority"].Values[0], host)
|
||||
})
|
||||
|
||||
ginkgo.It("authorization metadata should be overwritten by external auth response headers", func() {
|
||||
|
|
|
@ -26,21 +26,25 @@ import (
|
|||
)
|
||||
|
||||
var _ = framework.DescribeAnnotation("configuration-snippet", func() {
|
||||
f := framework.NewDefaultFramework("configurationsnippet")
|
||||
f := framework.NewDefaultFramework(
|
||||
"configurationsnippet",
|
||||
framework.WithHTTPBunEnabled(),
|
||||
)
|
||||
|
||||
ginkgo.BeforeEach(func() {
|
||||
f.NewEchoDeployment()
|
||||
})
|
||||
|
||||
ginkgo.It(`set snippet "more_set_headers "Foo1: Bar1";" in all locations"`, func() {
|
||||
ginkgo.It("set snippet more_set_headers in all locations", func() {
|
||||
host := "configurationsnippet.foo.com"
|
||||
annotations := map[string]string{
|
||||
"nginx.ingress.kubernetes.io/configuration-snippet": `
|
||||
more_set_headers "Foo1: Bar1";`,
|
||||
"nginx.ingress.kubernetes.io/configuration-snippet": `more_set_headers "Foo1: Bar1";`,
|
||||
}
|
||||
|
||||
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, annotations)
|
||||
f.EnsureIngress(ing)
|
||||
f.EnsureIngress(framework.NewSingleIngress(
|
||||
host,
|
||||
"/",
|
||||
host,
|
||||
f.Namespace,
|
||||
framework.HTTPBunService,
|
||||
80,
|
||||
annotations))
|
||||
|
||||
f.WaitForNginxServer(host,
|
||||
func(server string) bool {
|
||||
|
@ -51,23 +55,32 @@ var _ = framework.DescribeAnnotation("configuration-snippet", func() {
|
|||
GET("/").
|
||||
WithHeader("Host", host).
|
||||
Expect().
|
||||
Status(http.StatusOK).Headers().
|
||||
Status(http.StatusOK).
|
||||
Headers().
|
||||
ValueEqual("Foo1", []string{"Bar1"})
|
||||
})
|
||||
|
||||
ginkgo.It(`drops snippet "more_set_headers "Foo1: Bar1";" in all locations if disabled by admin"`, func() {
|
||||
ginkgo.It("drops snippet more_set_header in all locations if disabled by admin", func() {
|
||||
host := "noconfigurationsnippet.foo.com"
|
||||
annotations := map[string]string{
|
||||
"nginx.ingress.kubernetes.io/configuration-snippet": `
|
||||
more_set_headers "Foo1: Bar1";`,
|
||||
"nginx.ingress.kubernetes.io/configuration-snippet": `more_set_headers "Foo1: Bar1";`,
|
||||
}
|
||||
|
||||
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, annotations)
|
||||
ing := framework.NewSingleIngress(
|
||||
host,
|
||||
"/",
|
||||
host,
|
||||
f.Namespace,
|
||||
framework.HTTPBunService,
|
||||
80,
|
||||
annotations)
|
||||
|
||||
f.UpdateNginxConfigMapData("allow-snippet-annotations", "false")
|
||||
defer func() {
|
||||
// Return to the original value
|
||||
f.UpdateNginxConfigMapData("allow-snippet-annotations", "true")
|
||||
}()
|
||||
|
||||
// Sleep a while just to guarantee that the configmap is applied
|
||||
framework.Sleep()
|
||||
f.EnsureIngress(ing)
|
||||
|
@ -81,7 +94,8 @@ var _ = framework.DescribeAnnotation("configuration-snippet", func() {
|
|||
GET("/").
|
||||
WithHeader("Host", host).
|
||||
Expect().
|
||||
Status(http.StatusOK).Headers().
|
||||
Status(http.StatusOK).
|
||||
Headers().
|
||||
NotContainsKey("Foo1")
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue