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

Make healthz server port in file-provider configurable #5149

Open
shawnh2 opened this issue Jan 25, 2025 · 6 comments · May be fixed by #5151
Open

Make healthz server port in file-provider configurable #5149

shawnh2 opened this issue Jan 25, 2025 · 6 comments · May be fixed by #5151
Assignees
Labels
area/provider area/standalone Issues related to the standalone mode

Comments

@shawnh2
Copy link
Contributor

shawnh2 commented Jan 25, 2025

When ran the script make go.test.coverage as is, got the same error as in the CI right now:

--- FAIL: TestNamespaceSelectorProvider (6.11s)
    kubernetes_test.go:1338: 
                Error Trace:    /home/eshaan/Documents/projects/gateway/internal/provider/kubernetes/kubernetes_test.go:1338
                Error:          Received unexpected error:
                                failed to create manager: error listening on :8081: listen tcp :8081: bind: address already in use

but when I modified the definition of the same to use only 1 process (via the -p 1 argument)

.PHONY: go.test.coverage
go.test.coverage: go.test.cel ## Run go unit and integration tests in GitHub Actions
	@$(LOG_TARGET)
	KUBEBUILDER_ASSETS="$(shell $(tools/setup-envtest) use $(ENVTEST_K8S_VERSION) -p path)" \
		go test ./... --tags=integration -race -coverprofile=coverage.xml -covermode=atomic -p 1

the same completes without any errors!

Logs
make[1]: Entering directory '/home/eshaan/Documents/projects/gateway'
===========> Running generate-gwapi-manifests ... 
curl -sLo /home/eshaan/Documents/projects/gateway/bin/gatewayapi-crds.yaml https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.2.1/experimental-install.yaml
mv /home/eshaan/Documents/projects/gateway/bin/gatewayapi-crds.yaml charts/gateway-helm/crds/gatewayapi-crds.yaml
===========> Running manifests ... 
tools/bin/controller-gen crd:allowDangerousTypes=true paths="./api/..." output:crd:artifacts:config=charts/gateway-helm/crds/generated
===========> Running go.test.cel ... 
Run CEL Validation on k8s 1.29.4
ok      github.com/envoyproxy/gateway/test/cel-validation11.289s
Run CEL Validation on k8s 1.30.3
ok      github.com/envoyproxy/gateway/test/cel-validation11.742s
Run CEL Validation on k8s 1.31.0
ok      github.com/envoyproxy/gateway/test/cel-validation11.453s
Run CEL Validation on k8s 1.32.0
ok      github.com/envoyproxy/gateway/test/cel-validation11.309s
===========> Running go.test.coverage ... 
KUBEBUILDER_ASSETS="/home/eshaan/.local/share/kubebuilder-envtest/k8s/1.29.4-linux-amd64" \
        go test ./... --tags=integration -race -coverprofile=coverage.xml -covermode=atomic -p 1
?       github.com/envoyproxy/gateway   [no test files]
?       github.com/envoyproxy/gateway/api       [no test files]
        github.com/envoyproxy/gateway/api/v1alpha1coverage: 0.0% of statements
ok      github.com/envoyproxy/gateway/api/v1alpha1/validation1.074s  coverage: 91.0% of statements
        github.com/envoyproxy/gateway/cmd/egctl         coverage: 0.0% of statements
        github.com/envoyproxy/gateway/cmd/envoy-gatewaycoverage: 0.0% of statements
ok      github.com/envoyproxy/gateway/internal/admin    1.101scoverage: 57.1% of statements
ok      github.com/envoyproxy/gateway/internal/cmd      3.121scoverage: 37.5% of statements
ok      github.com/envoyproxy/gateway/internal/cmd/egctl21.959s coverage: 38.3% of statements
        github.com/envoyproxy/gateway/internal/cmd/envoy        coverage: 0.0% of statements
        github.com/envoyproxy/gateway/internal/cmd/options        coverage: 0.0% of statements
        github.com/envoyproxy/gateway/internal/cmd/version        coverage: 0.0% of statements
