-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[test] e2e tests(konnectivity) for kubeadm-full (#447)
* E2E test for Konnectivity and checking provisioned CAPI resources and child cluster resources * Added additional tests for deleting child cluster * Updated GHA workflow files to run E2E test on draft PR * Updating path to e2e kubeadm-full test * Checking if correct key is passed to the selector * Checking if correct key is passed to the selector. v2. * Updated GHA filter and added tests for etcd * Added Ephemeral key Added tests for StatefulSets Split DeamonSets tests and konnectivity tests * - Konnectivity complete tests - Etcd tests for volume mount, partial checks * - reverted build_test_ci.yml to original file available on the main branch * - removed files related to ETCD * - formatted chainsaw-test.yaml for konnectivity server and agent * - updating workflow files to run e2e tests on GHA * - combined konnectivity deployments and daemonsets into one file for improved readability * - updated test identifier name - fixed the right expected values to assert on in daemonsets - updated autoscaler version to a hardcoded one * - hygine changes in files release.yml and build_test_ci.yml - removed etcd-tests from konnectivity branch - added tests for cluster and node balancer(LinodeCluster) * - updated file names to be consistent * Update e2e/capl-cluster-flavors/kubeadm-full-capl-cluster/check-child-cluster-and-vpc-deleted.yaml Co-authored-by: Rahul Sharma <[email protected]> * Update e2e/capl-cluster-flavors/kubeadm-full-capl-cluster/chainsaw-test.yaml Co-authored-by: Rahul Sharma <[email protected]> * Update e2e/capl-cluster-flavors/kubeadm-full-capl-cluster/assert-child-cluster-resources.yaml Co-authored-by: Rahul Sharma <[email protected]> * - combined all parent resources into one file - seperated tests for deployment, daemonsets, statefulsets - added meaningful test names for better understanding while going through logs - added env variables to set konnectivity agents to 1 during testing * - added test to get logs from a pod * - fixed kubeconfig issue for getting pod logs * - updated environment variable for cluster-autoscaler-version --------- Co-authored-by: Rahul Sharma <[email protected]>
- Loading branch information
1 parent
2a3ff96
commit 323cfaa
Showing
14 changed files
with
632 additions
and
101 deletions.
There are no files selected for viewing
This file contains 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 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 |
---|---|---|
|
@@ -44,57 +44,57 @@ jobs: | |
needs: changes | ||
if: ${{ contains(fromJSON(needs.changes.outputs.paths), 'src') }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Validate YAML file | ||
run: yamllint templates | ||
- uses: actions/checkout@v4 | ||
- name: Validate YAML file | ||
run: yamllint templates | ||
|
||
go-build-test: | ||
runs-on: ubuntu-latest | ||
needs: changes | ||
if: ${{ contains(fromJSON(needs.changes.outputs.paths), 'src') }} | ||
steps: | ||
- name: Harden Runner | ||
uses: step-security/harden-runner@v2 | ||
with: | ||
disable-sudo: true | ||
egress-policy: block | ||
allowed-endpoints: > | ||
api.github.com:443 | ||
github.com:443 | ||
golang.org:443 | ||
proxy.golang.org:443 | ||
sum.golang.org:443 | ||
objects.githubusercontent.com:443 | ||
storage.googleapis.com:443 | ||
cli.codecov.io:443 | ||
api.codecov.io:443 | ||
raw.githubusercontent.com:443 | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: 'go.mod' | ||
check-latest: true | ||
|
||
- name: Build | ||
run: make build | ||
|
||
- name: Check for generated diff | ||
run: make check-gen-diff | ||
|
||
- name: Test | ||
run: make test | ||
|
||
- name: Upload coverage reports to Codecov | ||
uses: codecov/codecov-action@v4 | ||
with: | ||
files: ./coverage.out | ||
fail_ci_if_error: true | ||
verbose: true | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
slug: linode/cluster-api-provider-linode | ||
- name: Harden Runner | ||
uses: step-security/harden-runner@v2 | ||
with: | ||
disable-sudo: true | ||
egress-policy: block | ||
allowed-endpoints: > | ||
api.github.com:443 | ||
github.com:443 | ||
golang.org:443 | ||
proxy.golang.org:443 | ||
sum.golang.org:443 | ||
objects.githubusercontent.com:443 | ||
storage.googleapis.com:443 | ||
cli.codecov.io:443 | ||
api.codecov.io:443 | ||
raw.githubusercontent.com:443 | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: 'go.mod' | ||
check-latest: true | ||
|
||
- name: Build | ||
run: make build | ||
|
||
- name: Check for generated diff | ||
run: make check-gen-diff | ||
|
||
- name: Test | ||
run: make test | ||
|
||
- name: Upload coverage reports to Codecov | ||
uses: codecov/codecov-action@v4 | ||
with: | ||
files: ./coverage.out | ||
fail_ci_if_error: true | ||
verbose: true | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
slug: linode/cluster-api-provider-linode | ||
|
||
e2e-test: | ||
needs: changes | ||
|
@@ -107,7 +107,7 @@ jobs: | |
include: | ||
- flavor: ${{ github.ref == 'refs/heads/main' && 'all' || 'quick' }} | ||
uses: ./.github/workflows/e2e-test.yaml | ||
if: ${{ github.event.pull_request.draft == false && contains(fromJSON(needs.changes.outputs.paths), 'src') }} | ||
if: ${{contains(fromJSON(needs.changes.outputs.paths), 'src')}} | ||
secrets: inherit | ||
with: | ||
e2e-selector: ${{ matrix.flavor }} | ||
|
@@ -119,32 +119,32 @@ jobs: | |
needs: changes | ||
if: ${{ contains(fromJSON(needs.changes.outputs.paths), 'src') }} | ||
steps: | ||
- name: Harden Runner | ||
uses: step-security/harden-runner@v2 | ||
with: | ||
disable-sudo: true | ||
egress-policy: block | ||
allowed-endpoints: > | ||
api.github.com:443 | ||
github.com:443 | ||
proxy.golang.org:443 | ||
sum.golang.org:443 | ||
go.dev:443 | ||
dl.google.com:443 | ||
golang.org:443 | ||
objects.githubusercontent.com:443 | ||
registry-1.docker.io:443 | ||
auth.docker.io:443 | ||
production.cloudflare.docker.com:443 | ||
gcr.io:443 | ||
storage.googleapis.com:443 | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Docker cache | ||
uses: ScribeMD/[email protected] | ||
with: | ||
key: docker-${{ runner.os }}-${{ hashFiles('go.sum') }} | ||
|
||
- name: Build the Docker image | ||
run: make docker-build | ||
- name: Harden Runner | ||
uses: step-security/harden-runner@v2 | ||
with: | ||
disable-sudo: true | ||
egress-policy: block | ||
allowed-endpoints: > | ||
api.github.com:443 | ||
github.com:443 | ||
proxy.golang.org:443 | ||
sum.golang.org:443 | ||
go.dev:443 | ||
dl.google.com:443 | ||
golang.org:443 | ||
objects.githubusercontent.com:443 | ||
registry-1.docker.io:443 | ||
auth.docker.io:443 | ||
production.cloudflare.docker.com:443 | ||
gcr.io:443 | ||
storage.googleapis.com:443 | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Docker cache | ||
uses: ScribeMD/[email protected] | ||
with: | ||
key: docker-${{ runner.os }}-${{ hashFiles('go.sum') }} | ||
|
||
- name: Build the Docker image | ||
run: make docker-build |
This file contains 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 |
---|---|---|
|
@@ -24,6 +24,7 @@ on: | |
- k3s | ||
- rke2 | ||
- default-cluster | ||
- kubeadm-full | ||
- linodecluster | ||
- linodemachine | ||
- linodeobj | ||
|
This file contains 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
79 changes: 79 additions & 0 deletions
79
e2e/capl-cluster-flavors/kubeadm-full-capl-cluster/assert-capi-resources.yaml
This file contains 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,79 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: caaph-controller-manager | ||
namespace: caaph-system | ||
status: | ||
availableReplicas: 1 | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: capi-operator-cluster-api-operator | ||
namespace: capi-operator-system | ||
status: | ||
availableReplicas: 1 | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: capi-controller-manager | ||
namespace: capi-system | ||
status: | ||
availableReplicas: 1 | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: capl-controller-manager | ||
namespace: capl-system | ||
status: | ||
availableReplicas: 1 | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: cert-manager | ||
namespace: cert-manager | ||
status: | ||
availableReplicas: 1 | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: cert-manager-cainjector | ||
namespace: cert-manager | ||
status: | ||
availableReplicas: 1 | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: cert-manager-webhook | ||
namespace: cert-manager | ||
status: | ||
availableReplicas: 1 | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: coredns | ||
namespace: kube-system | ||
status: | ||
availableReplicas: 2 | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: capi-kubeadm-bootstrap-controller-manager | ||
namespace: kubeadm-bootstrap-system | ||
status: | ||
availableReplicas: 1 | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: capi-kubeadm-control-plane-controller-manager | ||
namespace: kubeadm-control-plane-system | ||
status: | ||
availableReplicas: 1 |
35 changes: 35 additions & 0 deletions
35
e2e/capl-cluster-flavors/kubeadm-full-capl-cluster/assert-child-cluster-daemonsets.yaml
This file contains 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,35 @@ | ||
apiVersion: apps/v1 | ||
kind: DaemonSet | ||
metadata: | ||
name: ccm-linode | ||
namespace: kube-system | ||
status: | ||
currentNumberScheduled: 1 | ||
desiredNumberScheduled: 1 | ||
numberAvailable: 1 | ||
numberMisscheduled: 0 | ||
numberReady: 1 | ||
--- | ||
apiVersion: apps/v1 | ||
kind: DaemonSet | ||
metadata: | ||
name: cilium | ||
namespace: kube-system | ||
status: | ||
currentNumberScheduled: 2 | ||
desiredNumberScheduled: 2 | ||
numberAvailable: 2 | ||
numberMisscheduled: 0 | ||
numberReady: 2 | ||
--- | ||
apiVersion: apps/v1 | ||
kind: DaemonSet | ||
metadata: | ||
name: csi-linode-node | ||
namespace: kube-system | ||
status: | ||
currentNumberScheduled: 2 | ||
desiredNumberScheduled: 2 | ||
numberAvailable: 2 | ||
numberMisscheduled: 0 | ||
numberReady: 2 |
Oops, something went wrong.