Skip to content

Commit

Permalink
Use separate port for control-port on exit node
Browse files Browse the repository at this point in the history
Although this only occurs with KinD, I've changed the control port
from the same as the data-plane to an alternative port. It appears
to unblock KinD and fix an issue reported by a user.

Fixes: #7

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
  • Loading branch information
alexellis committed Oct 6, 2019
1 parent d647763 commit 3062496
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

## Steps to Reproduce (for bugs)
<!--- Provide a link to a live example, or an unambiguous set of steps to -->
<!--- reproduce this bug. Include code to reproduce, if relevant -->
<!--- reproduce this bug. Include code to reproduce, if relevant -->
1.
2.
3.
Expand Down
2 changes: 1 addition & 1 deletion artifacts/operator-amd64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ spec:
serviceAccountName: inlets-operator
containers:
- name: operator
image: alexellis/inlets-operator:0.2.5
image: alexellis/inlets-operator:0.2.5-rc1
imagePullPolicy: Always
command:
- ./inlets-operator
Expand Down
26 changes: 14 additions & 12 deletions controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import (
)

const controllerAgentName = "sample-controller"
const inletsControlPort = 8080

const (
// SuccessSynced is used as part of the Event 'reason' when a Tunnel is synced
Expand Down Expand Up @@ -537,8 +538,6 @@ func makeClient(tunnel *inletsv1alpha1.Tunnel, targetPort int32, clientImage str
replicas := int32(1)
name := tunnel.Name + "-client"

inletsServicePort := 80

deployment := appsv1.Deployment{
ObjectMeta: metav1.ObjectMeta{
Name: name,
Expand Down Expand Up @@ -574,7 +573,7 @@ func makeClient(tunnel *inletsv1alpha1.Tunnel, targetPort int32, clientImage str
Args: []string{
"client",
"--upstream=" + fmt.Sprintf("http://%s:%d", tunnel.Spec.ServiceName, targetPort),
"--remote=" + fmt.Sprintf("ws://%s:%d", tunnel.Status.HostIP, inletsServicePort),
"--remote=" + fmt.Sprintf("ws://%s:%d", tunnel.Status.HostIP, inletsControlPort),
"--token=" + tunnel.Spec.AuthToken,
},
},
Expand Down Expand Up @@ -672,16 +671,19 @@ func (c *Controller) handleObject(obj interface{}) {
}

func makeUserdata(authToken string) string {
controlPort := fmt.Sprintf("%d", inletsControlPort)

return `#!/bin/bash
export INLETSTOKEN="` + authToken + `"
curl -sLS https://get.inlets.dev | sudo sh
curl -sLO https://raw.githubusercontent.com/alexellis/inlets/master/hack/inlets.service && \
mv inlets.service /etc/systemd/system/inlets.service && \
echo "AUTHTOKEN=$INLETSTOKEN" > /etc/default/inlets && \
systemctl start inlets && \
systemctl enable inlets`
export INLETSTOKEN="` + authToken + `"
export CONTROLPORT="` + controlPort + `"
curl -sLS https://get.inlets.dev | sudo sh
curl -sLO https://raw.githubusercontent.com/alexellis/inlets/master/hack/inlets-operator.service && \
mv inlets-operator.service /etc/systemd/system/inlets.service && \
echo "AUTHTOKEN=$INLETSTOKEN" > /etc/default/inlets && \
echo "CONTROLPORT=$CONTROLPORT" > /etc/default/inlets && \
systemctl start inlets && \
systemctl enable inlets`
}

func hasIgnoreAnnotation(annotations map[string]string) bool {
Expand Down

0 comments on commit 3062496

Please sign in to comment.