ok      github.com/envoyproxy/gateway/internal/crypto   2.911scoverage: 67.0% of statements
        github.com/envoyproxy/gateway/internal/envoygateway        coverage: 0.0% of statements
ok      github.com/envoyproxy/gateway/internal/envoygateway/config      1.124s  coverage: 90.0% of statements
ok      github.com/envoyproxy/gateway/internal/envoygateway/config/loader       4.147scoverage: 77.5% of statements
ok      github.com/envoyproxy/gateway/internal/extension/registry       2.712s  coverage: 14.0% of statements
?       github.com/envoyproxy/gateway/internal/extension/types[no test files]
ok      github.com/envoyproxy/gateway/internal/filewatcher1.033s  coverage: 93.4% of statements
ok      github.com/envoyproxy/gateway/internal/gatewayapi24.080s coverage: 91.2% of statements
        github.com/envoyproxy/gateway/internal/gatewayapi/conformance           coverage: 0.0% of statements
ok      github.com/envoyproxy/gateway/internal/gatewayapi/resource      4.387s  coverage: 9.2% of statements
ok      github.com/envoyproxy/gateway/internal/gatewayapi/runner        2.485s  coverage: 36.5% of statements
ok      github.com/envoyproxy/gateway/internal/gatewayapi/status        1.130s  coverage: 56.2% of statements
ok      github.com/envoyproxy/gateway/internal/globalratelimit/runner   2.487s  coverage: 40.5% of statements
        github.com/envoyproxy/gateway/internal/infrastructure        coverage: 0.0% of statements
        github.com/envoyproxy/gateway/internal/infrastructure/common            coverage: 0.0% of statements
ok      github.com/envoyproxy/gateway/internal/infrastructure/host      1.903s  coverage: 19.1% of statements
ok      github.com/envoyproxy/gateway/internal/infrastructure/kubernetes        2.722scoverage: 65.5% of statements
ok      github.com/envoyproxy/gateway/internal/infrastructure/kubernetes/proxy  2.898scoverage: 87.0% of statements
ok      github.com/envoyproxy/gateway/internal/infrastructure/kubernetes/ratelimit   2.420s   coverage: 87.4% of statements
ok      github.com/envoyproxy/gateway/internal/infrastructure/kubernetes/resource    1.086s   coverage: 93.5% of statements
        github.com/envoyproxy/gateway/internal/infrastructure/runner            coverage: 0.0% of statements
ok      github.com/envoyproxy/gateway/internal/ir       1.126scoverage: 17.5% of statements
        github.com/envoyproxy/gateway/internal/kubernetes        coverage: 0.0% of statements
ok      github.com/envoyproxy/gateway/internal/logging  1.082scoverage: 95.0% of statements
ok      github.com/envoyproxy/gateway/internal/message  3.113scoverage: 45.6% of statements
ok      github.com/envoyproxy/gateway/internal/metrics  1.163scoverage: 35.6% of statements
?       github.com/envoyproxy/gateway/internal/provider [no test files]
ok      github.com/envoyproxy/gateway/internal/provider/file35.825s coverage: 87.8% of statements
ok      github.com/envoyproxy/gateway/internal/provider/kubernetes      35.421s coverage: 55.0% of statements
        github.com/envoyproxy/gateway/internal/provider/kubernetes/test         coverage: 0.0% of statements
        github.com/envoyproxy/gateway/internal/provider/runner        coverage: 0.0% of statements
        github.com/envoyproxy/gateway/internal/troubleshoot        coverage: 0.0% of statements
        github.com/envoyproxy/gateway/internal/troubleshoot/collect             coverage: 0.0% of statements
