Skip to content

Commit

Permalink
Local Tilt Gateway and hydrophone updates (#207)
Browse files Browse the repository at this point in the history
* Fix for gateway-proxy http port in local Tilt stack

* Remove legacy local mongo charts

* Add Glooconfig.yaml

* Update Kindconfig to expose http port 31500

* Remove tilt gateway provisioning

* Various gateway tweaks/fixes

* Allow updating targetPort of internal gateway service

* Add Glooconfig for gateway deployment

* Add env var to use mock ses notifier in hydrophone

* Update default Tiltconfig

* Add glooctl installation instructions

* Bump chart version
  • Loading branch information
clintonium-119 authored Aug 24, 2022
1 parent e1b7957 commit c4b9313
Show file tree
Hide file tree
Showing 21 changed files with 72 additions and 393 deletions.
14 changes: 14 additions & 0 deletions Glooconfig.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
gatewayProxies:
gatewayProxy:
service:
type: NodePort
httpPort: 80
httpsPort: 443
httpNodePort: 31500
httpsNodePort: 32500

settings:
create: true
writeNamespace: default
watchNamespaces:
- default
7 changes: 7 additions & 0 deletions Kindconfig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ kindV1Alpha4Cluster:
apiServerAddress: 127.0.0.1
nodes:
- role: control-plane
extraPortMappings:
- containerPort: 31500
hostPort: 31500
protocol: TCP
- containerPort: 32500
hostPort: 32500
protocol: TCP
---
apiVersion: ctlptl.dev/v1alpha1
kind: Registry
Expand Down
29 changes: 21 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Of course, if you haven't already done so, you should check out [Tidepool](https
- [Install Helm](#install-helm)
- [Install Tilt](#install-tilt)
- [Install Tilt "cattle patrol" (ctlptl)](#install-ctlptl)
- [Install Gloo Gateway CLI (glooctl)](#install-glooctl)
- [Install Netcat](#install-netcat)
- [Install and Configure MongoDB](#install-and-configure-mongodb)
- [Clone This Repository](#clone-this-repository)
Expand Down Expand Up @@ -141,6 +142,18 @@ ctlptl apply -f Kindconfig.yaml

This config will provision and start up the Kubernetes server, and a private docker registry that Tilt will deploy development builds to as you work locally on the Tidepool services.

## Install glooctl

We provision the Gloo gateway, which is responsible for service routing, using glooctl. Please follow the [glooctl Installation Instructions](https://docs.solo.io/gloo-edge/master/installation/glooctl_setup/).

Once installed, you can provision the kubernetes stack with `glooctl`, using the `Glooconfig.yaml` configuration provided at the root of this repo.

```
glooctl install gateway -n default --values Glooconfig.yaml
```

This config will provision the Gloo gateway in the `default` namespace. This only needs to be provisioned once.

## Install Netcat

Netcat should be installed by default on an recent versions of MacOS. If it is not, you can install it via homebrew.
Expand Down Expand Up @@ -442,7 +455,7 @@ The administrator credentials can be tweaked by setting KEYCLOAK_USER and KEYCLO

## Creating An Account

Once your local Tidepool is running, open your Chrome browser and browse to http://localhost:3000. You should see the Tidepool login page running from your local computer, assuming everything worked as expected. Go ahead and signup for a new account. Remember, all accounts and data created via this local Tidepool are _ONLY_ stored on your computer. _No_ data is stored on any of the Tidepool servers.
Once your local Tidepool is running, open your Chrome browser and browse to http://localhost:31500. You should see the Tidepool login page running from your local computer, assuming everything worked as expected. Go ahead and signup for a new account. Remember, all accounts and data created via this local Tidepool are _ONLY_ stored on your computer. _No_ data is stored on any of the Tidepool servers.

## Verifying An Account Email

Expand Down Expand Up @@ -573,7 +586,7 @@ becomes

| Repository Name | Docker Container Name (`<docker-container-name>`) | Description | Language | Git Clone URL (`<git-clone-url>`) | Default Clone Directory (`<default-clone-directory>`) |
| ---------------------------------------------------------------- | ------------------------------------------------- | ------------------------------- | ------------------------------ | -------------------------------------------------- | --------------------------------------------------------- |
| [blip](https://github.com/tidepool-org/blip) | blip | Web (ie. http://localhost:3000) | [Node.js](https://nodejs.org/) | https://github.com/tidepool-org/blip.git | ../blip |
| [blip](https://github.com/tidepool-org/blip) | blip | Web (ie. http://localhost:31500) | [Node.js](https://nodejs.org/) | https://github.com/tidepool-org/blip.git | ../blip |
| [gatekeeper](https://github.com/tidepool-org/gatekeeper) | gatekeeper | Permissions | [Node.js](https://nodejs.org/) | https://github.com/tidepool-org/gatekeeper.git | ../gatekeeper |
| [highwater](https://github.com/tidepool-org/highwater) | highwater | Metrics | [Node.js](https://nodejs.org/) | https://github.com/tidepool-org/highwater.git | ../highwater |
| [hydrophone](https://github.com/tidepool-org/hydrophone) | hydrophone | Email, Invitations | [Golang](https://golang.org/) | https://github.com/tidepool-org/hydrophone.git | ~/go/src/github.com/tidepool-org/hydrophone |
Expand Down Expand Up @@ -761,9 +774,9 @@ blip:
image: tidepool-k8s-blip # Uncommented
hostPath: ../blip # Uncommented and path matches the cloned blip repo location
containerPath: "/app"
apiHost: "http://localhost:3000"
apiHost: "http://localhost:31500"
webpackDevTool: cheap-module-eval-source-map
webpackPublicPath: "http://localhost:3000"
webpackPublicPath: "http://localhost:31500"
linkedPackages:
- name: tideline
packageName: tideline
Expand Down Expand Up @@ -793,9 +806,9 @@ blip:
image: tidepool-k8s-blip
hostPath: ../blip
containerPath: "/app"
apiHost: "http://localhost:3000"
apiHost: "http://localhost:31500"
webpackDevTool: cheap-module-eval-source-map
webpackPublicPath: "http://localhost:3000"
webpackPublicPath: "http://localhost:31500"
linkedPackages:
# ...
- name: viz
Expand Down Expand Up @@ -897,7 +910,7 @@ This will allow your changes to be tracked properly in version control, and Tilt
| Service | Standard Port(s) |
| ----------------------------------------------------------------- | ---------------------- |
| [blip](https://github.com/tidepool-org/blip) | 3000 |
| [blip](https://github.com/tidepool-org/blip) | 31500 |
| [export](https://github.com/tidepool-org/export) | 9300 |
| [gatekeeper](https://github.com/tidepool-org/gatekeeper) | 9123 |
| [hakken](https://github.com/tidepool-org/hakken) | 8000 |
Expand Down Expand Up @@ -966,7 +979,7 @@ If your services are running properly, you can simply ignore the state reporting
Currently, there is a known issue where at times the gateway proxy service that handles incoming requests loses track of the local blip service.
This will present itself usually with the web app getting stuck in a loading state in the browser, or possibly resolving with an error message like: `‘No healthy upstream on blip (http://localhost:3000)`
This will present itself usually with the web app getting stuck in a loading state in the browser, or possibly resolving with an error message like: `‘No healthy upstream on blip (http://localhost:31500)`
The solution first solution to try is to restart the gloo `gateway` services, which should restore access in a few moments:
Expand Down
26 changes: 12 additions & 14 deletions Tiltconfig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,21 @@

### Global Config Start ###
global:
glooingress:
enabled: true
jwt:
disabled: true
extauth:
enabled: false
gateway:
default:
protocol: http
host: localhost:3000
host: localhost:31500
domain: localhost
proxy:
name: gateway-proxy
namespace: default
targetPort: 0
linkerdsupport:
enabled: false
ports:
Expand All @@ -32,22 +39,13 @@ global:
### Global Config End ###

### Gateway Config Start ###
gateway-proxy:
portForwards: ['3000']

gateway:
validation:
enabled: false

glooingress:
enabled: true
jwt:
enabled: false
virtualServices:
http:
name: "internal"
dnsNames: ["*"]
serveAllDomains: true
port: "31500"
options:
cors:
allowCredentials: true
Expand All @@ -71,7 +69,6 @@ glooingress:
- x-tidepool-trace-request
- x-tidepool-trace-session
maxAge: 600s
port: "3000"

apiServer:
enable: false
Expand Down Expand Up @@ -225,11 +222,11 @@ blip:
# image: tidepool-k8s-blip # Uncomment to build and run local image or a specific remote image
# hostPath: ../blip # Uncomment to build and run local image
containerPath: '/app'
apiHost: 'http://localhost:3000'
apiHost: 'http://localhost:31500'
rollbarPostServerToken: '' # Rollbar post_server_item access token for posting source maps on production builds
webpackDevTool: cheap-module-eval-source-map
webpackDevToolViz: cheap-source-map # Suggest changing `cheap-source-map` to the slower, but far more helpful `source-map` if debugging errors in viz package files
webpackPublicPath: 'http://localhost:3000/'
webpackPublicPath: 'http://localhost:31500/'
linkedPackages:
- name: viz
packageName: '@tidepool/viz'
Expand Down Expand Up @@ -329,6 +326,7 @@ hydrophone:
deployment:
env:
clinicServiceEnabled: true
useMockNotifier: true
# image: tidepool-k8s-hydrophone # Uncomment to build and run local image or a specific remote image
# hostPath: ~/go/src/github.com/tidepool-org/hydrophone # Uncomment to build and run local image
containerPath: '/go/src/github.com/tidepool-org/hydrophone'
Expand Down
4 changes: 2 additions & 2 deletions Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ def main():
local('tilt up --file=Tiltfile.kafka --legacy=0 --port=0 >/dev/null 2>&1 &')

# Ensure proxy services are deployed
gateway_proxy_service = local('kubectl get service gateway-proxy --ignore-not-found')
gateway_proxy_service = local('kubectl get service gateway-proxy --ignore-not-found -n default')
if not gateway_proxy_service:
local('tilt up --file=Tiltfile.gateway --legacy=0 --port=0 >/dev/null 2>&1 &')
fail("Gateway service is missing. Please install gateway via glooctl")

# Wait until kafka is ready and kafka secrets are created
if not kafka_service:
Expand Down
174 changes: 0 additions & 174 deletions Tiltfile.gateway

This file was deleted.

1 change: 0 additions & 1 deletion bin/tidepool
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,6 @@ destroy() {
then
docker rm -fv tidepool-kind-control-plane
docker rm -fv ctlptl-registry
rm -r ${DIR}/local/charts
else
echo "Destroy command aborted"
fi
Expand Down
2 changes: 1 addition & 1 deletion charts/tidepool/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
description: A Helm chart for Tidepool
name: tidepool
version: 0.13.15
version: 0.13.16
maintainers:
- name: Todd Kazakov
email: [email protected]
Expand Down
Loading

0 comments on commit c4b9313

Please sign in to comment.