diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 1280fb5ca..b4b883151 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -26,3 +26,12 @@ jobs: uses: codecov/codecov-action@v1 with: file: ./cover.out # optional + + verify: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: make quick-ci + run: | + make quick-ci diff --git a/.gitignore b/.gitignore index f1cd06745..0f2180c1a 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,4 @@ site *.swp *.swo *~ +*.bak diff --git a/Makefile b/Makefile index db37def7d..864664630 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ MAKEFILE_PATH = $(dir $(realpath -s $(firstword $(MAKEFILE_LIST)))) # Image URL to use all building/pushing image targets -IMG ?= amazon/aws-alb-ingress-controller:v2.4.4 +IMG ?= amazon/aws-alb-ingress-controller:v2.4.5 CRD_OPTIONS ?= "crd:crdVersions=v1" @@ -130,6 +130,14 @@ docs-dependencies: lint: echo "TODO" +.PHONY: quick-ci +quick-ci: verify-versions + echo "Done!" + +.PHONY: verify-versions +verify-versions: + hack/verify-versions.sh + unit-test: ./scripts/ci_unit_test.sh diff --git a/config/controller/kustomization.yaml b/config/controller/kustomization.yaml index 595914ad8..eabbb5e31 100644 --- a/config/controller/kustomization.yaml +++ b/config/controller/kustomization.yaml @@ -9,4 +9,4 @@ kind: Kustomization images: - name: controller newName: amazon/aws-alb-ingress-controller - newTag: v2.4.4 + newTag: v2.4.5 diff --git a/docs/deploy/installation.md b/docs/deploy/installation.md index fd5943024..f7394eb16 100644 --- a/docs/deploy/installation.md +++ b/docs/deploy/installation.md @@ -80,7 +80,7 @@ Example condition for cluster name resource tag: 1. Download IAM policy for the AWS Load Balancer Controller ``` - curl -o iam-policy.json https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/v2.4.4/docs/install/iam_policy.json + curl -o iam-policy.json https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/v2.4.5/docs/install/iam_policy.json ``` 1. Create an IAM policy called AWSLoadBalancerControllerIAMPolicy @@ -106,7 +106,7 @@ Example condition for cluster name resource tag: ### Option B: Attach IAM Policies to Nodes If not setting up IAM for ServiceAccount, apply the IAM policies from the following URL at minimum. ``` -curl -o iam-policy.json https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/v2.4.4/docs/install/iam_policy.json +curl -o iam-policy.json https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/v2.4.5/docs/install/iam_policy.json ``` *IAM permission subset for those who use *TargetGroupBinding* only and don't plan to use the AWS Load Balancer Controller to manage security group rules:* @@ -190,7 +190,7 @@ We recommend using the Helm chart. This supports Fargate and facilitates updatin ### Apply YAML 1. Download spec for load balancer controller. ``` - wget https://github.com/kubernetes-sigs/aws-load-balancer-controller/releases/download/v2.4.4/v2_4_4_full.yaml + wget https://github.com/kubernetes-sigs/aws-load-balancer-controller/releases/download/v2.4.5/v2_4_5_full.yaml ``` 1. Edit the saved yaml file, go to the Deployment spec, and set the controller --cluster-name arg value to your EKS cluster name ``` @@ -218,7 +218,7 @@ We recommend using the Helm chart. This supports Fargate and facilitates updatin ``` 1. Optionally download the default ingressclass and ingressclass params ``` - wget https://github.com/kubernetes-sigs/aws-load-balancer-controller/releases/download/v2.4.4/v2_4_4_ingclass.yaml + wget https://github.com/kubernetes-sigs/aws-load-balancer-controller/releases/download/v2.4.5/v2_4_5_ingclass.yaml ``` 1. Apply the ingressclass and params ``` diff --git a/docs/examples/echo_server.md b/docs/examples/echo_server.md index 55cda9e3a..9b12806c6 100644 --- a/docs/examples/echo_server.md +++ b/docs/examples/echo_server.md @@ -86,9 +86,9 @@ In this walkthrough, you'll 1. Deploy all the echoserver resources (namespace, service, deployment) ```bash - kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/v2.4.0/docs/examples/echoservice/echoserver-namespace.yaml &&\ - kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/v2.4.0/docs/examples/echoservice/echoserver-service.yaml &&\ - kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/v2.4.0/docs/examples/echoservice/echoserver-deployment.yaml + kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/v2.4.5/docs/examples/echoservice/echoserver-namespace.yaml &&\ + kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/v2.4.5/docs/examples/echoservice/echoserver-service.yaml &&\ + kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/v2.4.5/docs/examples/echoservice/echoserver-deployment.yaml ``` 1. List all the resources to ensure they were created. @@ -112,7 +112,7 @@ In this walkthrough, you'll 1. Download the echoserver ingress manifest locally. ```bash - wget https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/v2.4.0/docs/examples/echoservice/echoserver-ingress.yaml + wget https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/v2.4.5/docs/examples/echoservice/echoserver-ingress.yaml ``` 1. Configure the subnets, either by add annotation to the ingress or add tags to subnets. This step is optional in lieu of auto-discovery. @@ -223,7 +223,7 @@ In this walkthrough, you'll 1. Download external-dns to manage Route 53. ```bash - wget https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/v2.4.0/docs/examples/external-dns.yaml + wget https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/v2.4.5/docs/examples/external-dns.yaml ``` 1. Edit the `--domain-filter` flag to include your hosted zone(s) @@ -294,7 +294,7 @@ In this walkthrough, you'll follow below steps if you want to use kube2iam to provide the AWS credentials 1. configure the proper policy - The policy to be used can be fetched from https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/v2.4.0/docs/install/iam_policy.json + The policy to be used can be fetched from https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/v2.4.5/docs/install/iam_policy.json 1. configure the proper role and create the trust relationship You have to find which role is associated with your K8S nodes. Once you found take note of the full arn: diff --git a/hack/set-version b/hack/set-version new file mode 100755 index 000000000..4257e0901 --- /dev/null +++ b/hack/set-version @@ -0,0 +1,64 @@ +#!/usr/bin/env bash + +# Copyright 2020 The Kubernetes Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This script helps with updating versions across the repo, updating the +# multiple places where we encode a aws-load-balancer-controller version number. + +# Use: hack/set-version + +# new-release-version is the version you are releasing. + +# +# Examples: +# 1.20.1 +# 1.21.0-alpha.1 +# 1.21.0-beta.1 + +set -e +set -x + +NEW_RELEASE_VERSION=$1 + +if [[ ! "${NEW_RELEASE_VERSION}" =~ ^([0-9]+[.][0-9]+)[.]([0-9]+)(-(alpha|beta)[.]([0-9]+))?$ ]]; then + echo "syntax $0 " + echo " must be 'X.Y.Z', 'X.Y.Z-alpha.N', or 'X.Y.Z-beta.N'" + exit 1 +fi + +MINOR=${BASH_REMATCH[1]} +PATCH=${BASH_REMATCH[2]} +PRERELEASE=${BASH_REMATCH[4]} +PRERELEASE_SEQUENCE=${BASH_REMATCH[5]} + +PREV_RELEASE_VERSION=$(cat version.txt) +PREV_STABLE_VERSION=$(cat version-stable.txt) + +echo "$NEW_RELEASE_VERSION" > version.txt + +sed -i.bak -e "s@amazon/aws-alb-ingress-controller:v${PREV_RELEASE_VERSION}@amazon/aws-alb-ingress-controller:v${NEW_RELEASE_VERSION}@g" Makefile + +if [[ -z "$PRERELEASE" ]]; then + echo "$NEW_RELEASE_VERSION" > version-stable.txt + + sed -i.bak -e "s@newTag: v${PREV_STABLE_VERSION}@newTag: v${NEW_RELEASE_VERSION}@g" config/controller/kustomization.yaml + sed -i.bak -e "s@appVersion: v${PREV_STABLE_VERSION}@appVersion: v${NEW_RELEASE_VERSION}@g" helm/aws-load-balancer-controller/Chart.yaml + sed -i.bak -e "s@tag: v${PREV_STABLE_VERSION}@tag: v${NEW_RELEASE_VERSION}@g" helm/aws-load-balancer-controller/test.yaml + sed -i.bak -e "s@tag: v${PREV_STABLE_VERSION}@tag: v${NEW_RELEASE_VERSION}@g" helm/aws-load-balancer-controller/values.yaml + sed -i.bak -e "s@/v${PREV_STABLE_VERSION}/v${PREV_STABLE_VERSION//./_}_@/v${NEW_RELEASE_VERSION}/v${NEW_RELEASE_VERSION//./_}_@g" docs/deploy/installation.md + sed -i.bak -e "s@/v${PREV_STABLE_VERSION}/@/v${NEW_RELEASE_VERSION}/@g" docs/deploy/installation.md + sed -i.bak -e "s@/v${PREV_STABLE_VERSION}/@/v${NEW_RELEASE_VERSION}/@g" docs/examples/echo_server.md + +fi diff --git a/hack/verify-versions.sh b/hack/verify-versions.sh new file mode 100755 index 000000000..6071e1462 --- /dev/null +++ b/hack/verify-versions.sh @@ -0,0 +1,35 @@ +#!/usr/bin/env bash + +# Copyright 2019 The Kubernetes Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -o errexit +set -o nounset +set -o pipefail + +RELEASE_VERSION=$(cat version.txt) + +"$(dirname "${BASH_SOURCE[0]}")/set-version" "${RELEASE_VERSION}" + +changed_files=$(git status --porcelain --untracked-files=no || true) +if [ -n "${changed_files}" ]; then + echo "Detected that version generation is needed" + echo "changed files:" + printf "%s" "${changed_files}\n" + echo "git diff:" + git --no-pager diff + echo "To fix: run 'hack/set-version ${RELEASE_VERSION}'" + exit 1 +fi + diff --git a/version-stable.txt b/version-stable.txt new file mode 100644 index 000000000..59aa62c1f --- /dev/null +++ b/version-stable.txt @@ -0,0 +1 @@ +2.4.5 diff --git a/version.txt b/version.txt new file mode 100644 index 000000000..59aa62c1f --- /dev/null +++ b/version.txt @@ -0,0 +1 @@ +2.4.5