Skip to content

Commit

Permalink
Make ngrok public URL work
Browse files Browse the repository at this point in the history
  • Loading branch information
Christoph Pröschel committed Mar 12, 2021
1 parent 4b2c091 commit c27ee20
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 30 deletions.
9 changes: 6 additions & 3 deletions docs/docs/getting-started/installation/minikube.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ If you want to customize your `Airy Core` instance please see our [Configuration

## Public webhooks

The public webhook URL is generated during the bootstrap process and are
displayed after the process finishes.

In order to integrate with the webhook of most sources on your local machine,
we include a [ngrok](https://ngrok.com/) client as a sidecar to the ingress controller.
ngrok is an open source reverse proxy which
Expand All @@ -34,6 +31,12 @@ client connects to a ngrok server which has public access to the internet and
then provides a reversed proxy connectivity back to the webhook services,
running inside the Kubernetes cluster.

To get the ngrok URL to your local Airy Core installation you can run:

```sh
echo "https://$(minikube -p airy-core kubectl -- get cm core-config -o jsonpath='{.data.CORE_ID}').tunnel.airy.co"
```

By default, the ngrok client is configured to use the ngrok server created by
Airy and run on https://tunnel.airy.co. This configuration is specified in
the `ngrok-client-config` ConfigMap.
Expand Down
10 changes: 2 additions & 8 deletions docs/docs/getting-started/installation/production.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,13 +223,7 @@ records and apply the Kubernetes manifest:
kubectl apply -f infrastructure/helm-chart/templates/ingress.yaml
```

You must set appropriate `host` attributes in the rules for:

- API endpoints (defaults to `api.airy`)
- Webhooks endpoints (defaults to `webhooks.airy`)
- Core UI (defaults to `ui.airy`)
- Chat plugin (defaults to `chatplugin.airy`)
- Tools (defaults to `tools.airy`)
You must set appropriate `host` attributes in the rules for the ingress routes.

If you are not using Traefik, you can use the
`infrastructure/helm-chart/templates/ingress.yaml` file as a guide to create
Expand All @@ -246,7 +240,7 @@ For more details please see our [Configuration Section](configuration.md).

### AKHQ

AKHQ is a GUI for inspecting Apache Kafka. If enabled, it can be accessed under `http://{TOOLS-HOSTNAME}/akhq`,
AKHQ is a GUI for inspecting Apache Kafka. If enabled, it can be accessed under `http://{TOOLS-HOSTNAME}/tools/akhq`,
where {TOOLS-HOSTNAME} is the configured ingress hostname, set in the previous section.
Username is `admin` and the auto-generated password can be retrieved from a configMap:

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/sources/facebook.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ This will open a modal box: add your Callback URL (your instance's Facebook Webh
Your Facebook Webhook URL should have the following format:

```
`https://fb-RANDOM_STRING.tunnel.airy.co/facebook`
`https://RANDOM_STRING.tunnel.airy.co/facebook`
```

Refer to [our section on the Vagrant box
Expand Down
2 changes: 1 addition & 1 deletion infrastructure/cli/pkg/cmd/create/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func create(cmd *cobra.Command, args []string) {
fmt.Println("setting up Helm failed with err: ", err)
os.Exit(1)
}
if err := helm.InstallCharts(); err != nil {
if err := helm.InstallCharts(provider.GetHelmOverrides()); err != nil {
fmt.Println("installing Helm charts failed with err: ", err)
os.Exit(1)
}
Expand Down
4 changes: 2 additions & 2 deletions infrastructure/cli/pkg/cmd/create/helm.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ func (h *Helm) Setup() error {
return nil
}

func (h *Helm) InstallCharts() error {
return h.runHelm([]string{"install", "--values", "/apps/config/airy-config-map.yaml", "core", "/apps/helm-chart/"})
func (h *Helm) InstallCharts(overrides []string) error {
return h.runHelm(append([]string{"install", "--values", "/apps/config/airy-config-map.yaml", "core", "/apps/helm-chart/"}, overrides...))
}

func (h *Helm) runHelm(args []string) error {
Expand Down
4 changes: 4 additions & 0 deletions infrastructure/cli/pkg/providers/aws/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ import (
type Aws struct {
}

func (a *Aws) GetHelmOverrides() []string {
return []string{}
}

func (a *Aws) Provision() (kube.KubeCtx, error) {
cfg, err := config.LoadDefaultConfig(context.TODO())
if err != nil {
Expand Down
4 changes: 4 additions & 0 deletions infrastructure/cli/pkg/providers/minikube/minikube.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ const (
type Minikube struct {
}

func (m *Minikube) GetHelmOverrides() []string {
return []string{"--set", "global.enableNgrok=true"}
}

func (m *Minikube) Provision() (kube.KubeCtx, error) {
if err := checkInstallation(); err != nil {
return kube.KubeCtx{}, err
Expand Down
16 changes: 1 addition & 15 deletions infrastructure/cli/pkg/providers/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,18 @@ import (
"cli/pkg/providers/aws"
"cli/pkg/providers/minikube"
"fmt"
"os"
)

type ProviderName string

const (
Local ProviderName = "local"
Minikube ProviderName = "minikube"
Aws ProviderName = "aws"
)

type Provider interface {
Provision() (kube.KubeCtx, error)
GetHelmOverrides() []string
}

func MustGet(providerName ProviderName) Provider {
Expand All @@ -29,18 +28,5 @@ func MustGet(providerName ProviderName) Provider {
return &aws.Aws{}
}

// TODO remove this provider in #1041
if providerName == Local {
return &LocalProvider{}
}

panic(fmt.Sprintf("unknown provider \"%v\"", providerName))
}

// TODO remove this provider in #1041
type LocalProvider struct {
}

func (l *LocalProvider) Provision() (kube.KubeCtx, error) {
return kube.New(os.Getenv("KUBE_CONFIG_PATH"), ""), nil
}
Empty file modified scripts/bootstrap.sh
100755 → 100644
Empty file.

0 comments on commit c27ee20

Please sign in to comment.