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

chore: enable kurl-proxy in the admin console helm chart #261

Merged
merged 6 commits into from
Jan 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ bundle
pkg/goods/bins
pkg/goods/images
*tgz
release.tar.gz
release.o
.pre-commit-config.yaml
18 changes: 18 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ LD_FLAGS = -X github.com/replicatedhq/embedded-cluster/pkg/defaults.K0sVersion=$
-X github.com/replicatedhq/embedded-cluster/pkg/addons/openebs.ChartName=$(OPENEBS_CHART_NAME) \
-X github.com/replicatedhq/embedded-cluster/pkg/addons/openebs.Version=$(OPENEBS_CHART_VERSION)

.DEFAULT_GOAL := default
default: embedded-cluster-linux-amd64

pkg/goods/bins/k0sctl/k0s-${K0S_VERSION}:
Expand Down Expand Up @@ -118,3 +119,20 @@ clean:
rm -rf pkg/addons/adminconsole/charts/*.tgz
rm -rf pkg/addons/openebs/charts/*.tgz
rm -rf pkg/goods/bins

.PHONY: lint
lint:
golangci-lint run -c .golangci.yml ./...

.PHONY: lint-and-fix
lint-and-fix:
golangci-lint run --fix -c .golangci.yml ./...

.PHONY: scan
scan:
trivy fs \
--scanners vuln \
--exit-code=1 \
--severity="HIGH,CRITICAL" \
--ignore-unfixed \
./
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ INFO[0002] This token is valid for 24h0m0s hours.
INFO[0002] You can now run the following command in a remote node to add it
INFO[0002] to the cluster as a "controller" node:
embedded-cluster node join --role "controller" "<token redacted>"
server-0#
server-0#
```

Upon generating the token, you will be prompted to continue; press Enter to proceed (you will be opting out of the centralized management).
Expand Down
14 changes: 10 additions & 4 deletions pkg/addons/adminconsole/adminconsole.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,17 @@ var protectedFields = []string{
"automation",
}

const DEFAULT_ADMIN_CONSOLE_NODE_PORT = 30000

var helmValues = map[string]interface{}{
"minimalRBAC": false,
"isHelmManaged": false,
"service": map[string]interface{}{
"type": "NodePort",
"nodePort": 30000,
"enabled": false, // disable the admin console service
},
"kurlProxy": map[string]interface{}{
"enabled": true,
"nodePort": DEFAULT_ADMIN_CONSOLE_NODE_PORT,
},
"embeddedClusterID": metrics.ClusterID().String(),
}
Expand Down Expand Up @@ -283,8 +288,9 @@ func (a *AdminConsole) printSuccessMessage() {
ipaddr = "NODE-IP-ADDRESS"
}
}
nodePort := helmValues["service"].(map[string]interface{})["nodePort"]
successMessage := fmt.Sprintf("Admin Console accessible at: %shttp://%s:%v%s", successColor, ipaddr, nodePort, colorReset)
successMessage := fmt.Sprintf("Admin Console accessible at: %shttp://%s:%v%s",
successColor, ipaddr, DEFAULT_ADMIN_CONSOLE_NODE_PORT, colorReset,
)
fmt.Println(successMessage)
}

Expand Down