Skip to content

Commit

Permalink
Merge branch 'main' into helm-controler-service-name
Browse files Browse the repository at this point in the history
  • Loading branch information
ciarams87 authored Jun 7, 2023
2 parents 482a602 + 268b00b commit 942a5f2
Show file tree
Hide file tree
Showing 22 changed files with 227 additions and 190 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-oss.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
if: ${{ github.event_name != 'pull_request' && ! startsWith(github.ref, 'refs/heads/release-') }}

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@e1e17a757e536f70e52b5a12b2e8d1d1c60e04ef # v2.0.0
uses: aws-actions/configure-aws-credentials@5727f247b64f324ec403ac56ae05e220fd02b65f # v2.1.0
with:
aws-region: us-east-1
role-to-assume: ${{ secrets.AWS_ROLE_PUBLIC_ECR }}
Expand Down Expand Up @@ -148,7 +148,7 @@ jobs:
IC_VERSION=${{ (github.event_name == 'pull_request' || startsWith(github.ref, 'refs/heads/release-')) && 'CI' || steps.meta.outputs.version }}
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@e5f43133f6e8736992c9f3c1b3296e24b37e17f2 # 0.10.0
uses: aquasecurity/trivy-action@b43daad0c3c96202fc5800b511dfae8e6ecce864 # 0.11.0
continue-on-error: true
with:
image-ref: nginx/nginx-ingress:${{ steps.meta.outputs.version }}
Expand All @@ -157,7 +157,7 @@ jobs:
ignore-unfixed: "true"

- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@29b1f65c5e92e24fe6b6647da1eaabe529cec70f # v2.3.3
uses: github/codeql-action/upload-sarif@83f0fe6c4988d98a455712a27f0255212bba9bd4 # v2.3.6
continue-on-error: true
with:
sarif_file: "trivy-results-${{ inputs.image }}.sarif"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build-plus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
if: github.event_name != 'pull_request'

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@e1e17a757e536f70e52b5a12b2e8d1d1c60e04ef # v2.0.0
uses: aws-actions/configure-aws-credentials@5727f247b64f324ec403ac56ae05e220fd02b65f # v2.1.0
with:
aws-region: us-east-1
role-to-assume: ${{ secrets.AWS_ROLE_MARKETPLACE }}
Expand Down Expand Up @@ -162,7 +162,7 @@ jobs:
${{ inputs.nap_modules != '' && contains(inputs.image, 'ubi') && format('"rhel_license={0}"', secrets.RHEL_LICENSE) || '' }}
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@e5f43133f6e8736992c9f3c1b3296e24b37e17f2 # 0.10.0
uses: aquasecurity/trivy-action@b43daad0c3c96202fc5800b511dfae8e6ecce864 # 0.11.0
continue-on-error: true
with:
image-ref: docker.io/${{ inputs.image }}:${{ steps.meta.outputs.version }}
Expand All @@ -171,7 +171,7 @@ jobs:
ignore-unfixed: 'true'

- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@29b1f65c5e92e24fe6b6647da1eaabe529cec70f # v2.3.3
uses: github/codeql-action/upload-sarif@83f0fe6c4988d98a455712a27f0255212bba9bd4 # v2.3.6
continue-on-error: true
with:
sarif_file: 'trivy-results-${{ inputs.image }}.sarif'
Expand Down
70 changes: 35 additions & 35 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- main
- release-*
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- "v[0-9]+.[0-9]+.[0-9]+"
pull_request:
branches:
- main
Expand All @@ -16,7 +16,7 @@ on:
- reopened
- synchronize
schedule:
- cron: '0 4 * * *' # run every day at 04:00 UTC
- cron: "0 4 * * *" # run every day at 04:00 UTC

defaults:
run:
Expand All @@ -27,7 +27,6 @@ concurrency:
cancel-in-progress: true

jobs:

