10BC0 Merge branch 'main' into readiness-delay · nginx/kubernetes-ingress@650175d · GitHub
[go: up one dir, main page]

Skip to content

Commit 650175d

Browse files
authored
Merge branch 'main' into readiness-delay
2 parents 2900bdd + 7089925 commit 650175d

File tree

25 files changed

+129
-41
lines changed
  • internal/k8s
  • perf-tests
  • tests
  • 25 files changed

    +129
    -41
    lines changed

    .github/actions/smoke-tests/action.yaml

    Lines changed: 4 additions & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -87,8 +87,11 @@ runs:
    8787
    printf '%s\n' "1.20.0" "${{ inputs.k8s-version }}" | sort --version-sort --check=quiet || echo "Using ipv4" && sed -i 's/dual/ipv4/g' ${{ github.workspace }}/tests/ci-files/ci-kind-config.yaml
    8888
    kind create cluster --name ${{ github.run_id }} --image=kindest/node:v${{ inputs.k8s-version }} --config ${{ github.workspace }}/tests/ci-files/ci-kind-config.yaml --kubeconfig kube-${{ github.run_id }} --wait ${{ inputs.k8s-timeout }}
    8989
    kind load docker-image docker.io/nginx/${{ steps.ingress-type.outputs.name }}:${{ inputs.image }}-${{ github.sha }} --name ${{ github.run_id }}
    90+
    marker="${{ inputs.marker }}"
    91+
    sanitized_marker="${marker// /_}"
    92+
    name="${sanitized_marker:-${{ inputs.k8s-version }}}"
    9093
    echo ::set-output name=cluster_ip::$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${{ github.run_id }}-control-plane)
    91-
    echo ::set-output name=cluster::$(echo nginx-${{ inputs.image }}-${{ inputs.marker != '' && inputs.marker || inputs.k8s-version }})
    94+
    echo ::set-output name=cluster::$(echo nginx-${{ inputs.image }}-$name)
    9295
    shell: bash
    9396

    9497
    - name: Setup Kubeconfig

    .github/workflows/ci.yml

    Lines changed: 6 additions & 8 deletions
    Original file line numberDiff line numberDiff line change
    @@ -45,7 +45,6 @@ jobs:
    4545
    name: Checks and variables
    4646
    runs-on: ubuntu-20.04
    4747
    outputs:
    48-
    go_version: ${{ steps.vars.outputs.go_version }}
    4948
    go_path: ${{ steps.go.outputs.go_path }}
    5049
    k8s_latest: ${{ steps.vars.outputs.k8s_latest }}
    5150
    steps:
    @@ -63,12 +62,11 @@ jobs:
    6362
    - name: Output Variables
    6463
    id: vars
    6564
    run: |
    66-
    echo "::set-output name=go_version::$(grep "go 1." go.mod | cut -d " " -f 2)"
    6765
    echo "::set-output name=k8s_latest::$(grep -m1 'FROM kindest/node' <tests/docker/Dockerfile | awk -F'[:v]' '{print $3}')"
    6866
    - name: Setup Golang Environment
    6967
    uses: actions/setup-go@v3
    7068
    with:
    71-
    go-version: ${{ steps.vars.outputs.go_version }}
    69+
    go-version-file: go.mod
    7270
    - name: Determine GOPATH
    7371
    id: go
    7472
    run: echo "::set-output name=go_path::$(go env GOPATH)"
    @@ -102,7 +100,7 @@ jobs:
    102100
    - name: Setup Golang Environment
    103101
    uses: actions/setup-go@v3
    104102
    with:
    105-
    go-version: ${{ needs.checks.outputs.go_version }}
    103+
    go-version-file: go.mod
    106104
    - name: Build binary
    107105
    uses: goreleaser/goreleaser-action@v3
    108106
    with:
    @@ -138,7 +136,7 @@ jobs:
    138136
    - name: Setup Golang Environment
    139137
    uses: actions/setup-go@v3
    140138
    with:
    141-
    go-version: ${{ needs.checks.outputs.go_version }}
    139+
    go-version-file: go.mod
    142140
    - name: Run Tests
    143141
    run: make cover
    144142
    - name: Upload coverage to Codecov
    @@ -278,7 +276,7 @@ jobs:
    278276
    - name: Setup Golang Environment
    279277
    uses: actions/setup-go@v3
    280278
    with:
    281-
    go-version: ${{ needs.checks.outputs.go_version }}
    279+
    go-version-file: go.mod
    282280

    283281
    - uses: actions/setup-node@v3
    284282
    - run: npm install js-yaml
    @@ -457,7 +455,7 @@ jobs:
    457455
    BUILD_OS=${{ matrix.image }}
    458456
    IC_VERSION=${{ steps.var.outputs.ic_version }}
    459457
    - name: Run Trivy vulnerability scanner
    460-
    uses: aquasecurity/trivy-action@0.5.1
    458+
    uses: aquasecurity/trivy-action@0.6.1
    461459
    continue-on-error: true
    462460
    with:
    463461
    image-ref: nginx/nginx-ingress:${{ steps.meta.outputs.version }}
    @@ -596,7 +594,7 @@ jobs:
    596594
    "nginx-repo.crt=${{ secrets.NGINX_CRT }}"
    597595
    "nginx-repo.key=${{ secrets.NGINX_KEY }}"
    598596
    - name: Run Trivy vulnerability scanner
    599-
    uses: aquasecurity/trivy-action@0.5.1
    597+
    uses: aquasecurity/trivy-action@0.6.1
    600598
    continue-on-error: true
    601599
    with:
    602600
    image-ref: docker.io/${{ matrix.image }}:${{ steps.meta.outputs.version }}

    .github/workflows/lint.yml

    Lines changed: 1 addition & 4 deletions
    Original file line numberDiff line numberDiff line change
    @@ -29,13 +29,10 @@ jobs:
    2929
    steps:
    3030
    - name: Checkout Repository
    3131
    uses: actions/checkout@v3
    32-
    - name: Output Variables
    33-
    id: vars
    34-
    run: echo "::set-output name=go_version::$(grep "go 1." go.mod | cut -d " " -f 2)"
    3532
    - name: Setup Golang Environment
    3633
    uses: actions/setup-go@v3
    3734
    with:
    38-
    go-version: ${{ steps.vars.outputs.go_version }}
    35+
    go-version-file: go.mod
    3936
    - name: Lint Code
    4037
    uses: golangci/golangci-lint-action@v3
    4138
    with:

    .github/workflows/update-docker-images.yml

    Lines changed: 2 additions & 4 deletions
    Original file line numberDiff line numberDiff line change
    @@ -27,7 +27,6 @@ jobs:
    2727
    versions: ${{ steps.versions.outputs.matrix }}
    2828
    sha_short: ${{ steps.vars.outputs.sha_short }}
    2929
    sha_long: ${{ steps.vars.outputs.sha_long }}
    30-
    go_version: ${{ steps.vars.outputs.go_version }}
    3130
    k8s_version: ${{ steps.vars.outputs.k8s_version }}
    3231
    steps:
    3332
    - name: Checkout Repository
    @@ -55,7 +54,6 @@ jobs:
    5554
    run: |
    5655
    echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
    5756
    echo "::set-output name=sha_long::$(git rev-parse HEAD)"
    58-
    echo "::set-output name=go_version::$(grep "go 1." go.mod | cut -d " " -f 2)"
    5957
    echo "::set-output name=k8s_version::$(grep -m1 'FROM kindest/node' <tests/docker/Dockerfile | awk -F'[:v]' '{print $3}')"
    6058
    6159
    check:
    @@ -108,7 +106,7 @@ jobs:
    108106
    - name: Setup Golang Environment
    109107
    uses: actions/setup-go@v3
    110108
    with:
    111-
    go-version: ${{ needs.variables.outputs.go_version }}
    109+
    go-version-file: go.mod
    112110
    - name: Determine GOPATH
    113111
    id: go
    114112
    run: echo "::set-output name=go_path::$(go env GOPATH)"
    @@ -248,7 +246,7 @@ jobs:
    248246
    IC_VERSION=v${{ needs.variables.outputs.kic-tag }}
    249247
    if: ${{ matrix.needs-updating == 'true' }}
    250248
    - name: Run Trivy vulnerability scanner
    251-
    uses: aquasecurity/trivy-action@0.5.1
    249+
    uses: aquasecurity/trivy-action@0.6.1
    252250
    continue-on-error: true
    253251
    with:
    254252
    image-ref: nginx/nginx-ingress:${{ steps.meta.outputs.version }}

    build/Dockerfile

    Lines changed: 4 additions & 4 deletions
    Original file line numberDiff line numberDiff line change
    @@ -6,12 +6,12 @@ ARG DEBIAN_VERSION=bullseye-slim
    66

    77

    88
    ############################################# Base images containing libs for Opentracing #############################################
    9-
    FROM opentracing/nginx-opentracing:nginx-1.23.0 as opentracing-lib
    10-
    FROM opentracing/nginx-opentracing:nginx-1.23.0-alpine as alpine-opentracing-lib
    9+
    FROM opentracing/nginx-opentracing:nginx-1.23.1 as opentracing-lib
    10+
    FROM opentracing/nginx-opentracing:nginx-1.23.1-alpine as alpine-opentracing-lib
    1111

    1212

    1313
    ############################################# Base image for Debian #############################################
    14-
    FROM nginx:1.23.0 AS debian
    14+
    FROM nginx:1.23.1 AS debian
    1515

    1616
    RUN --mount=type=bind,from=opentracing-lib,target=/tmp/ot/ \
    1717
    apt-get update \
    @@ -27,7 +27,7 @@ RUN --mount=type=bind,from=opentracing-lib,target=/tmp/ot/ \
    2727

    2828
    ############################################# Base image for Alpine #############################################
    2929
    # docker.io/library/nginx is a temporary workaround for Dependabot to see this as different from the one used in Debian
    30-
    FROM docker.io/library/nginx:1.23.0-alpine AS alpine
    30+
    FROM docker.io/library/nginx:1.23.1-alpine AS alpine
    3131

    3232
    RUN --mount=type=bind,from=alpine-opentracing-lib,target=/tmp/ot/ \
    3333
    apk add --no-cache libcap libstdc++ \

    cmd/nginx-ingress/flags.go

    Lines changed: 9 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -6,6 +6,7 @@ import (
    66
    "net"
    77
    "os"
    88
    "regexp"
    9+
    "strconv"
    910
    "strings"
    1011

    1112
    "github.com/golang/glog"
    @@ -174,6 +175,9 @@ var (
    174175
    enableExternalDNS = flag.Bool("enable-external-dns", false,
    175176
    "Enable external-dns controller for VirtualServer resources. Requires -enable-custom-resources")
    176177

    178+
    includeYearInLogs = flag.Bool("include-year", false,
    179+
    "Option to include the year in the log header")
    180+
    177181
    startupCheckFn func() error
    178182
    )
    179183

    @@ -261,6 +265,11 @@ func initialChecks() {
    261265
    glog.Fatalf("Error setting logtostderr to true: %v", err)
    262266
    }
    263267

    268+
    err = flag.Lookup("include_year").Value.Set(strconv.FormatBool(*includeYearInLogs))
    269+
    if err != nil {
    270+
    glog.Fatalf("Error setting include_year flag: %v", err)
    271+
    }
    272+
    264273
    if startupCheckFn != nil {
    265274
    err := startupCheckFn()
    266275
    if err != nil {

    deployments/daemon-set/nginx-ingress.yaml

    Lines changed: 1 addition & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -64,6 +64,7 @@ spec:
    6464
    args:
    6565
    - -nginx-configmaps=$(POD_NAMESPACE)/nginx-config
    6666
    - -default-server-tls-secret=$(POD_NAMESPACE)/default-server-secret
    67+
    #- -include-year
    6768
    #- -v=3 # Enables extensive logging. Useful for troubleshooting.
    6869
    #- -report-ingress-status
    6970
    #- -external-service=nginx-ingress

    deployments/daemon-set/nginx-plus-ingress.yaml

    Lines changed: 1 addition & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -65,6 +65,7 @@ spec:
    6565
    - -nginx-plus
    6666
    - -nginx-configmaps=$(POD_NAMESPACE)/nginx-config
    6767
    - -default-server-tls-secret=$(POD_NAMESPACE)/default-server-secret
    68+
    #- -include-year
    6869
    #- -enable-app-protect
    6970
    #- -enable-app-protect-dos
    7071
    #- -v=3 # Enables extensive logging. Useful for troubleshooting.

    deployments/deployment/nginx-ingress.yaml

    Lines changed: 1 addition & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -64,6 +64,7 @@ spec:
    6464
    args:
    6565
    - -nginx-configmaps=$(POD_NAMESPACE)/nginx-config
    6666
    - -default-server-tls-secret=$(POD_NAMESPACE)/default-server-secret
    67+
    #- -include-year
    6768
    #- -enable-cert-manager
    6869
    #- -enable-external-dns
    6970
    #- -v=3 # Enables extensive logging. Useful for troubleshooting.

    deployments/deployment/nginx-plus-ingress.yaml

    Lines changed: 1 addition & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -65,6 +65,7 @@ spec:
    6565
    - -nginx-plus
    6666
    - -nginx-configmaps=$(POD_NAMESPACE)/nginx-config
    6767
    - -default-server-tls-secret=$(POD_NAMESPACE)/default-server-secret
    68+
    #- -include-year
    6869
    #- -enable-cert-manager
    6970
    #- -enable-external-dns
    7071
    #- -enable-app-protect

    0 commit comments

    Comments
     (0)
    0