Skip to content
This repository has been archived by the owner on Sep 12, 2024. It is now read-only.

Commit

Permalink
Merge pull request #4 from wpengine/fix-linting-and-rebase-kubernetes…
Browse files Browse the repository at this point in the history
…-main

Fix linting and rebase kubernetes main
  • Loading branch information
freddyesteban authored May 2, 2022
2 parents fb2b55b + 24e474c commit f844a65
Show file tree
Hide file tree
Showing 136 changed files with 3,219 additions and 1,629 deletions.
64 changes: 62 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,14 @@ jobs:
REGISTRY: ingress-controller
run: |
echo "building images..."
make clean-image build image
make clean-image build image image-chroot
make -C test/e2e-image image
echo "creating images cache..."
docker save \
nginx-ingress-controller:e2e \
ingress-controller/controller:1.0.0-dev \
ingress-controller/controller-chroot:1.0.0-dev \
| pigz > docker.tar.gz
- name: cache
Expand Down Expand Up @@ -145,7 +146,7 @@ jobs:
- name: Run helm-docs
run: |
GOBIN=$PWD GO111MODULE=on go install github.com/norwoodj/helm-docs/cmd/helm-docs@v1.6.0
GOBIN=$PWD GO111MODULE=on go install github.com/norwoodj/helm-docs/cmd/helm-docs@v1.8.1
./helm-docs --chart-search-root=${GITHUB_WORKSPACE}/charts
DIFF=$(git diff ${GITHUB_WORKSPACE}/charts/ingress-nginx/README.md)
if [ ! -z "$DIFF" ]; then
Expand Down Expand Up @@ -250,6 +251,65 @@ jobs:
kind get kubeconfig > $HOME/.kube/kind-config-kind
make kind-e2e-test
kubernetes-chroot:
name: Kubernetes chroot
runs-on: ubuntu-latest
needs:
- changes
- build
if: |
(needs.changes.outputs.go == 'true')
strategy:
matrix:
k8s: [v1.21.10, v1.22.7, v1.23.4]

steps:

- name: Checkout
uses: actions/checkout@v2

- name: cache
uses: actions/download-artifact@v2
with:
name: docker.tar.gz

- name: Create Kubernetes ${{ matrix.k8s }} cluster
id: kind
uses: engineerd/[email protected]
with:
version: v0.12.0
config: test/e2e/kind.yaml
image: kindest/node:${{ matrix.k8s }}

- uses: geekyeggo/delete-artifact@v1
with:
name: docker.tar.gz
failOnError: false

- name: Prepare cluster for testing
id: local-path
run: |
kubectl version
echo
echo "installing helm 3..."
curl -sSL https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash
- name: Load images from cache
run: |
echo "loading docker images..."
pigz -dc docker.tar.gz | docker load
- name: Run e2e tests
env:
KIND_CLUSTER_NAME: kind
SKIP_CLUSTER_CREATION: true
SKIP_IMAGE_CREATION: true
IS_CHROOT: true
run: |
kind get kubeconfig > $HOME/.kube/kind-config-kind
make kind-e2e-test
test-image-build:
permissions:
contents: read # for dorny/paths-filter to fetch a list of changed files
Expand Down
64 changes: 64 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,69 @@
# Changelog

### 1.2.0

Image:
- k8s.gcr.io/ingress-nginx/controller:v1.2.0@sha256:d8196e3bc1e72547c5dec66d6556c0ff92a23f6d0919b206be170bc90d5f9185
- k8s.gcr.io/ingress-nginx/controller-chroot:v1.2.0@sha256:fb17f1700b77d4fcc52ca6f83ffc2821861ae887dbb87149cf5cbc52bea425e5

This minor version release, introduces 2 breaking changes. For the first time, an option to jail/chroot the nginx process, inside the controller container, is being introduced.. This provides an additional layer of security, for sensitive information like K8S serviceaccounts. This release also brings a special new feature of deep inspection into objects. The inspection is a walk through of all the spec, checking for possible attempts to escape configs. Currently such an inspection only occurs for `networking.Ingress`. Additionally there are fixes for the recently announced CVEs on busybox & ssl_client. And there is a fix to a recently introduced redirection related bug, that was setting the protocol on URLs to "nil".

_Changes:_

