-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Configurable Allocation API Port (#419)
* Modified Files to allow for port as env variable * Separated listening ports into int and str * Modified Files to allow for port as env variable * Separated listening ports into int and str * Rebuild Installfiles and adjusted default port * Changes to get e2e tests to have variable port * Set default back to 5000 * Fix typo * Changed name of vars, replaced shell cmds * Remove dynamic port from unit tests and makefile * Fix camel case, make const for test * Adjust e2e test for new alloc api utility * md for Changing port * Added fmt * Commiting modified installfile * Move allocation port to suite_test * Updated Doc * Made api port come from suite_test * Fixed controller suite_test * Adjusted controller and doc
- Loading branch information
Showing
14 changed files
with
32,245 additions
and
7,565 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
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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
--- | ||
layout: default | ||
title: Port 5000 is already in use | ||
parent: Troubleshooting | ||
nav_order: 5 | ||
--- | ||
|
||
# How can I change the port that Thundernetes uses? | ||
|
||
By default, Thundernetes's Allocation API listens on port 5000 which is opened with the kind config set-up [here](../quickstart/installing-kind.md). This port can already be in use by another service thus causing Thundernetes to fail. | ||
|
||
## Kind Changes | ||
The first step (if using kind) is changing the `kind-config.yaml` to use the port desired. For example: | ||
|
||
{% include code-block-start.md %} | ||
kind: Cluster | ||
apiVersion: kind.x-k8s.io/v1alpha4 | ||
nodes: | ||
- role: control-plane | ||
- role: worker | ||
extraPortMappings: | ||
- containerPort: 5000 | ||
hostPort: 5000 | ||
listenAddress: "0.0.0.0" | ||
protocol: tcp | ||
- containerPort: 10000 | ||
hostPort: 10000 | ||
listenAddress: "0.0.0.0" | ||
protocol: tcp | ||
- containerPort: 10001 | ||
hostPort: 10001 | ||
listenAddress: "0.0.0.0" | ||
protocol: tcp | ||
{% include code-block-end.md %} | ||
|
||
## YAML Changes | ||
The necessary YAML changes are found within the `manager.yaml` file. A find and replace of `5000` with `{DESIRED_PORT}` will change where the Allocation API listens. In total, there are 5 instances. | ||
|
||
Once this file is modified, you can generate new installfiles with `make create-install-files` and verify your changes in `operator.yaml` | ||
|
||
### Development - End to end tests | ||
End to end tests also run and listen on port 5000. Once you complete the above yaml change, you also need to modify `e2e/kind-config.yaml` to listen on your desired port. The other needed change is modifying allocationApiSvcPort in `pkg/operator/controllers/sute_test.go` | ||
|
||
## Verify changes | ||
|
||
Once these changes are made and thundernetes is running, you can verify the port within the logs using the following: | ||
`kubectl -n thundernetes-system logs {thundernetes-controller-manager} | grep addr` | ||
|
||
Resulting in the following output: | ||
`2022-10-07T17:01:07Z INFO allocation-api serving allocation API service {"addr": ":5005", "port": 5005}` |
Oops, something went wrong.