checks:
name: Checks and variables
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -92,16 +91,16 @@ jobs:
- name: Create/Update Draft
uses: lucacome/draft-release@b79be3ff634f771230b2b6ee9f47308c5793671a # v0.2.0
with:
minor-label: 'enhancement'
major-label: 'change'
minor-label: "enhancement"
major-label: "change"
publish: ${{ startsWith(github.ref, 'refs/tags/') }}
collapse-after: 50
variables: |
helm-chart=${{ needs.checks.outputs.chart_version }}
notes-footer: |
## Upgrade
- For NGINX, use the {{version}} image from our [DockerHub](https://hub.docker.com/r/nginx/nginx-ingress/tags?page=1&ordering=last_updated&name={{version-number}}), [GitHub Container](https://github.com/nginxinc/kubernetes-ingress/pkgs/container/kubernetes-ingress), [Amazon ECR Public Gallery](https://gallery.ecr.aws/nginx/nginx-ingress) or [Quay.io](https://quay.io/repository/nginx/nginx-ingress).
- For NGINX Plus, use the {{version}} image from the F5 Container registry or the [AWS Marketplace](https://aws.amazon.com/marketplace/search/?CREATOR=741df81b-dfdc-4d36-b8da-945ea66b522c&FULFILLMENT_OPTION_TYPE=CONTAINER&filters=CREATOR%2CFULFILLMENT_OPTION_TYPE) or build your own image using the {{version}} source code.
- For NGINX, use the {{version}} images from our [DockerHub](https://hub.docker.com/r/nginx/nginx-ingress/tags?page=1&ordering=last_updated&name={{version-number}}), [GitHub Container](https://github.com/nginxinc/kubernetes-ingress/pkgs/container/kubernetes-ingress), [Amazon ECR Public Gallery](https://gallery.ecr.aws/nginx/nginx-ingress) or [Quay.io](https://quay.io/repository/nginx/nginx-ingress).
- For NGINX Plus, use the {{version}} images from the F5 Container registry, the [AWS Marketplace](https://aws.amazon.com/marketplace/search/?CREATOR=741df81b-dfdc-4d36-b8da-945ea66b522c&FULFILLMENT_OPTION_TYPE=CONTAINER&filters=CREATOR%2CFULFILLMENT_OPTION_TYPE), the [GCP Marketplace](https://console.cloud.google.com/marketplace/browse?filter=partner:F5,%20Inc.&filter=solution-type:k8s&filter=category:networking) or build your own image using the {{version}} source code.
- For Helm, use version {{helm-chart}} of the chart.
## Resources
Expand Down Expand Up @@ -163,10 +162,10 @@ jobs:
strategy:
matrix:
include:
- image: debian
type: oss
- image: debian-plus
type: plus
- image: debian
type: oss
- image: debian-plus
type: plus
steps:
- name: Checkout Repository
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
Expand All @@ -181,7 +180,7 @@ jobs:
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 # v4.0.0
with:
file: build/Dockerfile
context: '.'
context: "."
cache-from: type=gha,scope=${{ matrix.image }}
target: goreleaser
tags: ${{ matrix.type }}:${{ github.sha }}
Expand Down Expand Up @@ -270,7 +269,7 @@ jobs:
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 # v4.0.0
with:
file: tests/docker/Dockerfile
context: '.'
context: "."
cache-from: type=gha,scope=test-runner
cache-to: type=gha,scope=test-runner,mode=max
tags: test-runner:${{ github.sha }}
Expand Down Expand Up @@ -308,13 +307,14 @@ jobs:
name: Build Docker OSS
needs: smoke-tests
strategy:
fail-fast: false
matrix:
image: [debian, alpine]
platforms: ["linux/arm, linux/arm64, linux/amd64, linux/ppc64le, linux/s390x"]
include:
- image: ubi
platforms: "linux/arm64, linux/amd64, linux/ppc64le, linux/s390x"
fail-fast: false
matrix:
image: [debian, alpine]
platforms:
["linux/arm, linux/arm64, linux/amd64, linux/ppc64le, linux/s390x"]
include:
- image: ubi
platforms: "linux/arm64, linux/amd64, linux/ppc64le, linux/s390x"
uses: ./.github/workflows/build-oss.yml
with:
platforms: ${{ matrix.platforms }}
Expand All @@ -325,15 +325,15 @@ jobs:
name: Build Docker Plus
needs: build-docker
strategy:
fail-fast: false
matrix:
image: [debian-plus, alpine-plus]
platforms: ["linux/arm64, linux/amd64"]
target: [goreleaser, aws]
include:
- image: ubi-plus
platforms: "linux/arm64, linux/amd64, linux/s390x"
target: goreleaser
fail-fast: false
matrix:
image: [debian-plus, alpine-plus]
platforms: ["linux/arm64, linux/amd64"]
target: [goreleaser, aws]
include:
- image: ubi-plus
platforms: "linux/arm64, linux/amd64, linux/s390x"
target: goreleaser
uses: ./.github/workflows/build-plus.yml
with:
platforms: ${{ matrix.platforms }}
Expand All @@ -345,12 +345,12 @@ jobs:
name: Build Docker NAP
needs: build-docker-plus
strategy:
fail-fast: false
matrix:
image: [debian-plus-nap, ubi-plus-nap]
platforms: ["linux/amd64"]
target: [goreleaser, aws]
nap_modules: [dos, waf, "waf,dos"]
fail-fast: false
matrix:
image: [debian-plus-nap, ubi-plus-nap]
platforms: ["linux/amd64"]
target: [goreleaser, aws]
nap_modules: [dos, waf, "waf,dos"]
uses: ./.github/workflows/build-plus.yml
with:
platforms: ${{ matrix.platforms }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@29b1f65c5e92e24fe6b6647da1eaabe529cec70f # v2.3.3
uses: github/codeql-action/init@83f0fe6c4988d98a455712a27f0255212bba9bd4 # v2.3.6
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -47,7 +47,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@29b1f65c5e92e24fe6b6647da1eaabe529cec70f # v2.3.3
uses: github/codeql-action/autobuild@83f0fe6c4988d98a455712a27f0255212bba9bd4 # v2.3.6

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -61,4 +61,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@29b1f65c5e92e24fe6b6647da1eaabe529cec70f # v2.3.3
uses: github/codeql-action/analyze@83f0fe6c4988d98a455712a27f0255212bba9bd4 # v2.3.6
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
with:
go-version-file: go.mod
- name: Lint Code
uses: golangci/golangci-lint-action@08e2f20817b15149a52b5b3ebe7de50aff2ba8c5 # v3.4.0
uses: golangci/golangci-lint-action@5f1fec7010f6ae3b84ea4f7b2129beb8639b564f # v3.5.0
with:
only-new-issues: true

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scorecards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,6 @@ jobs:

# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@29b1f65c5e92e24fe6b6647da1eaabe529cec70f # v2.3.3
uses: github/codeql-action/upload-sarif@83f0fe6c4988d98a455712a27f0255212bba9bd4 # v2.3.6
with:
sarif_file: results.sarif
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ repos:
types: [go]
pass_filenames: false
- repo: https://github.com/golangci/golangci-lint
rev: v1.52.2
rev: v1.53.2
hooks:
- id: golangci-lint
args: [--new-from-patch=/tmp/diff.patch]
Expand All @@ -57,7 +57,7 @@ repos:
hooks:
- id: black
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.23.0
rev: 0.23.1
hooks:
- id: check-jsonschema
name: "Check Helm Chart JSON Schema"
Expand Down
10 changes: 5 additions & 5 deletions build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ ARG DOWNLOAD_TAG=edge


############################################# Base images containing libs for Opentracing #############################################
FROM opentracing/nginx-opentracing:nginx-1.23.4 as opentracing-lib
FROM opentracing/nginx-opentracing:nginx-1.23.4-alpine as alpine-opentracing-lib
FROM opentracing/nginx-opentracing:nginx-1.25.0 as opentracing-lib
FROM opentracing/nginx-opentracing:nginx-1.25.0-alpine as alpine-opentracing-lib


############################################# Base image for Debian #############################################
FROM nginx:1.23.4 AS debian
FROM nginx:1.25.0 AS debian

RUN --mount=type=bind,from=opentracing-lib,target=/tmp/ot/ \
apt-get update \
Expand All @@ -24,7 +24,7 @@ RUN --mount=type=bind,from=opentracing-lib,target=/tmp/ot/ \


############################################# Base image for Alpine #############################################
FROM nginx:1.23.4-alpine AS alpine
FROM nginx:1.25.0-alpine AS alpine

RUN --mount=type=bind,from=alpine-opentracing-lib,target=/tmp/ot/ \
apk add --no-cache libcap libstdc++ \
Expand Down Expand Up @@ -110,7 +110,7 @@ RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode


############################################# Base image for UBI #############################################
FROM nginxcontrib/nginx:1.23.4-ubi AS ubi
FROM nginxcontrib/nginx:1.25.0-ubi AS ubi
ARG IC_VERSION

LABEL name="NGINX Ingress Controller" \
Expand Down
2 changes: 1 addition & 1 deletion deployments/daemon-set/nginx-ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ spec:
securityContext:
seccompProfile:
type: RuntimeDefault
# fsGroup: 101 #nginx
# volumes:
# - name: nginx-etc
# emptyDir: {}
Expand Down Expand Up @@ -63,6 +62,7 @@ spec:
allowPrivilegeEscalation: false
# readOnlyRootFilesystem: true
runAsUser: 101 #nginx
runAsNonRoot: true
capabilities:
drop:
- ALL
Expand Down
2 changes: 1 addition & 1 deletion deployments/daemon-set/nginx-plus-ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ spec:
securityContext:
seccompProfile:
type: RuntimeDefault
# fsGroup: 101 #nginx
# volumes:
# - name: nginx-etc
# emptyDir: {}
Expand Down Expand Up @@ -63,6 +62,7 @@ spec:
allowPrivilegeEscalation: false
# readOnlyRootFilesystem: true
runAsUser: 101 #nginx
runAsNonRoot: true
capabilities:
drop:
- ALL
Expand Down
1 change: 0 additions & 1 deletion deployments/deployment/nginx-ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ spec:
securityContext:
seccompProfile:
type: RuntimeDefault
# fsGroup: 101 #nginx
# volumes:
# - name: nginx-etc
# emptyDir: {}
Expand Down
1 change: 0 additions & 1 deletion deployments/deployment/nginx-plus-ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ spec:
securityContext:
seccompProfile:
type: RuntimeDefault
# fsGroup: 101 #nginx
# volumes:
# - name: nginx-etc
# emptyDir: {}
Expand Down
3 changes: 0 additions & 3 deletions deployments/helm-chart/templates/controller-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ spec:
securityContext:
seccompProfile:
type: RuntimeDefault
{{- if .Values.controller.readOnlyRootFilesystem }}
fsGroup: 101 #nginx
{{- end }}
terminationGracePeriodSeconds: {{ .Values.controller.terminationGracePeriodSeconds }}
{{- if .Values.controller.nodeSelector }}
nodeSelector:
Expand Down
3 changes: 0 additions & 3 deletions deployments/helm-chart/templates/controller-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,6 @@ spec:
securityContext:
seccompProfile:
type: RuntimeDefault
{{- if .Values.controller.readOnlyRootFilesystem }}
fsGroup: 101 #nginx
{{- end }}
terminationGracePeriodSeconds: {{ .Values.controller.terminationGracePeriodSeconds }}
hostNetwork: {{ .Values.controller.hostNetwork }}
dnsPolicy: {{ .Values.controller.dnsPolicy }}
Expand Down
4 changes: 0 additions & 4 deletions docs/content/configuration/security.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,6 @@ When using manifests instead of Helm, uncomment the following sections of the de
Refer to the below code-block for guidance:

```
# fsGroup: 101 #nginx
.
.
.
# volumes:
# - name: nginx-etc
# emptyDir: {}
Expand Down
Loading

0 comments on commit 942a5f2

Please sign in to comment.