- [8481](https://github.com/kubernetes/ingress-nginx/pull/8481) Fix log creation in chroot script
- [8479](https://github.com/kubernetes/ingress-nginx/pull/8479) changed nginx base img tag to img built with alpine3.14.6
- [8478](https://github.com/kubernetes/ingress-nginx/pull/8478) update base images and protobuf gomod
- [8468](https://github.com/kubernetes/ingress-nginx/pull/8468) Fallback to ngx.var.scheme for redirectScheme with use-forward-headers when X-Forwarded-Proto is empty
- [8456](https://github.com/kubernetes/ingress-nginx/pull/8456) Implement object deep inspector
- [8455](https://github.com/kubernetes/ingress-nginx/pull/8455) Update dependencies
- [8454](https://github.com/kubernetes/ingress-nginx/pull/8454) Update index.md
- [8447](https://github.com/kubernetes/ingress-nginx/pull/8447) typo fixing
- [8446](https://github.com/kubernetes/ingress-nginx/pull/8446) Fix suggested annotation-value-word-blocklist
- [8444](https://github.com/kubernetes/ingress-nginx/pull/8444) replace deprecated topology key in example with current one
- [8443](https://github.com/kubernetes/ingress-nginx/pull/8443) Add dependency review enforcement
- [8434](https://github.com/kubernetes/ingress-nginx/pull/8434) added new auth-tls-match-cn annotation
- [8426](https://github.com/kubernetes/ingress-nginx/pull/8426) Bump github.com/prometheus/common from 0.32.1 to 0.33.0
- [8417](https://github.com/kubernetes/ingress-nginx/pull/8417) force helm release to artifact hub
- [8405](https://github.com/kubernetes/ingress-nginx/pull/8405) kubectl-plugin code overview info
- [8399](https://github.com/kubernetes/ingress-nginx/pull/8399) Darwin arm64
- [8443](https://github.com/kubernetes/ingress-nginx/pull/8443) Add dependency review enforcement
- [8444](https://github.com/kubernetes/ingress-nginx/pull/8444) replace deprecated topology key in example with current one
- [8446](https://github.com/kubernetes/ingress-nginx/pull/8446) Fix suggested annotation-value-word-blocklist
- [8219](https://github.com/kubernetes/ingress-nginx/pull/8219) Add keepalive support for auth requests
- [8455](https://github.com/kubernetes/ingress-nginx/pull/8455) Update dependencies
- [8456](https://github.com/kubernetes/ingress-nginx/pull/8456) Implement object deep inspector
- [8325](https://github.com/kubernetes/ingress-nginx/pull/8325) Fix for buggy ingress sync with retries
- [8322](https://github.com/kubernetes/ingress-nginx/pull/8322) Improve req handling dashboard

### 1.2.0-beta.0

**Image:**
- k8s.gcr.io/ingress-nginx/controller:v1.2.0-beta.0@sha256:92115f5062568ebbcd450cd2cf9bffdef8df9fc61e7d5868ba8a7c9d773e0961
- k8s.gcr.io/ingress-nginx/controller-chroot:v1.2.0-beta.0@sha256:0082f0f547b147a30ad85a5d6d2ceb3edbf0848b2008ed754365b6678bdea9a5

This release introduces Jail/chroot nginx process inside controller container for the first time

_Changes:_

- [8417](https://github.com/kubernetes/ingress-nginx/pull/8417) force helm release to artifact hub
- [8421](https://github.com/kubernetes/ingress-nginx/pull/8421) fix change log changes list
- [8405](https://github.com/kubernetes/ingress-nginx/pull/8405) kubectl-plugin code overview info
- [8399](https://github.com/kubernetes/ingress-nginx/pull/8399) Darwin arm64
- [8443](https://github.com/kubernetes/ingress-nginx/pull/8443) Add dependency review enforcement
- [8426](https://github.com/kubernetes/ingress-nginx/pull/8426) Bump github.com/prometheus/common from 0.32.1 to 0.33.0
- [8444](https://github.com/kubernetes/ingress-nginx/pull/8444) replace deprecated topology key in example with current one
- [8447](https://github.com/kubernetes/ingress-nginx/pull/8447) typo fixing
- [8446](https://github.com/kubernetes/ingress-nginx/pull/8446) Fix suggested annotation-value-word-blocklist
- [8219](https://github.com/kubernetes/ingress-nginx/pull/8219) Add keepalive support for auth requests
- [8337](https://github.com/kubernetes/ingress-nginx/pull/8337) Jail/chroot nginx process inside controller container
- [8454](https://github.com/kubernetes/ingress-nginx/pull/8454) Update index.md
- [8455](https://github.com/kubernetes/ingress-nginx/pull/8455) Update dependencies
- [8456](https://github.com/kubernetes/ingress-nginx/pull/8456) Implement object deep inspector
- [8325](https://github.com/kubernetes/ingress-nginx/pull/8325) Fix for buggy ingress sync with retries
- [8322](https://github.com/kubernetes/ingress-nginx/pull/8322) Improve req handling dashboard
- [8464](https://github.com/kubernetes/ingress-nginx/pull/8464) Prepare v1.2.0-beta.0 release


### 1.1.3

**Image:**
Expand Down
32 changes: 31 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ endif

REGISTRY ?= gcr.io/k8s-staging-ingress-nginx

BASE_IMAGE ?= k8s.gcr.io/ingress-nginx/nginx:5402d35663917ccbbf77ff48a22b8c6f77097f48@sha256:ec8a104df307f5c6d68157b7ac8e5e1e2c2f0ea07ddf25bb1c6c43c67e351180
BASE_IMAGE ?= k8s.gcr.io/ingress-nginx/nginx:81c2afd975a6f9a9847184472286044d7d5296f6@sha256:a71ac64dd8cfd68341ba47dbdc4d8c2cb91325fce669875193ea0319118201b5

GOARCH=$(ARCH)

Expand All @@ -75,11 +75,30 @@ image: clean-image ## Build image for a particular arch.
--build-arg BUILD_ID="$(BUILD_ID)" \
-t $(REGISTRY)/controller:$(TAG) rootfs

.PHONY: image-chroot
image-chroot: clean-chroot-image ## Build image for a particular arch.
echo "Building docker image ($(ARCH))..."
@docker build \
--no-cache \
--build-arg BASE_IMAGE="$(BASE_IMAGE)" \
--build-arg VERSION="$(TAG)" \
--build-arg TARGETARCH="$(ARCH)" \
--build-arg COMMIT_SHA="$(COMMIT_SHA)" \
--build-arg BUILD_ID="$(BUILD_ID)" \
-t $(REGISTRY)/controller-chroot:$(TAG) rootfs -f rootfs/Dockerfile.chroot

.PHONY: clean-image
clean-image: ## Removes local image
echo "removing old image $(REGISTRY)/controller:$(TAG)"
@docker rmi -f $(REGISTRY)/controller:$(TAG) || true


.PHONY: clean-chroot-image
clean-chroot-image: ## Removes local image
echo "removing old image $(REGISTRY)/controller-chroot:$(TAG)"
@docker rmi -f $(REGISTRY)/controller-chroot:$(TAG) || true


.PHONY: build
build: ## Build ingress controller, debug tool and pre-stop hook.
@build/run-in-docker.sh \
Expand Down Expand Up @@ -221,3 +240,14 @@ release: ensure-buildx clean
--build-arg COMMIT_SHA="$(COMMIT_SHA)" \
--build-arg BUILD_ID="$(BUILD_ID)" \
-t $(REGISTRY)/controller:$(TAG) rootfs

@docker buildx build \
--no-cache \
--push \
--progress plain \
--platform $(subst $(SPACE),$(COMMA),$(PLATFORMS)) \
--build-arg BASE_IMAGE="$(BASE_IMAGE)" \
--build-arg VERSION="$(TAG)" \
--build-arg COMMIT_SHA="$(COMMIT_SHA)" \
--build-arg BUILD_ID="$(BUILD_ID)" \
-t $(REGISTRY)/controller-chroot:$(TAG) rootfs -f rootfs/Dockerfile.chroot
1 change: 1 addition & 0 deletions OWNERS_ALIASES
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ aliases:
- ElvinEfendi
- rikatz
- strongjz
- tao12345666333

ingress-nginx-reviewers:
- ElvinEfendi
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ For detailed changes on the `ingress-nginx` helm chart, please check the followi

| Ingress-NGINX version | k8s supported version | Alpine Version | Nginx Version |
|-----------------------|------------------------------|----------------|---------------|
| v1.2.0 | 1.23, 1.22, 1.21, 1.20, 1.19 | 3.14.6 | 1.19.10† |
| v1.1.3 | 1.23, 1.22, 1.21, 1.20, 1.19 | 3.14.4 | 1.19.10† |
| v1.1.2 | 1.23, 1.22, 1.21, 1.20, 1.19 | 3.14.2 | 1.19.9† |
| v1.1.1 | 1.23, 1.22, 1.21, 1.20, 1.19 | 3.14.2 | 1.19.9† |
Expand Down
24 changes: 19 additions & 5 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,10 @@ Promoting the images basically means that images, that were pushed to staging co
- Run the below command and save the output to a txt file

```
gh pr list -s merged -L 38 -B main | cut -f1,2 > ~/tmp/prlist.txt
gh pr list -s merged -L 38 -B main | cut -f1,2 | tee ~/Downloads/prlist.txt
```
- The -L 38 was used for 2 reasons.
- Default number of results is 30 and there were more than 30 PRs merged while releasing v1.1.1.
- Default number of results is 30 and there were more than 30 PRs merged while releasing v1.1.1. If you see the current/soon-to-be-old changelog, you can look at the most recent PR number that has been accounted for already, and start from after that last accounted for PR.
- The other reason to use -L 38 was to ommit the 39th, the 40th and the 41st line in the resulting list. These were non-relevant PRs.
- If you save the output of above command to a file called prlist.txt. It looks somewhat like this ;
Expand All @@ -190,8 +190,8 @@ Promoting the images basically means that images, that were pushed to staging co
8115 chart/ghaction: set the correct permission to have access to push a release
....
```
You can delete the lines, that refer to PRs of the release process itself. We only need to list the feature/bugfix PRs.
- Now you use some easy automation in bash/python/other, to get the PR-List that can be used in the changelog. For example, its possible to use a bash scripty way, seen below, to convert those plaintext PR numbers into clickable links.
You can delete the lines, that refer to PRs of the release process itself. We only need to list the feature/bugfix PRs. You can also delete the lines that are housekeeping or not really worth mentioning in the changelog.
- you use some easy automation in bash/python/other, to get the PR-List that can be used in the changelog. For example, its possible to use a bash scripty way, seen below, to convert those plaintext PR numbers into clickable links.
```
#!/usr/bin/bash
Expand All @@ -204,11 +204,25 @@ Promoting the images basically means that images, that were pushed to staging co
echo "[$pr_num](https://github.com/kubernetes/ingress-nginx/pull/$pr_num) $pr_title"
done <$file
```
- There was a parsing issue and path issue on MacOS, so above scrpt had to be modified and MacOS monterey compatible script is below ;
```
#!/bin/bash
file="$1"
while read -r line; do
pr_num=`echo "$line" | cut -f1`
pr_title=`echo "$line" | cut -f2`
echo \""[$pr_num](https://github.com/kubernetes/ingress-nginx/pull/$pr_num) $pr_title"\"
done <$file
```
- If you saved the bash script content above, in a file like `$HOME/bin/prlist_to_changelog.sh`, then you could execute a command like this to get your prlist in a text file called changelog_content.txt;`
```
prlist_to_changelog.sh prlist.txt > /tmp/changelog_content.txt`
prlist_to_changelog.sh ~/Downloads/prlist.txt | tee ~/Downloads//changelog_content.txt`
```
### d. Edit the values.yaml and run helm-docs
Expand Down
2 changes: 1 addition & 1 deletion TAG
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.1.3
v1.2.0
1 change: 1 addition & 0 deletions build/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,4 @@ go build \
-X ${PKG}/version.COMMIT=${COMMIT_SHA} \
-X ${PKG}/version.REPO=${REPO_INFO}" \
-o "${TARGETS_DIR}/wait-shutdown" "${PKG}/cmd/waitshutdown"

6 changes: 1 addition & 5 deletions build/run-in-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,7 @@ else
PLATFORM_FLAG=
fi

if [[ "$DOCKER_IN_DOCKER_ENABLED" == "true" ]]; then
/bin/bash -c "${FLAGS}"
else
docker run \
docker run \
${PLATFORM_FLAG} ${PLATFORM} \
--tty \
--rm \
Expand All @@ -81,4 +78,3 @@ else
-w "/go/src/${PKG}" \
-u $(id -u ${USER}):$(id -g ${USER}) \
${E2E_IMAGE} /bin/bash -c "${FLAGS}"
fi
1 change: 1 addition & 0 deletions build/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ set -o errexit
set -o nounset
set -o pipefail

mkdir -p /tmp/nginx
if [ -z "${PKG}" ]; then
echo "PKG must be set"
exit 1
Expand Down
Loading

0 comments on commit f844a65

Please sign in to comment.