Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/next' into feat/profiling_for_ki…
Browse files Browse the repository at this point in the history
…c_2.0
  • Loading branch information
mflendrich committed Jun 11, 2021
2 parents 4dfd35f + 897d8a2 commit 6e7d531
Show file tree
Hide file tree
Showing 11 changed files with 239 additions and 56 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
name: Build and push development images
name: Build and push 1.x images

on:
push:
branches:
- 'main-test'
- 'main'
- 'next'
tags:
- '*'
- '1.*'
- 'v1.*'

jobs:
docker:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,38 @@
name: Test
name: 1.x Integration Tests

on: [push]
on:
pull_request:
branches:
- 'main'
- 'next'
push:
branches:
- '*'
tags:
- '1.*'
- 'v1.*'

jobs:
# Golang Integration tests, using the legacy manager/1.x CLI
integration-test:
runs-on: ubuntu-latest
steps:
- name: setup golang
uses: actions/setup-go@v2
with:
go-version: '^1.16'
- name: cache go modules
uses: actions/[email protected]
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-build-codegen-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go
- name: checkout repository
uses: actions/checkout@v2
- name: run railgun integration tests on legacy KIC
run: make test.integration.legacy
working-directory: ./railgun
build:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -32,8 +62,8 @@ jobs:
with:
name: image
path: image.tar

test-k8s:
# Bash-based integration tests
integration-test-legacy:
needs: build
runs-on: ubuntu-latest
env:
Expand Down
80 changes: 80 additions & 0 deletions .github/workflows/2x-docker-build-push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Build and push 2.x images

on:
push:
branches:
- 'main'
- 'next'
tags:
- '2.*'
- 'v2.*'

jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Parse semver string
id: semver_parser
if: ${{ contains(github.ref, 'tags') }}
uses: booxmedialtd/ws-action-parse-semver@v1
with:
input_string: ${{ github.ref }}
version_extractor_regex: 'refs\/tags\/(.*)$'
- name: Add Railgun standard tags
run: |
echo 'RAILGUN_STANDARD<<EOF' >> $GITHUB_ENV
echo 'type=ref,event=branch,suffix=-railgun' >> $GITHUB_ENV
echo 'type=semver,pattern={{version}}' >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- name: Add Railgun major.minor tag
if: ${{ steps.semver_parser.outputs.prerelease == '' }}
run: |
echo 'RAILGUN_SUPPLEMENTAL<<EOF' >> $GITHUB_ENV
echo "" >> $GITHUB_ENV
echo 'type=semver,pattern={{major}}.{{minor}}' >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
uses: actions/[email protected]
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Docker meta (railgun)
id: meta_railgun
uses: docker/[email protected]
with:
images: kong/kubernetes-ingress-controller
flavor: |
latest=false
tags: ${{ env.RAILGUN_STANDARD }}${{ env.RAILGUN_SUPPLEMENTAL }}
- name: Build binary
env:
TAG: ${{ steps.meta_railgun.outputs.version }}
COMMIT: ${{ github.sha }}
REPO_INFO: https:/${{ github.repository }}.git
id: docker_build_binary
uses: docker/build-push-action@v2
with:
push: false
file: Dockerfile.railgun
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
target: builder
- name: Build and push Railgun
id: docker_build_railgun
env:
TAG: ${{ steps.meta_railgun.outputs.version }}
uses: docker/build-push-action@v2
with:
push: true
file: Dockerfile.railgun
tags: ${{ steps.meta_railgun.outputs.tags }}
cache-from: type=local,src=/tmp/.buildx-cache
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Integration Tests
name: 2.x Integration Tests

on:
pull_request:
Expand All @@ -7,10 +7,10 @@ on:
- 'next'
push:
branches:
- 'main'
- 'next'
- '*'
tags:
- 'v*.*.*'
- '2.*'
- 'v2.*'

jobs:
integration-test-dbless:
Expand Down Expand Up @@ -51,22 +51,3 @@ jobs:
- name: run railgun integration tests
run: make test.integration.postgres
working-directory: ./railgun
integration-test-legacy:
runs-on: ubuntu-latest
steps:
- name: setup golang
uses: actions/setup-go@v2
with:
go-version: '^1.16'
- name: cache go modules
uses: actions/[email protected]
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-build-codegen-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go
- name: checkout repository
uses: actions/checkout@v2
- name: run railgun integration tests on legacy KIC
run: make test.integration.legacy
working-directory: ./railgun
18 changes: 14 additions & 4 deletions .github/workflows/test.yaml → .github/workflows/common-test.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
name: Test
# Linting, unit tests, and generated resource verification
name: Common Tests

