Skip to content
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

[NET-11187] Nightly openshift basic test #4424

Merged
merged 24 commits into from
Nov 26, 2024
Merged

Conversation

sarahalsmiller
Copy link
Member

@sarahalsmiller sarahalsmiller commented Nov 12, 2024

Changes proposed in this PR

  • Basic openshift test w/ API gateway routing to two services in the mesh without transparent proxy
  • Flags to tell the test that kubectl is connected to an openshift cluster
  • In the future, we'd like to add transparent proxy and a terminating gateway into the mix

How I've tested this PR

  • running test locally when connected to an openshift cluster
  • set up a temporary PR trigger resulting in this successful test run

How I expect reviewers to test this PR

Checklist

@nathancoleman nathancoleman added pr/no-changelog PR does not need a corresponding .changelog entry pr/no-backport signals that a PR will not contain a backport label labels Nov 13, 2024
nathancoleman and others added 4 commits November 13, 2024 16:54
We will need to consume the cloned repo chart in the future, but I'm trying to get something working first
@sarahalsmiller sarahalsmiller requested a review from a team as a code owner November 19, 2024 18:56
.PHONY: openshift-test-packages
openshift-test-packages: ## openshift test packages
@./control-plane/build-support/scripts/set_test_package_matrix.sh "acceptance/ci-inputs/openshift_acceptance_test_packages.yaml"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this only for CI or could I run make openshift-test-packages locally?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could run this locally if you were connected to an openshift cluster and passed in the --use-openshift flag

port: 443
tls:
certificateRefs:
- name: consul-server-cert
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this refer to a secret that gets created by our helm templates?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

logf.SetLogger(logr.New(nil))
logger.Log(t, "creating resources for OpenShift test")

cmd = exec.Command("kubectl", "apply", "-f", "../fixtures/cases/openshift/basic")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also typically use a helper to run kubectl commands: https://github.com/hashicorp/consul-k8s/blob/main/acceptance/tests/partitions/partitions_connect_test.go#L219. I know you're bypassing the framework because of the root issue, but potentially you could still use the same pattern as other tests for these kubectl commands. Let me know if theres a reason not to though!!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I tried to use that function it got a bunch of errors from trying to connect to the static client pod, I'm not sure why


// FUTURE for some reason NewHelmCluster creates a consul server pod that runs as root which
// isn't allowed in OpenShift. In order to test OpenShift properly, we have to call helm and k8s
// directly to bypass. Ideally we would just fix the framework that is running the pod as root.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh got it, thanks I was wondering about that.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know theres also some common test defaults that get set through those helper functions so it may be worth using those in the near future so the same defaults get set across our tests.

@sarahalsmiller sarahalsmiller merged commit cf16128 into main Nov 26, 2024
50 of 51 checks passed
@sarahalsmiller sarahalsmiller deleted the nightly-openshift-run branch November 26, 2024 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr/no-backport signals that a PR will not contain a backport label pr/no-changelog PR does not need a corresponding .changelog entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants