Skip to content

Commit b1d91dd

Browse files
banjohlaverya
andauthored
chore: enable kurl-proxy in the admin console helm chart (#261)
* chore: enable kurl-proxy in the admin console helm chart * Explicitly disable adminconsole service resource * Fix lint error and add lint make targets * Add trivy scan make target * Better name for default node port --------- Co-authored-by: Andrew Lavery <[email protected]>
1 parent 2a60265 commit b1d91dd

File tree

4 files changed

+32
-5
lines changed

4 files changed

+32
-5
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@ bundle
33
pkg/goods/bins
44
pkg/goods/images
55
*tgz
6+
release.tar.gz
7+
release.o
8+
.pre-commit-config.yaml

Makefile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ LD_FLAGS = -X github.com/replicatedhq/embedded-cluster/pkg/defaults.K0sVersion=$
3333
-X github.com/replicatedhq/embedded-cluster/pkg/addons/openebs.ChartName=$(OPENEBS_CHART_NAME) \
3434
-X github.com/replicatedhq/embedded-cluster/pkg/addons/openebs.Version=$(OPENEBS_CHART_VERSION)
3535

36+
.DEFAULT_GOAL := default
3637
default: embedded-cluster-linux-amd64
3738

3839
pkg/goods/bins/k0sctl/k0s-${K0S_VERSION}:
@@ -118,3 +119,20 @@ clean:
118119
rm -rf pkg/addons/adminconsole/charts/*.tgz
119120
rm -rf pkg/addons/openebs/charts/*.tgz
120121
rm -rf pkg/goods/bins
122+
123+
.PHONY: lint
124+
lint:
125+
golangci-lint run -c .golangci.yml ./...
126+
127+
.PHONY: lint-and-fix
128+
lint-and-fix:
129+
golangci-lint run --fix -c .golangci.yml ./...
130+
131+
.PHONY: scan
132+
scan:
133+
trivy fs \
134+
--scanners vuln \
135+
--exit-code=1 \
136+
--severity="HIGH,CRITICAL" \
137+
--ignore-unfixed \
138+
./

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ INFO[0002] This token is valid for 24h0m0s hours.
6464
INFO[0002] You can now run the following command in a remote node to add it
6565
INFO[0002] to the cluster as a "controller" node:
6666
embedded-cluster node join --role "controller" "<token redacted>"
67-
server-0#
67+
server-0#
6868
```
6969

7070
Upon generating the token, you will be prompted to continue; press Enter to proceed (you will be opting out of the centralized management).

pkg/addons/adminconsole/adminconsole.go

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,17 @@ var protectedFields = []string{
4141
"automation",
4242
}
4343

44+
const DEFAULT_ADMIN_CONSOLE_NODE_PORT = 30000
45+
4446
var helmValues = map[string]interface{}{
4547
"minimalRBAC": false,
4648
"isHelmManaged": false,
4749
"service": map[string]interface{}{
48-
"type": "NodePort",
49-
"nodePort": 30000,
50+
"enabled": false, // disable the admin console service
51+
},
52+
"kurlProxy": map[string]interface{}{
53+
"enabled": true,
54+
"nodePort": DEFAULT_ADMIN_CONSOLE_NODE_PORT,
5055
},
5156
"embeddedClusterID": metrics.ClusterID().String(),
5257
}
@@ -283,8 +288,9 @@ func (a *AdminConsole) printSuccessMessage() {
283288
ipaddr = "NODE-IP-ADDRESS"
284289
}
285290
}
286-
nodePort := helmValues["service"].(map[string]interface{})["nodePort"]
287-
successMessage := fmt.Sprintf("Admin Console accessible at: %shttp://%s:%v%s", successColor, ipaddr, nodePort, colorReset)
291+
successMessage := fmt.Sprintf("Admin Console accessible at: %shttp://%s:%v%s",
292+
successColor, ipaddr, DEFAULT_ADMIN_CONSOLE_NODE_PORT, colorReset,
293+
)
288294
fmt.Println(successMessage)
289295
}
290296

0 commit comments

Comments
 (0)