on: [push, pull_request]
on:
pull_request:
branches:
- 'main'
- 'next'
push:
branches:
- '*'
tags:
- '*'

jobs:
lint:
lint-and-verify-generated:
runs-on: ubuntu-latest
steps:
- name: Setup go
Expand Down Expand Up @@ -34,7 +44,7 @@ jobs:
- name: Verify manifest consistency
run: |
make verify-manifests
test:
unit-test:
environment: "Configure ci"
runs-on: ubuntu-latest
steps:
Expand Down
15 changes: 14 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Table of Contents

- [2.0.0-alpha.1](#200-alpha1---20210527)
- [1.3.1](#131---20210603)
- [1.3.0](#130---20210527)
- [1.2.0](#120---20210324)
- [1.1.1](#111---20210107)
Expand Down Expand Up @@ -101,6 +102,17 @@ released and the release notes may change significantly before then.
[go]:https://golang.org
[ktf]:https:/kong/kubernetes-testing-framework

## [1.3.1] - 2021/06/03

#### Fixed

- fixed a bug that now stops `v1.3.x` releases from advertising themselves as `v2` if manually built with default configurations.

#### Under the hood

- Upgraded CI dependencies
- Some cleanup iterations on RELEASE.md release process

## [1.3.0] - 2021/05/27

#### Added
Expand All @@ -112,7 +124,7 @@ released and the release notes may change significantly before then.

- Sort SNIs and certificates consistently to avoid an issue with unnecessary
configuration re-syncs.
[#1268](https:/Kong/kubernetes-ingress-controller/pull/1016/)
[#1268](https:/Kong/kubernetes-ingress-controller/pull/1268/)

#### Under the hood

Expand Down Expand Up @@ -1095,6 +1107,7 @@ Please read the changelog and test in your environment.
a working ingress controller.

[2.0.0-alpha.1]: https:/kong/kubernetes-ingress-controller/compare/1.2.0...2.0.0-alpha.1
[1.3.1]: https:/kong/kubernetes-ingress-controller/compare/1.3.0...1.3.1
[1.3.0]: https:/kong/kubernetes-ingress-controller/compare/1.2.0...1.3.0
[1.2.0]: https:/kong/kubernetes-ingress-controller/compare/1.1.1...1.2.0
[1.1.1]: https:/kong/kubernetes-ingress-controller/compare/1.1.0...1.1.1
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
TAG?=1.3.0
TAG?=1.3.1
RG_TAG?=2.0.0-alpha.1
REGISTRY?=kong
REPO_INFO=$(shell git config --get remote.origin.url)
Expand Down
53 changes: 39 additions & 14 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,45 @@
# KIC Release process
# Release Process

## Git workflow and image builds
## Prerequisites

- [ ] Merge main into next (ignore if patch release). Use a merge commit.
- [ ] Check out a new branch from next (major/minor release) or main (patch release), e.g. `release/1.2.0`.
- [ ] Update manifest versions under `deploy/base` with the new version and run `hack/build-single-manifests.sh` (ignore for pre-releases).
- [ ] Bump the Makefile version (see [example](https:/Kong/kubernetes-ingress-controller/pull/851/commits/b874b36bfdb0d7c6a13cc35ed06f666d135b04a4)
- [Docker](https://docs.docker.com/get-docker/) `v20.10.x`
- [GNU Make](https://www.gnu.org/software/make/) `v4.x`
- [Kustomize](https:/kubernetes-sigs/kustomize) `v1.3.x`

## Release Branch

**For all releases**

For this step we're going to start with the `next` branch and merge in `main` to create our release branch (e.g. `release/X.Y.Z`) which will later be submitted as a pull request back to `main`.

- [ ] ensure that you have up to date copy of `main` and `next`: `git fetch --all`
- [ ] merge main into next: `git checkout next && git merge main`
- [ ] create the release branch for the version (e.g. `release/1.3.1`): `git branch -m release/x.y.z`
- [ ] Make any final adjustments to CHANGELOG.md. Double-check that dates are correct, that link anchors point to the correct header, and that you've included a link to the Github compare link at the end.
- [ ] Open a PR from your branch to next (major/minor) or main (patch).
- [ ] Once the PR is merged, tag your release (e.g. `git fetch; git tag origin/next 1.2.0; git push origin --tags`.
- [ ] Wait for CI to build images and push them to Docker Hub.
- [ ] Open a PR from next to main (ignore if patch release).
- [ ] [Draft a new release](https:/Kong/kubernetes-ingress-controller/releases), using a title and body similar to previous releases. Use your existing tag.
- [ ] Create a new minor version branch and push it, e.g. `git checkout 1.2.0; git checkout -b 1.2.x; git push 1.2.x` (ignore if patch or pre-release).
- [ ] update manifest files: `./hack/build-single-manifests.sh`
- [ ] update the `TAG` variable in the `Makefile` to the new version release and commit the change
- [ ] push the branch up to the remote: `git push --set-upstream origin release/x.y.z`

## Release Pull Request

**For all releases**

- [ ] Open a PR from your branch to `next` (major/minor) or `main` (patch)
- [ ] Once the PR is merged, tag your release: `git fetch --all && git tag origin/next 1.3.1 && git push origin --tags`
- [ ] Wait for CI to build images and push them to Docker Hub
- [ ] Open a PR from next to main (ignore if patch release)

## Github Release

**For all releases**

- [ ] draft a new [release](https:/Kong/kubernetes-ingress-controller/releases), using a title and body similar to previous releases. Use your existing tag.
- [ ] for new `major` version releases create a new branch (e.g. `1.3.x`) from the release tag and push it
- [ ] for `minor` and `patch` version releases rebase the release tag onto the release branch: `git checkout 1.3.x && git rebase 1.3.1 && git push`

## Documentation

For major/minor releases only.
**For major/minor releases only**

- [ ] Create a new branch in the [documentation site repo](https:/Kong/docs.konghq.com).
- [ ] Copy `app/kubernetes-ingress-controller/OLD_VERSION` to `app/kubernetes-ingress-controller/NEW_VERSION`.
Expand All @@ -26,9 +49,11 @@ For major/minor releases only.
- [ ] Add a section to `app/_data/kong_versions.yml` for your version.
- [ ] Open a PR from your branch.

# Release Troubleshooting

## Manual Docker image build

If the "Build and push development images" Github action is not appropriate for your release, or is not operating properly, you can build and push Docker images manually.
If the "Build and push development images" Github action is not appropriate for your release, or is not operating properly, you can build and push Docker images manually:

- [ ] Check out your release tag.
- [ ] Run `make container` (legacy) or `make railgun-container` (Railgun/2.x). Note that you can set the `TAG` environment variable if you need to override the current tag in Makefile.
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ require (
github.com/pelletier/go-toml v1.8.1 // indirect
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.11.0
github.com/prometheus/common v0.27.0
github.com/prometheus/common v0.29.0
github.com/sirupsen/logrus v1.8.1
github.com/smartystreets/assertions v1.0.0 // indirect
github.com/spf13/afero v1.5.1 // indirect
Expand Down
7 changes: 2 additions & 5 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,6 @@ github.com/prometheus/client_golang v1.2.1/go.mod h1:XMU6Z2MjaRKVu/dC1qupJI9SiNk
github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og=
github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M=
github.com/prometheus/client_golang v1.9.0/go.mod h1:FqZLKOZnGdFAhOK4nqGHa7D66IdsO+O441Eve7ptJDU=
github.com/prometheus/client_golang v1.10.0/go.mod h1:WJM3cc3yu7XKBKa/I8WeZm+V3eltZnBwfENSU7mdogU=
github.com/prometheus/client_golang v1.11.0 h1:HNkLOAEQMIDv/K+04rukrLx6ch7msSRwf3/SASFAGtQ=
github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0=
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
Expand All @@ -635,10 +634,9 @@ github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y8
github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA=
github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo=
github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s=
github.com/prometheus/common v0.18.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s=
github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc=
github.com/prometheus/common v0.27.0 h1:kJb5BtkTmonXrV2nfyRRlChGpgqhPCdj2ooGivZ8txo=
github.com/prometheus/common v0.27.0/go.mod h1:LdLj/WiR+LL0ThCPrtSZbijrsxInIhizDTiPlJhPPq4=
github.com/prometheus/common v0.29.0 h1:3jqPBvKT4OHAbje2Ql7KeaaSicDBCxMYwEJU1zRJceE=
github.com/prometheus/common v0.29.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls=
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
Expand Down Expand Up @@ -986,7 +984,6 @@ golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210217105451-b926d437f341/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210309074719-68d13333faf2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40 h1:JWgyZ1qgdTaF3N3oxC+MdTV7qvEEgHo3otj+HB5CM7Q=
golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
Expand Down
Loading

0 comments on commit 6e7d531

Please sign in to comment.