Skip to content

Commit

Permalink
Merge pull request #85 from jonstacks/ngrok-go
Browse files Browse the repository at this point in the history
Replace the ngrok-agent with ngrok-go
  • Loading branch information
jonstacks authored Dec 27, 2022
2 parents df77844 + d320396 commit fec2712
Show file tree
Hide file tree
Showing 17 changed files with 283 additions and 254 deletions.
16 changes: 14 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# 0.1.X
# Changelog

## Initial Alpha Releases
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 0.2.0
### Changed

- Moved from calling ngrok-agent sidecar to using the ngrok-go library in process.

## 0.1.X

### Initial Alpha Releases

The ngrok ingress controller is currently in alpha. Releases will have varying features with breaking changes.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.4
0.2.0
34 changes: 19 additions & 15 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ require (
github.com/go-logr/logr v1.2.0
github.com/ngrok/ngrok-api-go/v5 v5.0.0
github.com/spf13/cobra v1.2.1
github.com/stretchr/testify v1.7.0
github.com/stretchr/testify v1.8.0
golang.ngrok.com/ngrok v0.0.0-20221215203300-45a13036a1ff
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4
k8s.io/api v0.23.0
k8s.io/apimachinery v0.23.0
k8s.io/client-go v0.23.0
Expand Down Expand Up @@ -48,12 +50,12 @@ require (
github.com/go-openapi/strfmt v0.19.5 // indirect
github.com/go-openapi/swag v0.19.14 // indirect
github.com/go-openapi/validate v0.19.8 // indirect
github.com/go-stack/stack v1.8.0 // indirect
github.com/go-stack/stack v1.8.1 // indirect
github.com/gobuffalo/flect v0.2.3 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/go-cmp v0.5.6 // indirect
github.com/google/go-cmp v0.5.8 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/google/uuid v1.1.2 // indirect
Expand All @@ -64,12 +66,15 @@ require (
github.com/hashicorp/go-safetemp v1.0.0 // indirect
github.com/hashicorp/go-version v1.1.0 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/inconshreveable/log15 v3.0.0-testing.3+incompatible // indirect
github.com/inconshreveable/log15/v3 v3.0.0-testing.5 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/jpillora/backoff v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.7.6 // indirect
github.com/mattn/go-colorable v0.1.8 // indirect
github.com/mattn/go-isatty v0.0.12 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.16 // indirect
github.com/mattn/go-runewidth v0.0.7 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
Expand All @@ -96,22 +101,21 @@ require (
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.19.1 // indirect
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 // indirect
golang.org/x/mod v0.4.2 // indirect
golang.org/x/net v0.0.0-20210825183410-e898025ed96a // indirect
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa // indirect
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect
golang.org/x/net v0.2.0 // indirect
golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f // indirect
golang.org/x/sys v0.0.0-20211029165221-6e7872819dc8 // indirect
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/sys v0.2.0 // indirect
golang.org/x/term v0.2.0 // indirect
golang.org/x/text v0.4.0 // indirect
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect
golang.org/x/tools v0.1.6-0.20210820212750-d4cc65f0b2ff // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
golang.org/x/tools v0.1.12 // indirect
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.27.1 // indirect
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.23.0 // indirect
k8s.io/component-base v0.23.0 // indirect
k8s.io/klog/v2 v2.30.0 // indirect
Expand Down
64 changes: 44 additions & 20 deletions go.sum

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions helm/ingress-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 0.3.0
### Changed

- Moved from calling ngrok-agent sidecar to using the ngrok-go library in the controller process.
- Moved `apiKey` and `authtoken` to `credentials.apiKey` and `credentials.authtoken` respectively.
- `credentialSecrets.name` is now `credentials.secret.name`
- Changed replicas to 1 by default to work better for default/demo setup.

## 0.2.0
### Added

Expand Down
4 changes: 2 additions & 2 deletions helm/ingress-controller/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apiVersion: v2
name: ngrok-ingress-controller
description: A Kubernetes ingress controller built using ngrok.
version: 0.2.0
appVersion: 0.1.0
version: 0.3.0
appVersion: 0.2.0
keywords:
- ngrok
- networking
Expand Down
14 changes: 0 additions & 14 deletions helm/ingress-controller/scripts/gen-agent-config.sh

This file was deleted.

42 changes: 6 additions & 36 deletions helm/ingress-controller/templates/controller-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,6 @@ spec:
imagePullSecrets:
{{- toYaml .Values.image.pullSecrets | nindent 8 }}
{{- end }}
volumes:
- name: scripts
configMap:
name: scripts
defaultMode: 0755
containers:
- name: ngrok-ingress-controller
image: {{ include "ngrok-ingress-controller.image" . }}
Expand All @@ -60,7 +55,12 @@ spec:
valueFrom:
secretKeyRef:
key: API_KEY
name: {{ include "ngrok-ingress-controller.credentialsSecretName" .}}
name: {{ include "ngrok-ingress-controller.credentialsSecretName" . }}
- name: NGROK_AUTHTOKEN
valueFrom:
secretKeyRef:
key: AUTHTOKEN
name: {{ include "ngrok-ingress-controller.credentialsSecretName" . }}
- name: POD_NAMESPACE
valueFrom:
fieldRef:
Expand All @@ -79,33 +79,3 @@ spec:
periodSeconds: 10
resources:
{{- toYaml .Values.resources | nindent 10 }}
- name: ngrok-cli
image: ngrok/ngrok:3
command:
- ./scripts/gen-agent-config.sh
envFrom:
- configMapRef:
name: {{ include "ngrok-ingress-controller.fullname" . }}-agent-cm
optional: true
env:
- name: NGROK_AUTHTOKEN
valueFrom:
secretKeyRef:
key: AUTHTOKEN
name: {{ include "ngrok-ingress-controller.credentialsSecretName" .}}
{{- if .Values.region }}
- name: NGROK_REGION
value: {{ quote .Values.region}}
{{- end }}
volumeMounts:
- name: scripts
mountPath: /scripts
readOnly: true
---
apiVersion: v1
kind: ConfigMap
metadata:
name: scripts
namespace: {{ .Release.Namespace }}
data:
{{ (.Files.Glob "scripts/gen-agent-config.sh").AsConfig | indent 2 }}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions helm/ingress-controller/tests/controller-deployment_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ tests:
- matchRegex:
path: spec.template.spec.containers[0].env[0].valueFrom.secretKeyRef.name
pattern: test-secret-name
- matchRegex:
path: spec.template.spec.containers[1].env[0].valueFrom.secretKeyRef.name
pattern: test-secret-name
- it: Should pass the region via container args to the controller if specified
set:
region: eu
Expand Down
Loading

0 comments on commit fec2712

Please sign in to comment.