Skip to content

Commit

Permalink
Merge pull request #971 from Kong/main
Browse files Browse the repository at this point in the history
Merge main into next
  • Loading branch information
mflendrich authored Dec 3, 2020
2 parents 5b6e6a2 + a66dd8c commit aab9869
Show file tree
Hide file tree
Showing 53 changed files with 931 additions and 164 deletions.
80 changes: 80 additions & 0 deletions .github/workflows/build-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Test

on: [push]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Setup go
uses: actions/setup-go@v2
with:
go-version: '^1.15'

- name: Cache Go modules
uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-build-codegen-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go
- name: 'Check out the repo'
uses: actions/checkout@v2

- name: 'make container'
run: |
make REGISTRY=local IMGNAME=kong-ingress-controller TAG=ci container
- run: docker save local/kong-ingress-controller:ci > image.tar

- uses: actions/upload-artifact@v2
with:
name: image
path: image.tar

push-public:
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/next'

steps:
- uses: actions/download-artifact@v2
with:
name: image

- name: 'Arrange: Push the Kong Operator image to the public registry'
env:
BINTRAY_KEY: ${{ secrets.BINTRAY_KEY }}
BINTRAY_USER: ${{ secrets.BINTRAY_USER }}
run: |
set -e
REPO="kong-docker-kubernetes-ingress-controller.bintray.io"
REF=`sed -re "s/^refs\/[a-z]+\///" <<< $GITHUB_REF` # remove "^refs/(heads|tags|remotes)"
DOCKER_TAG="$REPO/master:$REF"
docker load < image.tar
docker tag local/kong-ingress-controller:ci "$DOCKER_TAG"
echo "${BINTRAY_KEY}" | docker login -u "${BINTRAY_USER}" ${REPO} --password-stdin
docker push "$DOCKER_TAG"
test-k8s:
needs: build
runs-on: ubuntu-latest
steps:
- name: 'Arrange: Check out the repo'
uses: actions/checkout@v2

- uses: actions/download-artifact@v2
with:
name: image

- name: 'Arrange: Push the image to the local registry'
run: |
docker load < image.tar
docker tag local/kong-ingress-controller:ci localhost:32000/kong-ingress-controller:ci
- name: 'Test: Run integration tests'
run: |
env KIC_IMAGE=local/kong-ingress-controller:ci ./test/integration/test.sh
30 changes: 0 additions & 30 deletions .github/workflows/build.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Setup kustomize
uses: imranismail/setup-kustomize@v1
with:
kustomize-version: "3.8.1"
kustomize-version: "3.8.5"
- name: Verify manifest consistency
run: |
make verify-manifests
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,7 @@ kong-ingress-controller

# ignore vendor tree
vendor