ok      github.com/envoyproxy/gateway/internal/utils    1.085scoverage: 64.3% of statements
ok      github.com/envoyproxy/gateway/internal/utils/env1.022s  coverage: 100.0% of statements
ok      github.com/envoyproxy/gateway/internal/utils/field1.023s  coverage: 78.8% of statements
ok      github.com/envoyproxy/gateway/internal/utils/file1.020s  coverage: 78.6% of statements
ok      github.com/envoyproxy/gateway/internal/utils/helm1.123s  coverage: 10.4% of statements
ok      github.com/envoyproxy/gateway/internal/utils/jsonpatch1.092s  coverage: 87.7% of statements
ok      github.com/envoyproxy/gateway/internal/utils/naming1.027s  coverage: 100.0% of statements
        github.com/envoyproxy/gateway/internal/utils/net        coverage: 0.0% of statements
ok      github.com/envoyproxy/gateway/internal/utils/path1.026s  coverage: 73.1% of statements
        github.com/envoyproxy/gateway/internal/utils/proto        coverage: 0.0% of statements
        github.com/envoyproxy/gateway/internal/utils/protocov        coverage: 0.0% of statements
        github.com/envoyproxy/gateway/internal/utils/ratelimit        coverage: 0.0% of statements
ok      github.com/envoyproxy/gateway/internal/utils/regex1.017s  coverage: 100.0% of statements
ok      github.com/envoyproxy/gateway/internal/utils/slice1.018s  coverage: 100.0% of statements
ok      github.com/envoyproxy/gateway/internal/wasm     28.293scoverage: 86.6% of statements
ok      github.com/envoyproxy/gateway/internal/xds/bootstrap1.491s  coverage: 84.1% of statements
        github.com/envoyproxy/gateway/internal/xds/cache        coverage: 0.0% of statements
?       github.com/envoyproxy/gateway/internal/xds/extensions[no test files]
        github.com/envoyproxy/gateway/internal/xds/filters        coverage: 0.0% of statements
ok      github.com/envoyproxy/gateway/internal/xds/server/runner        3.144s  coverage: 12.3% of statements
ok      github.com/envoyproxy/gateway/internal/xds/translator5.325s  coverage: 83.9% of statements
ok      github.com/envoyproxy/gateway/internal/xds/translator/runner    2.691s  coverage: 69.2% of statements
ok      github.com/envoyproxy/gateway/internal/xds/types1.150s  coverage: 89.4% of statements
        github.com/envoyproxy/gateway/internal/xds/utils        coverage: 0.0% of statements
        github.com/envoyproxy/gateway/proto/extensioncoverage: 0.0% of statements
        github.com/envoyproxy/gateway/test/e2e/testscoverage: 0.0% of statements
        github.com/envoyproxy/gateway/test/utils/kubernetes        coverage: 0.0% of statements
        github.com/envoyproxy/gateway/test/utils/prometheus        coverage: 0.0% of statements
make[1]: Leaving directory '/home/eshaan/Documents/projects/gateway'

Originally posted by @EshaanAgg in #5126 (comment)


We need to make the healthz server port configurable, for now it is a static port 8081, may cause port conflicts problem when running k8s provider test in CI.

@EshaanAgg
Copy link

I would like to work on this issue!

@shawnh2 shawnh2 removed the help wanted Extra attention is needed label Jan 25, 2025
@EshaanAgg EshaanAgg linked a pull request Jan 25, 2025 that will close this issue
@arkodg
Copy link
Contributor

arkodg commented Feb 6, 2025

@shawnh2 is this a clean up issue or is there a user need to make this configurable ?

@shawnh2
Copy link
Contributor Author

shawnh2 commented Feb 7, 2025

@shawnh2 is this a clean up issue or is there a user need to make this configurable ?

is a clean-up issue

@arkodg
Copy link
Contributor

arkodg commented Feb 7, 2025

Can we fix the clean up w/o updating API atm ?

@shawnh2
Copy link
Contributor Author

shawnh2 commented Feb 9, 2025

making the healthz server port for standalone provider configurable sounds like a reasonable request to me, the port on host may be occupied by other programs if user is running eg in standalone mode, make it confgurable can let users to use other port for healthz server.

@arkodg
Copy link
Contributor

arkodg commented Feb 10, 2025

sure, we'll then need to think through it, gather data to see if we need a top level ports or not, and what else may go in there, no objection to this, but its going to take more time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/provider area/standalone Issues related to the standalone mode
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants