-
Notifications
You must be signed in to change notification settings - Fork 26
add operator install workflow #534
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 17 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
64b72e7
add operator test
vepatel 88795a0
add branch for testing purpose
vepatel 87cba5c
use edge image
vepatel 715f8b0
wait and retry
vepatel aefd350
add test deployment
vepatel 12a1d48
update verification
vepatel 82b5d2e
add retries
vepatel 079246c
use latest versions for k8s and minikube
vepatel c52773b
update version scripts
vepatel 0abbcab
run operator tests before release
vepatel fb30087
Merge branch 'main' into feat/add-install-workflow
vepatel 64063de
address review comments
vepatel 2027ed0
trigger from ci.yaml
vepatel d77c816
replace jq with grep
vepatel 3234a0c
run using ci.yml only
vepatel 7f3f7f2
remove log line limit
vepatel 1d8e203
Merge branch 'main' into feat/add-install-workflow
vepatel aa17bcf
remove cleanup
vepatel 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,163 @@ | ||
| name: E2E Test | ||
|
|
||
| on: | ||
| schedule: | ||
| - cron: '00 03 * * *' | ||
| workflow_dispatch: # Allow manual triggering | ||
| inputs: | ||
| operator_version: | ||
| description: 'Operator version/tag (e.g., edge, x.y.z)' | ||
| required: false | ||
| default: 'edge' | ||
| type: string | ||
| workflow_call: # Allow being called by other workflows | ||
| inputs: | ||
| operator_version: | ||
| description: 'Operator version/tag (e.g., edge, x.y.z)' | ||
| required: false | ||
| default: 'edge' | ||
| type: string | ||
|
|
||
| env: | ||
| OPERATOR_VERSION: ${{ inputs.operator_version || 'edge' }} | ||
|
|
||
| concurrency: | ||
| group: ${{ github.ref_name }}-e2e | ||
| cancel-in-progress: true | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| e2e-test: | ||
| name: End-to-End Test | ||
| runs-on: ubuntu-22.04 | ||
| steps: | ||
| - name: Checkout Repository | ||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
|
|
||
| - name: Get Latest Versions | ||
| run: | | ||
| # Get latest Kubernetes version | ||
| echo "KUBERNETES_VERSION=$(curl -s https://api.github.com/repos/kubernetes/kubernetes/releases/latest | grep '"tag_name"' | cut -d'"' -f4)" >> $GITHUB_ENV | ||
|
|
||
| # Get latest Minikube version | ||
| echo "MINIKUBE_VERSION=$(curl -s https://api.github.com/repos/kubernetes/minikube/releases/latest | grep '"tag_name"' | cut -d'"' -f4)" >> $GITHUB_ENV | ||
|
|
||
| - name: Install kubectl | ||
| run: | | ||
| curl -LO "https://dl.k8s.io/release/${{ env.KUBERNETES_VERSION }}/bin/linux/amd64/kubectl" | ||
| chmod +x kubectl | ||
| sudo mv kubectl /usr/local/bin/ | ||
|
|
||
| - name: Install Minikube | ||
| run: | | ||
| curl -Lo minikube https://storage.googleapis.com/minikube/releases/${{ env.MINIKUBE_VERSION }}/minikube-linux-amd64 | ||
| chmod +x minikube | ||
| sudo mv minikube /usr/local/bin/ | ||
|
|
||
| - name: Start Minikube | ||
| run: | | ||
| minikube start --kubernetes-version=${{ env.KUBERNETES_VERSION }} --driver=docker --memory=4g --cpus=2 | ||
|
|
||
| - name: Verify Kubernetes cluster | ||
| run: | | ||
| kubectl cluster-info | ||
| kubectl get nodes | ||
| kubectl get pods -A | ||
|
|
||
| - name: Deploy NGINX Ingress Operator | ||
| run: | | ||
| # Deploy the operator using make deploy with specified version, edge otherwise | ||
| make deploy IMG=nginx/nginx-ingress-operator:${{ env.OPERATOR_VERSION }} | ||
|
|
||
| # Wait for the operator to be ready | ||
| kubectl wait --for=condition=Available --timeout=300s deployment/nginx-ingress-operator-controller-manager -n nginx-ingress-operator-system | ||
|
|
||
| - name: Verify Operator Deployment | ||
| run: | | ||
| # Check operator deployment status | ||
| kubectl get deployments -n nginx-ingress-operator-system | ||
| kubectl get pods -n nginx-ingress-operator-system | ||
|
|
||
| # Check operator logs | ||
| kubectl logs -l control-plane=controller-manager -n nginx-ingress-operator-system --tail=50 | ||
|
|
||
| - name: Deploy Example NGINX Ingress Controller | ||
| run: | | ||
| # Create the namespace and NGINX Ingress Controller instance in namespace nginx-ingress | ||
| kubectl create namespace nginx-ingress | ||
| kubectl apply -f tests/nginx-ingress-controller-oss.yaml | ||
|
|
||
| # Wait for the operator to process and install the Helm release | ||
| echo "Waiting for operator to install Helm release..." | ||
| sleep 30 | ||
|
|
||
| # Check what deployments were actually created | ||
| echo "Checking deployments in nginx-ingress namespace:" | ||
| kubectl get deployments -n nginx-ingress | ||
|
|
||
| # Find the actual deployment name | ||
| DEPLOYMENT_NAME=$(kubectl get deployments -n nginx-ingress -o jsonpath='{.items[0].metadata.name}' 2>/dev/null || echo "") | ||
|
|
||
| if [ -z "$DEPLOYMENT_NAME" ]; then | ||
| echo "No deployment found, waiting longer..." | ||
| sleep 30 | ||
| kubectl get deployments -n nginx-ingress | ||
| DEPLOYMENT_NAME=$(kubectl get deployments -n nginx-ingress -o jsonpath='{.items[0].metadata.name}' 2>/dev/null || echo "") | ||
| fi | ||
|
|
||
| if [ -n "$DEPLOYMENT_NAME" ]; then | ||
| echo "Found deployment: $DEPLOYMENT_NAME" | ||
| # Export for use in subsequent steps | ||
| echo "DEPLOYMENT_NAME=$DEPLOYMENT_NAME" >> $GITHUB_ENV | ||
| # Wait for the NGINX Ingress Controller to be ready | ||
| kubectl wait --for=condition=Available --timeout=300s deployment/$DEPLOYMENT_NAME -n nginx-ingress | ||
| else | ||
| echo "Failed to find any deployment in nginx-ingress namespace" | ||
| exit 1 | ||
| fi | ||
| - name: Verify NGINX Ingress Controller Deployment | ||
| run: | | ||
| # Check all resources in the nginx ingress controller namespace | ||
| kubectl get all -n nginx-ingress | ||
|
|
||
| # Check if the controller pod is running | ||
| kubectl get pods -n nginx-ingress | ||
|
|
||
| # Check the service | ||
| kubectl get services -n nginx-ingress | ||
|
|
||
| # Check ingress class | ||
| kubectl get ingressclass | ||
|
|
||
| # Verify all pods are ready in nginx-ingress namespace | ||
| kubectl wait --for=condition=Ready --timeout=300s pod --all -n nginx-ingress | ||
|
|
||
| - name: Verify NGINX Configuration | ||
| run: | | ||
| echo "Testing NGINX configuration for deployment: $DEPLOYMENT_NAME" | ||
|
|
||
| # Check NGINX configuration is valid | ||
| kubectl exec -n nginx-ingress deployment/$DEPLOYMENT_NAME -- nginx -t | ||
|
|
||
| - name: Check Operator and Controller Logs | ||
| if: always() | ||
| run: | | ||
| echo "=== Operator Logs ===" | ||
| kubectl logs -l control-plane=controller-manager -n nginx-ingress-operator-system | ||
|
|
||
| echo "=== NGINX Ingress Controller Logs ===" | ||
| # Get logs from all pods in nginx-ingress namespace | ||
| for pod in $(kubectl get pods -n nginx-ingress -o jsonpath='{.items[*].metadata.name}' 2>/dev/null || echo ""); do | ||
| if [ -n "$pod" ]; then | ||
| echo "--- Logs for pod: $pod ---" | ||
| kubectl logs $pod -n nginx-ingress | ||
| fi | ||
| done | ||
|
|
||
| - name: Cleanup | ||
| if: always() | ||
| run: | | ||
| # Delete the Minikube cluster | ||
| minikube delete | ||
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,22 @@ | ||
| apiVersion: charts.nginx.org/v1alpha1 | ||
| kind: NginxIngress | ||
| metadata: | ||
| name: my-nginx-ingress | ||
| namespace: nginx-ingress | ||
| spec: | ||
| controller: | ||
| defaultTLS: | ||
| secret: "" | ||
| enableCustomResources: true | ||
| image: | ||
| pullPolicy: Always | ||
| repository: nginx/nginx-ingress | ||
| tag: 5.1.0 | ||
| ingressClass: | ||
| name: nginx | ||
| kind: deployment | ||
| nginxplus: false | ||
| service: | ||
| type: NodePort | ||
| rbac: | ||
| create: true |
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.