# integration test residuals
kind
kubeconfig-test-cluster
6 changes: 4 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ patch](#submitting-a-patch) section.

## Environment

- Golang version >= 1.12 installed
- Golang version matching our [`Dockerfile`](./Dockerfile) installed
- Access to a k8s cluster, you can use Minikube or GKE
- make
- Docker (for building)

## Dependencies

The build uses dependencies are managed by [go modules](https://blog.golang.org/using-go-modules)
The build uses dependencies are managed by [go modules](https://blog.golang.org/using-go-modules)

## Running in dev mode

Expand Down Expand Up @@ -126,6 +126,8 @@ $ cd $GOPATH/src/github.com/kong/kubernetes-ingress-controller
$ make test
```

To run integration tests, see the [integration test readme](test/integration/README.md).

## Releasing

Makefile will produce a release binary, as shown above. To publish this
Expand Down
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ test:
go test -race ./...

.PHONY: lint
lint:
lint: verify-tidy
golangci-lint run ./...

.PHONY: build
Expand All @@ -40,6 +40,10 @@ verify-codegen:
update-codegen:
./hack/update-codegen.sh

.PHONY: verify-tidy
verify-tidy:
./hack/verify-tidy.sh

.PHONY: container
container:
docker build \
Expand All @@ -50,3 +54,7 @@ container:
.PHONY: run
run:
./hack/dev/start.sh ${DB} ${RUN_VERSION}

.PHONY: integration-test
integration-test: container
KIC_IMAGE="${IMAGE}:${TAG}" ./test/integration/test.sh
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@ a specific setting with Kong Ingress Controller.
## Master branch builds

If you would like to use the latest and the greatest version of the controller,
you can use `latest` tag from the [master repository][bintray-master-builds]
you can use `latest` tag from the [kong-ingress-controller repository][bintray-builds]
hosted on Bintray:

```
docker pull kong-docker-kubernetes-ingress-controller.bintray.io/master:latest
docker pull kong-docker-kubernetes-ingress-controller.bintray.io/kong-ingress-controller:latest
```

## Seeking help
Expand Down Expand Up @@ -124,7 +124,7 @@ meeting invite and Zoom links to join the meeting.
[getting-started-guide]: docs/guides/getting-started.md
[badge-travis-image]: https://travis-ci.org/Kong/kubernetes-ingress-controller.svg?branch=master
[badge-travis-url]: https://travis-ci.org/Kong/kubernetes-ingress-controller
[bintray-master-builds]: https://bintray.com/kong/kubernetes-ingress-controller/master
[bintray-builds]: https://bintray.com/kong/kubernetes-ingress-controller/kong-ingress-controller
[kong-url]: https://konghq.com/
[kong-logo]: https://konghq.com/wp-content/uploads/2018/05/kong-logo-github-readme.png
[k4k8s-enterprise-setup]: https://github.com/Kong/kubernetes-ingress-controller/blob/master/docs/deployment/k4k8s-enterprise.md
Expand Down
4 changes: 2 additions & 2 deletions deploy/manifests/base/kong-ingress-dbless.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ spec:
serviceAccountName: kong-serviceaccount
containers:
- name: proxy
image: kong:2.1
image: kong:2.2
env:
# servers
- name: KONG_PROXY_LISTEN
Expand All @@ -40,7 +40,7 @@ spec:
value: "off"
# runtime tweaks
- name: KONG_NGINX_WORKER_PROCESSES
value: "1"
value: "2"
# logging
- name: KONG_ADMIN_ACCESS_LOG
value: /dev/stdout
Expand Down
2 changes: 1 addition & 1 deletion deploy/manifests/enterprise-k8s/kong-enterprise-k8s.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ spec:
template:
spec:
imagePullSecrets:
- name: kong-enterprise-k8s-docker
- name: kong-enterprise-edition-docker
containers:
- name: proxy
env:
Expand Down
4 changes: 2 additions & 2 deletions deploy/manifests/enterprise-k8s/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ patchesStrategicMerge:
- kong-enterprise-k8s.yaml
images:
- name: kong
newName: kong-docker-kong-enterprise-k8s.bintray.io/kong-enterprise-k8s
newTag: 2.0.4.1-alpine
newName: kong-docker-kong-enterprise-edition-docker.bintray.io/kong-enterprise-edition
newTag: 2.1.4.0-alpine
2 changes: 1 addition & 1 deletion deploy/manifests/postgres/kong-ingress-postgres.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ spec:
spec:
initContainers:
- name: wait-for-migrations
image: kong:2.1
image: kong:2.2
command:
- "/bin/sh"
- "-c"
Expand Down
2 changes: 1 addition & 1 deletion deploy/manifests/postgres/migration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ spec:
command: [ "/bin/sh", "-c", "until nc -zv $KONG_PG_HOST $KONG_PG_PORT -w1; do echo 'waiting for db'; sleep 1; done" ]
containers:
- name: kong-migrations
image: kong:2.1
image: kong:2.2
env:
- name: KONG_PG_PASSWORD
value: kong
Expand Down
16 changes: 8 additions & 8 deletions deploy/single/all-in-one-dbless-k4k8s-enterprise.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,11 @@ spec:
spec:
containers:
- env:
- name: KONG_LICENSE_DATA
valueFrom:
secretKeyRef:
key: license
name: kong-enterprise-license
- name: KONG_PROXY_LISTEN
value: 0.0.0.0:8000, 0.0.0.0:8443 ssl http2
- name: KONG_PORT_MAPS
Expand All @@ -630,19 +635,14 @@ spec:
- name: KONG_DATABASE
value: "off"
- name: KONG_NGINX_WORKER_PROCESSES
value: "1"
value: "2"
- name: KONG_ADMIN_ACCESS_LOG
value: /dev/stdout
- name: KONG_ADMIN_ERROR_LOG
value: /dev/stderr
- name: KONG_PROXY_ERROR_LOG
value: /dev/stderr
- name: KONG_LICENSE_DATA
valueFrom:
secretKeyRef:
key: license
name: kong-enterprise-license
image: kong-docker-kong-enterprise-k8s.bintray.io/kong-enterprise-k8s:2.0.4.1-alpine
image: kong-docker-kong-enterprise-edition-docker.bintray.io/kong-enterprise-edition:2.1.4.0-alpine
lifecycle:
preStop:
exec:
Expand Down Expand Up @@ -726,5 +726,5 @@ spec:
successThreshold: 1
timeoutSeconds: 1
imagePullSecrets:
- name: kong-enterprise-k8s-docker
- name: kong-enterprise-edition-docker
serviceAccountName: kong-serviceaccount
4 changes: 2 additions & 2 deletions deploy/single/all-in-one-dbless.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -630,14 +630,14 @@ spec:
- name: KONG_DATABASE
value: "off"
- name: KONG_NGINX_WORKER_PROCESSES
value: "1"
value: "2"
- name: KONG_ADMIN_ACCESS_LOG
value: /dev/stdout
- name: KONG_ADMIN_ERROR_LOG
value: /dev/stderr
- name: KONG_PROXY_ERROR_LOG
value: /dev/stderr
image: kong:2.1
image: kong:2.2
lifecycle:
preStop:
exec:
Expand Down
Loading

0 comments on commit aab9869

Please sign in to comment.