-
Notifications
You must be signed in to change notification settings - Fork 123
Test Chart installation for Plus and remote images #2060
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,166 @@ | ||
name: Helm Testing | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
image: | ||
required: true | ||
type: string | ||
k8s-version: | ||
required: true | ||
type: string | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
helm-tests-local: | ||
name: Helm Tests Local | ||
runs-on: ubuntu-22.04 | ||
if: ${{ github.event_name != 'schedule' }} | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Fetch Cached Artifacts | ||
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 | ||
with: | ||
path: ${{ github.workspace }}/dist | ||
key: nginx-gateway-fabric-${{ github.run_id }}-${{ github.run_number }} | ||
|
||
- name: Docker Buildx | ||
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0 | ||
|
||
- name: NGF Docker meta | ||
id: ngf-meta | ||
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1 | ||
with: | ||
images: | | ||
name=ghcr.io/nginxinc/nginx-gateway-fabric | ||
tags: | | ||
type=semver,pattern={{version}} | ||
type=edge | ||
type=schedule | ||
type=ref,event=pr | ||
type=ref,event=branch,suffix=-rc,enable=${{ startsWith(github.ref, 'refs/heads/release') }} | ||
|
||
- name: NGINX Docker meta | ||
id: nginx-meta | ||
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1 | ||
with: | ||
images: | | ||
name=ghcr.io/nginxinc/nginx-gateway-fabric/${{ inputs.image == 'plus' && 'nginx-plus' || inputs.image }} | ||
tags: | | ||
type=semver,pattern={{version}} | ||
type=edge | ||
type=schedule | ||
type=ref,event=pr | ||
type=ref,event=branch,suffix=-rc,enable=${{ startsWith(github.ref, 'refs/heads/release') }} | ||
|
||
- name: Build NGF Docker Image | ||
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0 | ||
with: | ||
file: build/Dockerfile | ||
tags: ${{ steps.ngf-meta.outputs.tags }} | ||
context: "." | ||
target: goreleaser | ||
load: true | ||
cache-from: type=gha,scope=ngf | ||
pull: true | ||
|
||
- name: Build NGINX Docker Image | ||
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0 | ||
with: | ||
file: build/Dockerfile${{ inputs.image == 'nginx' && '.nginx' || '' }}${{ inputs.image == 'plus' && '.nginxplus' || ''}} | ||
tags: ${{ steps.nginx-meta.outputs.tags }} | ||
context: "." | ||
load: true | ||
cache-from: type=gha,scope=${{ inputs.image }} | ||
pull: true | ||
build-args: | | ||
NJS_DIR=internal/mode/static/nginx/modules/src | ||
NGINX_CONF_DIR=internal/mode/static/nginx/conf | ||
BUILD_AGENT=gha | ||
|
||
- name: Install cloud-provider-kind | ||
run: | | ||
curl -fsSL -O https://github.com/kubernetes-sigs/cloud-provider-kind/releases/download/v0.2.0/cloud-provider-kind_0.2.0_linux_amd64.tar.gz | ||
tar -xvf cloud-provider-kind_0.2.0_linux_amd64.tar.gz | ||
|
||
- name: Run cloud-provider-kind | ||
run: ./cloud-provider-kind & > cloud-provider-kind.log 2>&1 | ||
|
||
- name: Deploy Kubernetes | ||
id: k8s | ||
run: | | ||
kind create cluster --name ${{ github.run_id }} --image=kindest/node:${{ inputs.k8s-version }} | ||
kind load docker-image ${{ join(fromJSON(steps.ngf-meta.outputs.json).tags, ' ') }} ${{ join(fromJSON(steps.nginx-meta.outputs.json).tags, ' ') }} --name ${{ github.run_id }} | ||
kubectl kustomize config/crd/gateway-api/standard | kubectl apply -f - | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0 | ||
with: | ||
python-version: "3.x" | ||
check-latest: true | ||
|
||
- name: Set up chart-testing | ||
uses: helm/chart-testing-action@e6669bcd63d7cb57cb4380c33043eebe5d111992 # v2.6.1 | ||
|
||
- name: Install Chart | ||
run: | | ||
ct install --config .ct.yaml --helm-extra-set-args="--set=nginxGateway.image.tag=${{ steps.ngf-meta.outputs.version }} \ | ||
--set=nginx.image.repository=ghcr.io/nginxinc/nginx-gateway-fabric/nginx${{ inputs.image == 'plus' && '-plus' || ''}} \ | ||
--set=nginx.plus=${{ inputs.image == 'plus' }} \ | ||
--set=nginx.image.tag=${{ steps.nginx-meta.outputs.version }} \ | ||
--set=nginxGateway.image.pullPolicy=Never \ | ||
--set=nginx.image.pullPolicy=Never \ | ||
--set=nginxGateway.productTelemetry.enable=false" | ||
|
||
helm-test-remote: | ||
name: Helm Tests Remote | ||
runs-on: ubuntu-22.04 | ||
if: ${{ github.event_name == 'schedule' }} | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Install cloud-provider-kind | ||
run: | | ||
curl -fsSL -O https://github.com/kubernetes-sigs/cloud-provider-kind/releases/download/v0.2.0/cloud-provider-kind_0.2.0_linux_amd64.tar.gz | ||
tar -xvf cloud-provider-kind_0.2.0_linux_amd64.tar.gz | ||
|
||
- name: Run cloud-provider-kind | ||
run: ./cloud-provider-kind & > cloud-provider-kind.log 2>&1 | ||
|
||
- name: Deploy Kubernetes | ||
id: k8s | ||
run: | | ||
kind create cluster --name ${{ github.run_id }} --image=kindest/node:${{ inputs.k8s-version }} | ||
kubectl kustomize config/crd/gateway-api/standard | kubectl apply -f - | ||
kubectl create namespace nginx-gateway | ||
|
||
- name: Create k8s secret | ||
if: ${{ inputs.image == 'plus' }} | ||
run: | | ||
kubectl create secret docker-registry nginx-plus-registry-secret --docker-server=private-registry.nginx.com --docker-username=${{ secrets.JWT_PLUS_REGISTRY }} --docker-password=none -n nginx-gateway | ||
lucacome marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
- name: Set up Python | ||
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0 | ||
with: | ||
python-version: "3.x" | ||
check-latest: true | ||
|
||
- name: Set up chart-testing | ||
uses: helm/chart-testing-action@e6669bcd63d7cb57cb4380c33043eebe5d111992 # v2.6.1 | ||
|
||
- name: Install Chart | ||
run: | | ||
ct install --config .ct.yaml --all --namespace nginx-gateway --helm-extra-set-args="--set=nginxGateway.image.tag=nightly \ | ||
--set=nginx.plus=${{ inputs.image == 'plus' }} \ | ||
--set=nginx.image.tag=nightly \ | ||
sjberman marked this conversation as resolved.
Show resolved
Hide resolved
|
||
--set=nginxGateway.productTelemetry.enable=false \ | ||
${{ inputs.image == 'plus' && '--set=serviceAccount.imagePullSecret=nginx-plus-registry-secret --set=nginx.image.repository=private-registry.nginx.com/nginx-gateway-fabric/nginx-plus' || '' }}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.